William James Hall Computer Services
Basic UNIX Commands
There's more to your e-mail account than just reading your mail!
UNIX commands are case sensitive. Bracketed information [] is used in conjunction with the command -- read the first command, man for further explanation. man [-k topic]
Man displays short manual pages for many commands and programs installed on the UNIX system. The [-k topic] in brackets indicates that this information may be used with the command man. You can either type man command, where command is what you want information on; or you can use the format man -k topic , where topic is the keyword of the general subject you want information on. Now that you know the man command, you can look up the manual entries (called "man pages") on any UNIX command you need to find out about.
Text Editors
- pico [filename]
Edit a text file using the Pico text editing program
- vi [filename]
Edit a text file using the vi text editing program
Managing files and directories
- ls
Lists the files in your home directory
- ls -al
Lists all files, directories, dot (system) files, and their respective sizes
- pwd
Displays the current working directory
- cd [directory]
Changes the current working directory
- mkdir
Creates a directory
- cp [filename] [directory]
Copies a file into a directory
- cp [filename1] [filename2]
Copies the contents of filename1 to filename2
- mv [filename] [directory]
Moves a file into a directory
- mv [filename1] [filename2]
Renames filename1 to filename2
- rm [filename]
Removes (deletes) a file
- rmdir [directory]
Removes (deletes) a directory. Note: Directories must be empty before being deleted
- more [filename]
Lists the contents of a text file page by page
- cat [filename]
List the contents of a text file. Display will continue without a pause
- cat [filename1] [filename2] > [filename3]
Concatenate (connect) filename1 and filename2 into filename3
Communicating with Others
- who
Lists all the users logged onto wjh
- finger [username]
Shows the finger information and last login of a certain user
- write [username]
Sends a message directly to the user specified
- talk [username]
Requests an interactive 'talk' session with the other user
- mesg [n] [y]
Allows or disallows interruptive messages, such as talk or write. To deny all write and talk messages, use the command mesg n . To allow write/talk access, mesg y
Other Useful Commands
- clear
Clears the screen
- head -n[number] [file]
Display the first [number] lines of a file
- tail -n[number] [file]
Display the last ten lines of a file
- grep [string] [file]
Display every line of the file that contains the specified character string. Only exact matches will be displayed
- cal
Displays the calendar for the current month and year
- cal [month] [year]
Displays the calendar for a specific month and year
- frm
Displays sender and subject lines of all Inbox messages