Useful UNIX operating system commands

passwd change password finger show current users
man commandname help for commandname apropos keywordfind commands related to keyword
mkdir dirnamecreate directory pwd print (show) current directory
cd dirname change directory to dirname cd .. go to parent directory (one level up)
ls list files in current directory mv oldname newname change name oldname to newname
mv filename dirname move file from current directory to new directory cp oldname newname copy content of file oldname to file newname
rm filename remove file cat filename show contents of file
more filename show content of file page by page logout log out

^C (control C) kill job that is running interactively ^Z suspend job that is running interactively
fg foreground (resume) job that has been suspended bg background job that has been suspended
jobslist jobs (running and suspended) toplist processes with the highest cpu usage

Summary of Emacs commands

To enter emacs and read file: type emacs < filename>

C- = control character
M- (meta) = Escape key pressed first

Useful commands

M-f next word M-b previous word
C-a beginning of line C-e end of line
C-kdelete line (starting from cursor) C-ddelete next character after the cursor
C-y restore (yank) line C-x i insert (file)
M-< top of file M-> bottom of file
C-v next screen M-v previous screen
C-s search M-x and then type "goto-line"
C-x C-s save file C-x C-c quit emacs
C-z suspend emacs (fg to restore) C-x C-wsave file to different name

C-x i looks for a file in the same directory as the file you are editing. If sending mail, directory would be /tmp. If you want to insert a file from your home directory, delete '/tmp/' and type '~/filename'.


Please send your additions and comments to Harvey Gould,

Updated 6 January 2006.