UNIX Reference Card Computing and Information Technology UNIX
Total Page:16
File Type:pdf, Size:1020Kb
UNIX 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/ps -u user List all processes for user /bin/ps -u user Kill 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 History 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 alias Create alias alias +Set environment variable 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 at 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 Help 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 Exit 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 ls List filenames ls hidden files ls -a hidden files ls -a file permissions ls -l file permissions ls -l group ownership ls -g group ownership ls -g Copy file cp old new Copy file cp old new Copy file to dirname cp file dirname Copy file to dirname cp file dirname Rename (move) file mv old new Rename (move) file mv old new Remove (delete) file rm file Remove (delete) file rm file Append file1 to file2 cat 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 chmod (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 vi file +vi vi file +pico pico file +pico pico file Using less Using less View file less file View file less file next line <Return> next line <Return> next page <Space> next page <Space> 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 Make directory mkdir dirname Make directory mkdir dirname Change directory cd dirname Change directory cd dirname Remove directory rmdir dirname Remove directory rmdir dirname See current directory name pwd 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.