The terminal, without fear
Open it on your own machine, then practise the eight commands that cover most day-to-day work right here on this page.
A terminal is a text window where you type a command and the computer answers. That is all it is. It can look intimidating because it gives you very few hints, but it is also direct: when something goes wrong, it usually tells you what happened and where.
First, open one. Pick your operating system below and follow the three steps. You should end up looking at a window with a prompt in it, waiting for you.
macOS: open Terminal
- Hold Command and tap Space. A search bar drops into the middle of the screen.⌘+Space
- Type the word terminal. You do not have to finish it: the first result is the app called Terminal.
- Press Return. A window opens with one or two lines of text and a cursor sitting there, waiting.return
- Optional, and worth it: right-click its icon in the Dock, then Options, then Keep in Dock. You will want it tomorrow.
The words before the prompt will not match exactly, your user name, your machine name, your date. What matters is the shape: a line that ends in a symbol, then a cursor doing nothing until you type.
Found it? Leave the window open beside this page. Everything in the rest of this chapter is typed into it.
Now practise without risk. The terminal below parses your commands, resolves paths and produces the same kinds of errors as a real shell, but it runs entirely on this page against a pretend filesystem. Nothing you type here can break your machine. Work through the five tasks on the right.
- Find out where you arenot done yet
- See what is herenot done yet
- Go into projectsnot done yet
- Read a filenot done yet
- Come back upnot done yet
Nothing is locked behind these. They tick when you run something that actually does the job.
Click the screen to type. Tab completes a name, up and down arrows walk back through what you typed, help lists everything. Wrong commands are supposed to happen: the errors are the ones your own machine prints.
Two habits are worth forming early. Read the error instead of skimming it; terminal errors usually tell you the file, the line and the reason. And when you do not know where you are, type pwd. Getting lost in the filesystem is common, and that one command tells you exactly where you are.
You will not memorise these. You will type them a few hundred times over the next nine phases and they will become invisible, the way the keyboard shortcut for copy is invisible now.
You should now be able to
- Open a terminal on your operating system
- Move around a filesystem from the command line
Loading…