A Brief Summary of some UNIX commands

Files and Directories Commands:

ls- list files in current directory.
ls -a- list dot files in current directory.
ls -l- list files in current directory in full form.
pwd- print working (current) directory.
mkdir name- make new directory.
cd pathname- change to directory.
cd- change directory to home directory.
rmdir name- remove directory.
cat file- display a file; concatenate several files.
more file- display file on screen pausing at each screenful. Press space to continue. Press h for help.
cp file1 file2- copy file1 to file2.
mv file1 file2- move file1 to file2 (rename).
mv file dir- move file to directory dir.
rm file- remove file (delete).
du- disk space used (do in home directory).
quota -v- displays your disk quota or allotment.
chmod <who><op><permission> file - change permissions on a file.

Useful Commands:

a2ps -Pprinter file - prints file in two column format.
lp –dlobby file- prints file on laser printer in Dana lobby.
lp –dbrki167-lp1 file- prints file on laser printer in room 167 Breakiron.
lp –ddana213-lp1 file- prints file on laser printer in room 213 Dana.
lp –dbrki164-lp1 file- prints file on laser printer outside room 164 Breakiron.
lpstat –o printer- list printer queues.
cancel job-id- remove job from printer queue (get job-id from lpstat).
man command - displays manual page to screen (on-line help).
man -k keyword- displays one line of commands which contain keyword.
logout- to log off of UNIX.
script- to capture a work session in a file.
exit - to end a script session. To end a rlogin session.
who - displays who is on your machine.
rusers- displays all remote users (all on the network). Control c to get out.
rlogin hostname - remote login to another computer (exit to get off).
date - displays time and date.
wc file - word count of file.
cal- prints a calendar.
spell file - displays misspellings of the file
sort file - displays file sorted alphabetically.
grep 'string' file - displays all lines in file containing the string.
history - history of commands you have typed (!number to redo).
ps- display your processes running on your machine.
ps -ef- display all processes running on your machine.
kill process-id- kill a runaway process (get process-id with ps).
passwd- change your password.