BASIC UNIX COMMANDS wfw @ SDSU 2003 Sep 01 ------------------------------------------------------------------------ Files and Directories Disk Usage _________________________ _________ ls pwd cd du rm mv cp df mkdir rmdir chmod head tail more less cat diff grep sort tar System and Processes Printing _________________________ ________ top source lpr (e.g. lpr -Plaser) ps kill -9 lpq nice at lprm ^z = put in background fg = bring to foreground Shell _____ > = redirect output into a file >> = append output at end of an exisiting file < = use a file as input rather than keyboard | = "pipe" = use the output of one command as input into another & = run in the background source = execute the commands in the file alias (e.g. rm 'rm -i' ) setenv (e.g. setenv HOME /home/wfw) echo $VARIABLE = show what VARIABLE is Special Characters __________________ ~ = home directory . = current directory .. = up one directory level * = wildcard of any length ? = wildcard of one character tab = complete the command ^s = suspend output ( ^ means the key) ^q = restart output ^a = go to start of line Programming & Executing Remote _______________________ ______ source ssh (telnet) f77 or g77 scp (ftp) cc or gcc ping Miscellaneous __________________________ man (and "info" on linux) wc date passwd which mdir, mcopy (for floppies) Some Vital Programs _________________________ xterm compress/uncompress (creates .Z files) gzip/gunzip (creates .gz files) gs (or ghostscript/ghostvew for reading .ps or .pdf) acroread (for reading .pdf) xv, xfig, gimp LaTeX, xdvi, dvips StarOffice/OpenOffice Text Editors ____________ vi, emacs, pico, nano, joe, jed, vim, etc.