Part One
What Is the Terminal?
Before graphical interfaces with windows and icons existed, all computers were controlled through text. You typed a command; the machine responded with text. This is still how professionals interact with computers when they need precision, power, and reproducibility — and it is what you will learn in this book.
The terminal (also called the command line, shell, or console) is a text-based window where you type instructions directly to your operating system. Instead of clicking through folders with a mouse, you type cd Files to move into a folder. Instead of right-clicking to rename a file, you type mv old-name.txt new-name.txt. The computer does exactly what you say — nothing more, nothing less.
Why does this matter for journalists? Three reasons:
- Speed and scale. With one command you can search a million-row dataset for a keyword, rename 500 files at once, or download an entire document archive from a government server.
- Reproducibility. Every command you type can be saved as a script. Your entire data-gathering workflow is then documented, shareable, and repeatable — essential for accountable journalism.
- Access. Many data tools, remote servers, and scraping libraries only work through the command line. Knowing your way around the terminal opens doors that remain closed to everyone else.
Part Two
Opening the Terminal on Mac and Windows
The first step is finding your terminal. The process differs slightly depending on your operating system.
On a Mac: press ⌘ Command + Space to open Spotlight Search. Type Terminal and press Enter. You can also find it in Finder → Applications → Utilities → Terminal. The app icon looks like a black square with a white >_ prompt.
On Windows: Windows does not include a Unix-compatible terminal by default. You need to install Git for Windows, available at git-scm.com. During installation, when asked about adjusting your PATH, choose "Git from the command line and also from 3rd-party software." This makes Unix commands like ls, grep, and cat available. After installing, search your Start menu for Git Bash — this is your terminal.
When you open the terminal for the first time, you will see something like this:
This is the prompt. Reading it left to right: your username (student), then the computer name (MacBook-Pro), then your current location in the filesystem (~ is shorthand for your home folder), and finally the $ which signals the terminal is waiting for your input. In the labs below the prompt is simplified to just $.
$ at the start of a command in any tutorial or documentation, it represents the prompt — it is not part of the command. Do not type the $; type only what comes after it.
Part Three
Vocabulary — Five Words You Must Know
Before we type any commands, let us establish the vocabulary. These five terms appear constantly — in documentation, in error messages, and throughout this entire course. If you understand them now, everything else will fall into place.
Directory means folder. In terminal-speak, folders are always called directories. The two words mean exactly the same thing. Your Downloads folder is a directory. Your Desktop is a directory. We say "change directory" instead of "open folder."
Path is the address of a file or directory. The path /Users/student/Files/data_journalism/cities.csv describes exactly where that file lives on your disk — starting from the root of the drive (/), through each folder in turn, to the file itself. Think of it like a postal address: country → city → street → building number, but written right to left with slashes.
Command is the instruction you type. ls is a command that lists files. cd is a command that changes your current directory. The command is always the first word on the line.
Argument is the extra information you give to a command — usually the thing to act on. In cat notes.txt, the command is cat and the argument is notes.txt (which file to display). In cd Downloads, the argument is Downloads (where to go).
Flag (also called an option) modifies how a command behaves. Flags always start with a hyphen -. In ls -l, the -l flag switches the output to a long, detailed format. Multiple flags can be combined: ls -lah means long format + all files + human-readable sizes.
command [flags] [argument]. Example: ls -lah Files — list the contents of the Files directory (argument) in long, all-files, human-readable format (flags).
Try the sandbox below. Type help and press Run to see all available commands. Then try whoami and pwd:
$
Try: help · whoami · pwd
Part Four
Your First Three Commands
Three commands answer the three questions every terminal session starts with. Run them in this order every time you open a new terminal window — they orient you instantly.
whoami answers "Who am I logged in as?" The terminal responds with your username. This matters on shared machines or remote servers, where you may have different accounts with different permissions.
pwd answers "Where am I?" It stands for print working directory. The terminal responds with the full path of your current location. This is one of the most important commands you will ever run — the majority of terminal errors happen because you are not in the directory you think you are.
ls answers "What is in here?" It stands for list. The terminal lists the files and directories inside your current location. On its own, ls gives a simple list of names. Add -lah for a detailed view: ls -lah shows file permissions, owner, size in human-readable form, last-modified date, and name for every entry including hidden files.
$
Try each in order: whoami → pwd → ls → ls -lah
After running ls you should see three entries: Desktop, Downloads, and Files. These are the directories inside your home folder. In the next chapter you will learn to navigate between them and explore what is inside each one.
Part Five
Setting Up Your Workspace
One of the first things the class recommends is creating a single dedicated folder for all your journalism work — and keeping everything there. The folder is called data_journalism.
Notice the naming: no spaces, no capital letters, words joined by an underscore. This is terminal-friendly naming. Spaces in file and folder names create problems because the terminal uses spaces to separate arguments. data journalism looks like two separate arguments; data_journalism is clearly one name.
File naming rules for terminal work:
- Use underscores
_or hyphens-instead of spaces - Stick to lowercase letters
- Use descriptive names you will recognise six months from now (
athens_air_quality_2025.csv, notfile1.csv) - Include dates in ISO format when relevant:
YYYY-MM-DD(example:interview_2026-03-04.txt)
To create a new directory, use the mkdir command (make directory). Let us create the project folder inside Files. Follow the sequence in the lab below:
$
Steps: ls → cd Files → mkdir data_journalism → ls → cd data_journalism → pwd
git command for version control.
whoami, pwd, ls, and mkdir. In Chapter 2 you will learn to navigate the full file system.
Chapter Navigation
Move between chapters.