Knowledge Base

Common Unix Shell Commands

Starting and Ending
File Management
Communication
Information
Printing
Job Control

The following is a short list of most basic Unix shell commands users will need. For more information, try man command or man -k text to search for possibilities.

Starting and Ending

ssh hostname: Connect to another machine or server
exit: Log out

File Management

emacs [filename]: Use the emacs text editor
pico [filename]: Use the pico text editor (which is simpler but less powerful than emacs).
cat [filename]: List the contents of the file
mkdir [dirname]: Create a directory
cd [dirname]: Change your current directory

cd .. brings you up one level
cd alone brings you back to your home directory

ls: List files in the directory (-l: long, -a: -all)
cp [source] [destination]: Make a copy of a file
mv [source] [destination]: Change the name of a file
rm [filename]: Delete a file
rmdir [dirname]: Remove a directory
chmod: Change access to a file chmod

user, group, owner, all
read, write, execute

cmp [filename] [filename]: Compare two files
wc [filename]: Word, line, and character count

the asterisk (*) is used as a wildcard: thus rm a*.php would remove all files that began with ‘a’ and ended with php.

Communication

alpine: Use Alpine to send and receive e-mail
talk [user]: Talk to another user
write [user]: Write messages to another user (CTRL-C to close)
wall [message]: send message to all users

Information

Man [command]: Manual pages
quota -v: Find out your available disk allotment
finger [user]: Get information about a user
passwd: Change your password
who (or w): Find out who's logged on

Printing

lp [file]: Print a file
lprm [job]: Removing a print job
lpq: Checking the print queues

Job control

ps: Find processes
kill [process id]: Kill a process
nice [process id]: Change the priority of a job
&: What is a background process?
CTRL-z: Suspending a process
fg: Resume suspended process