Chapter 1: Warming up to the Linux Terminal

First Steps with the Terminal

face Robert Craven Josiah Wang

Your terminal will display something of the following form:

username@MACHINE:~$

This whole bit of text is the prompt.

username will be your DoC username—the same as your Imperial ICT username. (It’s usually your initials, followed by some numbers.)

MACHINE will be the name of your current machine. (Each machine in the DoC labs has a different, unique name.)

There’s then a colon :, followed by the name of the working directory. This is the directory in which commands sent to the shell will usually do their work (unless you tell the command to do something elsewhere).

In our case, the current working directory is ~. In a terminal, ~ is a special name for your home directory, where all your personal files are saved (more on this later!).

Let’s now run our first command!

Type ls into the terminal and hit return, as follows. What do you think the purpose of it is?

username@MACHINE:~$ ls

As its name suggests, ls will list the contents of the working directory, by printing them back on the terminal.