The Terminal

The oldest window on your computer

Black background, blinking cursor, no buttons anywhere. It looks like the bit you are not supposed to touch. It's actually the oldest and plainest way to talk to a computer, and once you know where it came from, none of it is scary.

1. Typing instead of clicking

Everything you do by clicking, you could do by typing instead. Open a folder, copy a file, rename fifty photos, start a program. The terminal is the window where you type those instructions, one line at a time, and the computer types back.

That sounds like the slow way round, and for opening one folder it is. It stops being the slow way the moment there are fifty folders, or you have to do the same job every Monday, because a typed command can be saved, repeated and sent to somebody else. You cannot email somebody a mouse movement.

You will not break anything by looking. Opening a terminal and typing the commands on this page is about as risky as opening a folder. The genuinely dangerous part is pasting in a command you do not understand, and there's a whole section on that below.

2. Why is it called a "terminal"?

Because it was the end of the line. Same word as a bus terminus, and the same word as when a program terminates: the end.

In the 1960s and 70s a computer was a room. One extremely expensive machine, and dozens of people who all needed a turn on it. So you did not sit at the computer, you sat at a terminal: a keyboard and a screen (or a printer) on the end of a long cable, with the actual computer somewhere down the corridor.

The terminal itself could not compute anything. It sent your keystrokes down the wire and displayed whatever came back. That is exactly why they were called dumb terminals, and it's not an insult: all the thinking happened at the other end.

The word never went away. In the Networks lesson you will meet an endpoint: a device sitting at the end of a network connection. Same idea, sixty years later, with the cable replaced by wifi.

Check your understanding: Why were the first terminals called "dumb"?

3. It used to print on paper. That's why it's print

Before screens were cheap, a terminal was an electric typewriter. You typed a line, it clattered off down the wire, and the computer's answer was typed back onto a roll of paper. The famous one was the Teletype Model 33, from 1963, and programmers worked on machines like it for years.

That is not a bit of trivia you can safely forget, because you use it every single lesson:

  • print() is named after an actual printer. When you write print("Hello") in Python, you are using the word that meant the machine physically printed your text onto paper. The name outlived the paper by fifty years.
  • \n is a lever. The line feed rolled the paper up one line. The carriage return shoved the print head back to the left margin. Two separate physical actions, which is why Windows text files still end their lines with both (\r\n) and Mac and Linux with just one (\n).
  • Linux and macOS still call terminals tty. Short for teletype. Open a terminal on a Mac, type tty, and it will answer with something like /dev/ttys003. You are being told which teletype you are sitting at, on a machine that has never seen one.

Check your understanding: Why is Python's output command called print?

4. From paper to glass

Screens arrived and terminals became glass teletypes: same job, no paper, no noise, no forest destroyed. The most famous was the DEC VT100 in 1978, and it mattered so much that we are still copying it today.

  • Colours. The VT100 understood short bursts of odd-looking characters that meant "go red now" or "move the cursor up two lines". Those are called escape codes, and they are still how a terminal does colour in 2026.
  • 80 characters wide. A VT100 screen was 80 columns across, because the punched cards before it were 80 columns across. That is why so much code is still written to fit in 80 characters a line, on screens the size of a door.
  • The one on your laptop is a copy. Terminal, iTerm, PowerShell, the black window in VS Code: they are terminal emulators, software pretending to be a hardware terminal from 1978. There's no terminal in your laptop. There's a program drawing one.

5. Terminal or shell? They are different things

People use the two words for the same window, and they are not the same thing.

  • The terminal is the window: the black rectangle, the font, the cursor, the scrollbar. It shows characters and collects your keystrokes. That's all it does.
  • The shell is the program running inside it that actually reads your command and does something about it. On a Mac that is usually zsh, on Linux usually bash, on Windows PowerShell or the older cmd.

The window is the letterbox; the shell is the person who reads the post. Now look at what the shell prints while it waits for you, which is called the prompt:

sam@laptop:~/Homework$

sam
who you are logged in as
laptop
which machine you are on
~/Homework
which folder you are standing in. ~ is your home folder
$
the shell saying it is your turn to type

C:\Users\sam\Homework>

C:\Users\sam\Homework
the same folder, spelled the Windows way
>
the same "your turn to type"

Everything before the $ or the > is the shell telling you where you are. Read it before every command, and half of all terminal confusion disappears: nearly every "it says no such file" is really "you are not standing in the folder you thought you were".

Check your understanding: Which part is the shell?

6. Terminal or Python shell? Also different

