<<

UNIX

Reference Card Reference Card Computing and Information Technology Computing and Information Technology

Job and Process Control Job and Process Control Run job j in the background j & Run job j in the background j & List jobs jobs List jobs jobs Connect to job number n %n Connect to job number n %n List all processes for user /bin/ -u user List all processes for user /bin/ps -u user process with id pid kill -9 pid Kill process with id pid kill -9 pid Kill job with number n kill -9 %n Kill job with number n kill -9 %n I/O Redirection I/O Redirection Standard output > or >! Standard output > or >! Append to standard output >> or >>! Append to standard output >> or >>! Standard input < Standard input < Standard error and output >& Standard error and output >& Standard error separately < command > output Standard error separately < command > output >& errorfile >& errorfile C Shell C Shell History Create history list of n items set history=n Create history list of n items set history=n See history list history See history list history Repeat last command !! Repeat last command !! Display last command !!:p Display last command !!:p Execute previous command Execute previous command that starts with str !str that starts with str !str Command line n !n Command line n !n First argument of last command !^ First argument of last command !^ Last argument of last command !$ Last argument of last command !$ All arguments of last command !* All arguments of last command !* Replace old with new in Replace old with new in last command ^old^new^ last command ^old^new^ C Shell Customization C Shell Customization Create alias Create alias alias +Set setenv +Set environment variable setenv +Set shell variable set +Set shell variable set Programming Language Compilers Programming Language Compilers +*Ada ada +*Ada ada Allegro Common Lisp acl Allegro Common Lisp acl * Ansi C acc * Ansi C acc Assembler as Assembler as + C++ CC + C++ CC + FORTRAN f77 + FORTRAN f77 + Fortran 90 f90 + Fortran 90 f90 GNU C gcc GNU C gcc GNU C++ g++ GNU C++ g++ *Quintus Prolog prolog *Quintus Prolog prolog

* cpu licensed product * cpu licensed product + Additional CIT documents available + Additional CIT documents available Document Number: UNX-REF-002 Revised: September 2000 Document Number: UNX-REF-002 Revised: September 2000 ã 1993 Academic Services, CIT, University Buffalo ã 1993 Academic Services, CIT, University at Buffalo Reference cards summarize commands for a specific application* Reference cards summarize commands for a specific application* For additional information contact the CIT Desk, 216 Computing For additional information contact the CIT Help Desk, 216 Computing Center, at (716) 645-3542, or send email to cit-helpdesk@buffaloedu* Center, at (716) 645-3542, or send email to cit-helpdesk@buffaloedu* UNIX UNIX

Reference Card Reference Card Computing and Information Technology Computing and Information Technology

Basic Commands Basic Commands Log out of system logout Log out of system logout current shell ^D or exit Exit current shell ^D or exit Online Documentation Online Documentation See online manual page man command See online manual page man command Search for a manual page man -k keyword Search for a manual page man -k keyword Files Files List filenames List filenames ls hidden files ls -a hidden files ls -a permissions ls -l file permissions ls -l group ownership ls -g group ownership ls -g Copy file old new Copy file cp old new Copy file to dirname cp file dirname Copy file to dirname cp file dirname Rename (move) file old new Rename (move) file mv old new Remove (delete) file file Remove (delete) file rm file Append file1 to file2 file1 >> file2 Append file1 to file2 cat file1 >> file2 Home directory ~ Home directory ~ Home directory of user ~user Home directory of user ~user Change file permissions (ugo+-rwx) Change file permissions chmod (ugo+-rwx) file file Wild cards Wild cards single character ? single character ? multiple characters * multiple characters * range (a, b are single chars) [a-b] range (a, b are single chars) [a-b] File Editors File Editors +emacs emacs file +emacs emacs file + vi file +vi vi file +pico pico file +pico pico file Using Using less View file less file View file less file next line next line next page next page search for pattern /pattern search for pattern /pattern next occurence n next occurence n next file :n next file :n help :h help :h quit :q quit :q Directories Directories directory dirname Make directory mkdir dirname Change directory dirname Change directory cd dirname Remove directory dirname Remove directory rmdir dirname See current directory name See current directory name pwd Current directory . Current directory . Parent of current directory .. Parent of current directory .. Root of file sytem / Root of file sytem / Printing Printing +Print file to default printer +Print file to default printer (Bell Hall) lpr file (Bell Hall) lpr file +Print file to another site lpr -Pprinter file +Print file to another site lpr -Pprinter file +View printer queue lpq -Pprinter +View printer queue lpq -Pprinter +Remove job number jn lprm jn +Remove job number jn lprm jn +View job turnaround prstat +View job turnaround prstat + Additional CIT documents available + Additional CIT documents available