Commands for administering various aspects of the UNIX operating system. Most of these commands can be used in batch files to perform complex administrative tasks from a single command. You can create batch files with a text editor such as ed or vi and schedule their execution by using the cron command. The following table describes some commonly used UNIX commands. (They are listed in alphabetical order, not according to function.)
Some commands have a simple syntax, such as the cd command for changing the current directory. Others are more complex and include scripting engines and even programming compilers, such as cc, the UNIX C compiler.
Most versions of UNIX support these commands, but there are subtle differences from system to system. To see the syntax for any UNIX command, use the man command, which provides access to the UNIX online command reference on most UNIX systems. For example, to see the syntax for the cd command, type man cd.
Command | Description |
alias | Displays or sets aliases for long command strings |
awk | Searches a file for a pattern and performs an action on the lines containing that pattern |
bg | Moves a stopped process into the background and restarts it |
cal | Displays a calendar |
cat | Concatenates or displays files |
cc | C language compiler |
cd | Changes the current directory |
chgrp | Changes group ownership of a file |
chmod | Changes access permissions for a file |
chown | Changes individual ownership of a file |
chsh | Changes the default shell in a password file |
clear | Clears the screen |
cmp | Compares two files and returns the line numbers that differ |
cp | Copies a file |
csh | C shell command interpreter |
date | Displays the date and time |
df | Displays the amount of free disk space in a file system |
diff | Displays differences between two files |
du | Displays file system usage |
echo | Echoes the text typed following the command to the screen; in a batch file, displays a line on the screen |
ed | Text editor |
elm | Text-based e-mail |
emacs | Text editor |
f77 | FORTRAN77 compiler |
fg | Moves a stopped process to the foreground and restarts it |
find | Finds a file with specified characteristics |
ftp | File Transfer Protocol (FTP) client |
grep | Searches a file for a text pattern |
head | Displays the beginning of a file (by default, displays the first 10 lines) |
help | Displays help |
hostname | Displays the name of the current host system |
kill | Ends a running process |
ksh | Korn shell command interpreter |
ln | Links files |
lpq | Displays the print queue |
lpr | Sends a print job to the spooler |
ls | Lists files in a directory and displays the file statistics |
mail | Sends e-mail |
man | Accesses the online manual |
mkdir | Creates a new directory |
more | Displays a file one screen at a time |
mv | Moves or renames a file |
passwd | Changes your password |
pico | Text editor |
pine | Text-based e-mail program |
ps | Displays the status of a process |
pwd | Displays the name of the current directory |
rm | Deletes a file |
rmdir | Deletes a directory |
sed | Stream line editor |
sh | Bourne shell command interpreter |
sleep | Pauses a process |
sort | Sorts or merges files |
split | Splits a file into multiple files |
talk | Text-based chat |
telnet | Terminal emulator |
uucp | UNIX-to-UNIX system file copies |
uudecode | Decodes a uuencoded file |
uuencode | Encodes a binary file |
vi | Text editor |
who | Displays who else is logged on |
whoami | Displays the name of the user currently logged on |
whois | Finds remote users and sites |
write | Sends a message to a user |