If you use IDLE at school, you have already met a window with a prompt in it, and it's not a terminal. Two different prompts, two different languages:

A system terminalThe Python shell (IDLE, or the Sandbox here)
SpeaksCommands for the whole computer: cd, dir, pythonPython, and only Python
Prompt$ or >>>>
Typing print("hi")"command not found", it isn't a computer commandPrints hi
Typing dirLists the folderAn error, unless you mean Python's own dir()
It isText, and the whole machine behind itA friendlier, Python-only place built for learning

They meet in one place: from a terminal you can type python hello.py and the terminal starts Python for you, hands it your file, and prints whatever your program prints. IDLE's Run button is doing the same job with a button on it. That's the whole difference: the terminal drives the computer, the Python shell drives Python.

7. Have a go

This is a pretend terminal. Nothing in it is real, so nothing you type can go wrong. Type help and press Enter, then have a poke around. Press the up arrow to bring back your last command, the way a real one does.

pretend terminal

Three things to do in there:

  • List what's inside Homework/Term1
  • Read notes.txt
  • Make the computer say something back with echo
So is this a real terminal? No. And the honest word for it is not "pseudoterminal" either.

A pseudoterminal is a genuine thing with a job: when your Terminal app opens, the operating system hands it a pretend cable, so the shell can carry on believing it is wired to a 1978 machine with a keyboard on the end. The shell is fooled on purpose, and everything it does is real. Type tty in a real terminal and the name it prints is one of those.

This one is not fooling any shell, because there isn't one. There's no operating system on the other end and no files: just a web page reading your words and deciding what to print. The right word is a simulator. A flight simulator is not a pseudo-aeroplane.

8. The cheat sheet

The commands split into two families, because Windows grew up separately from macOS and Linux. Learn one column, and recognise the other.

What you wantmacOS & LinuxWindows
Where am I?pwdcd
What is in this folder?lsdir
Go into a foldercd Homeworkcd Homework
Go back out onecd ..cd ..
Print a text filecat notes.txttype notes.txt
Make a foldermkdir Term3mkdir Term3
Copy a filecp a.txt b.txtcopy a.txt b.txt
Wipe the screenclearcls
Run a Python filepython3 hello.pypython hello.py

Two habits worth stealing on day one: press Tab to finish a name you have started typing (the shell knows what is in the folder, and it never makes typos), and press the up arrow to bring back the command you just ran instead of typing it again.

9. Never paste what you cannot read

Everything above is safe. Here is the one rule that keeps it that way.

A command does exactly what it says, instantly, to your real files, without an "are you sure?" and usually without an undo. Deleting a folder full of work is one short line. So is downloading a program from a stranger and running it.

This is why a very old scam still works: a website or a video says "your computer is slow, just paste this into the terminal to fix it". The command is deliberately long and full of things that look technical. People paste it. It's ransomware.

The habit: if you did not write it and cannot say what every word of it does, do not paste it into a terminal. Not from a forum, not from a video, not from a chatbot, not from a friend who says it worked for them. Ask somebody who can read it, or look up the words one at a time. Nothing you actually need is ever a mystery command from a stranger.

Check your understanding: A video says to fix your slow laptop by pasting a long command into the terminal. What do you do?

Module test

Five questions on the terminal. Your best score shows on your My Progress page.

1. Where does the name "terminal" come from?

2. Why is Python's print() called print?

3. What is the difference between a terminal and a shell?

4. You see the prompt >>>. What are you typing into?

5. On macOS or Linux, which command lists what is in the folder you are standing in?

Glossary

Terminal
The window that shows text and collects your keystrokes. Named after the terminals on the end of a cable to a shared computer.
Terminal emulator
The program on your laptop that draws a terminal. Terminal, PowerShell and the panel in VS Code are all emulators of hardware from the 1970s.
Dumb terminal
A terminal with no computing power of its own: it sent keys down the wire and displayed the reply.
Teletype (tty)
An electric typewriter used as a terminal. Linux and macOS still name terminal devices after them.
Shell
The program that reads your commands and runs them: zsh, bash, PowerShell, cmd.
Prompt
What the shell prints while it waits for you. It usually says who you are and which folder you are standing in.
Python shell
A prompt that only understands Python, like IDLE's window or the >>> you get by typing python. Not the same as a terminal.
Pseudoterminal
The pretend cable the operating system gives a terminal emulator so the shell believes it is talking to real hardware.
Escape code
A short burst of characters that means "change colour" or "move the cursor". How terminals have done colour since the VT100.