Department of Computing Science
Introduction to Computer Systems
Umeå universitet

 

Commands in Unix

Commands?

In the non-graphical part of Unix (often known as the shell), commands are used to get things done. A command is just a name of a program that you enter at the command line followed by an "enter", whereupon the program will run. You can supply parameters to the program to get it to do something differently. One example is the command lpr, which is used to send documents to a printer.

Tab completion

When you are in the shell and about to enter a command or a filename, you can use a feature known as "tab completion". This feature allows the system to aid you when entering long filenames or directory paths. The tab key is used to invoke the completion.

For example: Enter vim (followed by a blank space) and press TAB
A list with the files in the current directory will appear
Enter the first few characters in a filename or directory name and press TAB again
The shell will now show a list with files and directories containg the characters you entered
This procedure can be repeated until you have completed the correct file

This is a very nice feature when moving between directories in Unix, where pathnames can be very long and complicated to remember.

Some common commands

Below is a list with some of the most often used commands. To learn more about a command, issue the command man followed by the command name, e.g. man lpr. To exit man, press q. Use man to learn more about the following commands.

ls Lists the files in the current directory
pwd Shows the path of the current directory
cd Changes directory
cp Copies a file
mkdir Creates a directory
rmdir Removes a directory
rm Removes a file
man command Shows the man page for a command
pine A simple mail client
mutt A somewhat more advanced mail client
passwd Changes the login password


----------------------------------------------------
Department of Computing Science
Ume University
The information on this page was modified 2014-09-12
Responsible for this page: Webmaster
 
Address: SE-901 87 Ume, Sweden
Phone: 090-786 50 00
Fax: 090-786 61 26
E-mail: datavetenskap@cs.umu.se