This reference sheet lists many of the commonly used commands in the UNIX operating system. To learn more about these commands, refer to the on-line manual pages (triggered by the
man command). Notice that UNIX is case- sensitive so capitalization will matter. All commands should be typed in lower case.
In the following examples, please note that the "
[" and "
]" symbols are not to be typed. They are intended to highlight specific, variable pieces of information to be entered by you as part of the command, such as file names or directory names.
Help and Logout
man [command]
with [command] being replaced by the specific command you wish to know more about |
Get on-line help for a command. |
|
man -k [keyword] |
Find documentation referring to the keyword. |
|
lo
|
Logout when finished using the system. |
You can find more information about any of the commands on this page by using the "man" command above. And please remember to log off when you are finished with your terminal session.
File Manipulation
Directory Commands
|
cd [directory] |
change directory |
|
ls [file(s)] |
list of files and directories |
|
ls -a [file(s)] |
list files including hidden files |
|
ls -l [file(s)] |
list files in long format (includes date, size, protection) |
|
ls -F [file(s)] |
list files denoting directories and executables |
|
mkdir [directory] |
make a new directory |
|
pwd
|
show the directory you are currently in |
|
rmdir [directory] |
delete a directory |
File Commands
Note: all these commands may be followed by
-i for an interactive safety mode. This mode will cause the system to ask for confirmation before deleting or overwriting any files.
|
cp [source file(s)] [destination] |
copy files |
|
cp -r [source file(s)] [destination] |
copy files and subdirectories |
|
mv [source file(s)] [destination] |
move files |
|
rm [file(s)] |
remove (delete) files |
|
rm -r [file(s)] |
delete files including subdirectories |
Display Commands
|
more [file] |
display a text file one screen at a time |
|
cat [file] |
display a text file without pausing at the end of each page |
|
cat [source files] [destination file] |
concatenate the source files into a destination fill |
Process Control
UNIX is capable of running more than one process at a time. Processes can be run either in the foreground, as is normally the case, or they can be run in the background, where they are out of the way but still accessible to you later.
- To stop a process in the foreground, the command to kill it is
Ctrl-c.
- To leave the process running, but move it to the background, the command is
Ctrl-z.
- A process can be started in the background by following the command with an
& (ampersand) before pressing return.
The following commands will help to navigate through foreground and background files:
|
fg [%jobnumber] |
bring the specified job to the foreground. The default is the last job exited. |
|
jobs
|
list all jobs running including process numbers |
|
ps
|
list all processes running including process ID numbers |
|
bg [%jobnumber] |
force specified job into the background |
|
kill [-9] [%jobnumber or processID] |
Kill a specified process by job or process ID number. -9 is more powerful. |
Programs
Mail Program
The default mail program on our UNIX systems is pine. The command to run pine is simply
pine. To exit pine, type q for quit. All commands will be displayed at the bottom of the screen.
Text Editor
Pico is used to edit text files. The command is
pico. Pico is the same used in pine to edit your messages. All commands will be displayed at the bottom of the screen. A
[^X] means
Control key + the [X] key.