Unix cheat sheet

Excerpt from:
Open Source GIS: A GRASS GIS Approach, First Edition, 2002
www.grassbook.org

Table 2.1. List of important UNIX system commands

CommandImportant option(s)Impact of the commandImpact of the option(s)/remarks
catfiledisplay text file contents
chgrp<group> filechange group owner of file or directory
chmod<options> filechange permissions for file or directory
chown<owner> filechange owner of file or directory
cpsource targetcopy filetarget may be a new file name or directory
df-k partitiondisplay free space on hard drive-k: values in kilobyte, dot for current directory
exitfinish terminal session/programe.g. to finish GRASS
filefiledisplay file type (mime type)displays, if file is in ASCII or binary format
ftphostnamefile transfer via networkhostname: Internet address
grepstring filesearch for string in filestring should be quoted
gunzipfileuncompress file with “.gz” extension
gzipfilecompress file
head-n filedisplay heading lines of text file-n: number of lines to display
kill-9 pidremove hanging process from system-9: force removal, find pid with ps command
lpr-P printer fileprint file on printer
ls-l or -lalist directory’s contents-l: long, -la: hidden files as well
manprogramonline manualUsage: man program
mkdirdirectorymake directory
moreascii_filedisplay text file page-wisecontinue with <ENTER> to next page
mv-i source targetmove or rename file/directorysource and target: new filename or directory
ps-aef (or -aux)display running processesdisplay process data, especially pid (process-ID)
pwdprint working directory
rm-i file resp. -ir directoryremove file/directory-i: query interactively, -r: recursive
rmdirdirectoryremove empty directory
scriptlogfilelog session into text filefinish with <CTRL><D>
sshhostnamesecure terminal for external hostshostname: Internet address
tarxvf package.tarextract files with directory structure
tarcvf newpack.tar sourcepackage directory structure-c silently overwrites existing packages

 

unix_dir

Unix file permissions

unix_dir_gdata

GRASS GIS: possible data https://