Unix Quick Reference

Job and Process Control
Run job j in the background j &
List jobs jobs
Connect to job number n %n
List all processes for user ps -u user
Kill process with id pid kill pid
Kill job with number n kill %n
I/O Redirection
Standard Output >
Append to standard output >>
Stardard Input <
Standard Error and Output >&
Essentials
Logout of system logout
Exit current shell exit
Files
List filenames ls
hidden files ls -a
file permissions ls -l
by time ls -lt
Copy files cp old new
Copy file to directory cp file dirname
Rename (move) file mv old new
Remove (delete) file rm file
Append file to file1 cat file >> file1
Change file permissions chmod {ugo}{+-}{rwx}
Using less
View files less file
next page <Space>
previous page b
next line <Enter>
search for pattern /pattern
next occurrence n
quit q
Directories
Make directory mkdir dirname
Change directory cd dirname
Remove directory rmdir dirname
See current directory name pwd
Current directory .
Parent of current directory ..
Root of filesystem /
Home directory of user ~
Go to home directory cd
Miscellaneous
Search file for pattern grep 'pattern' file
Search through history <Up-arrow>
Complete file name <Tab>
Compiler
compile c source file gcc -o output source.c
execute compiled file ./output
On-line Documentation
See on-line manual page man command
Search for manual page man -k keyword
Use on-line help system help