Department of Engineering

IT Services

Typing Commands to the Shell

This document is concerned with using the Unix operating system through a command line interpreter - a shell. Several shells are available. This document covers the most common ones (bash, the Posix shell, etc).

You'll need a `terminal window' to type commands into. On our machines you can start one by clicking on the Terminal' icon in the Favorites submenu of the Applications menu.

Firstly, type the command date, and press the <Return> key. This prints out the time and day. (Typing the name of a program executes that program just the same as double clicking on its icon in the File Manager).

Notice that you can use the <Back space> key to correct typing errors.

The interrupt character is C-c (i.e. hold the CTRL key down and press c). This is useful if you give a command or start a program which is either broken or is taking too long to finish. To abort you just type C-c. To try this, type the command

sleep 1000

This will make the computer wait for 1000 seconds before asking you for the next command. Let's assume you don't want to wait for a quarter of an hour so type C-c. Shortly the prompt will return. The sleep command has been aborted.

Throughout this guide the notation `C-' will be used to indicate use of the CTRL key (e.g. C-c for interrupt as above).