UNIX Quick Reference

This quick reference lists commands, including a syntax diagram and brief description. Arguments inside the brackets ([..]) indicate an optional part of the command. For more detail, click on the command.

9.1 File Manipulation
List files in current directory ----> ls -[l]
List hidden files ----> ls -[l]a
Display file contents ----> cat filename
Page through file ----> more filename
Copy ----> cp source destination
Move or Rename ----> mv oldname newname
Remove (delete) ----> rm filename
Create or modify file ----> pico filename
Search with grep filter ----> grep pattern filename
9.2 File Properties
Changing permission ----> chmod nnn filename
  ----> chmod c=p[,c=p...] filename

where n is a digit from 0 to 7 which sets the access level for the user(owner), group, and others(public), respectively. c is one of: u for user, g for group, o for other, or a for all. p is one of: r for read access, w for write access, or x for execute access.

9.3 Directories
Change Directory ----> cd directory_name
Make new Directory ----> mkdir directory_name
Remove directory ----> rmdir directory
Print working(current) directory ----> pwd
9.4 Job Control
Run command in the background ----> command &
Stop foreground job ----> CTRL-Z
List of background jobs ----> jobs
Bring job forward ----> %n
Resume job in background ----> %n &
9.5 Processes
Listing  
BSD ----> ps -[aux]
SYSV ----> ps -[elf]
Terminating ----> kill -[HUP] PID
9.6 Managing Disk Space
Disk usage of file system ----> df
Disk usage of individual from current directory ----> du -s
Disk usage of files from current directory ----> ls -l
9.7 Printing
Printing a file from a cmd shell ----> lpr -Pprintername filename
Checking the printer queue ----> lpq -Pprintername
9.8 Miscellaneous Commands
List commands for subject ----> man -k subject
Display documentation ----> man command
Log out ----> exit
  ----> logout
Last Updated: Oct 31, 2012