What is the command line?
The command line is a way of using a computer by typing short instructions instead of clicking. You type a command, press Enter, and the computer answers with text. Everything you can do in a file manager, such as opening folders, reading files and moving things around, you can also do here, usually faster once you know a dozen commands.
The window where you type is called a terminal. The program inside it that reads your commands is called a shell. On most Linux servers and on Macs the shell is called bash or zsh, and they understand the same everyday commands. This course uses bash, the one you’ll meet on almost every web server, including the one that runs a typical cPanel host.
On this page the terminal is a practice one. It runs a pretend computer inside your browser, with a home folder, a bakery folder and a few files. You can type anything, make mistakes and start over, and nothing touches your real computer.
Why would anyone type instead of click?
Because some jobs are far quicker as a sentence than as fifty clicks. Renaming 200 photos, finding every file that mentions an old price, or copying a website to a server are each one line in a terminal. The same line works again next week, and you can save it, share it or put it in a script.
Many tools only exist on the command line. Git, the programs that build modern websites, and every web server you’ll ever log in to all expect you to type. When a tutorial or an AI assistant says “run this in your terminal”, this is the skill it assumes.
It also makes you calmer around servers. When a site breaks, being able to look at its files and logs yourself, instead of waiting for someone else, is a real advantage.
How do you read the prompt?
Before the cursor you’ll see something like you@laptop:~$. That’s the prompt, and it tells you three things. you is your user name, laptop is the computer’s name, and the part after the colon is the folder you’re in. The $ at the end means the shell is ready for a command.
The ~ sign is short for your home folder, which on this computer is /home/you. When you move into the bakery’s folder the prompt changes to you@laptop:~/bakery$. Reading it before you type is a good habit: most mistakes on the command line come from running the right command in the wrong folder.
When you connect to another computer later in the course, the name after @ changes too. That’s your reminder that commands now run over there.


What do pwd, ls, cd and cat do?
These four commands are enough to look around any computer. pwd stands for print working directory: it prints the full path of the folder you’re in. ls lists what’s in a folder. Folders are shown with a / at the end in this practice terminal, so you can tell them from files at a glance.
cd means change directory. cd bakery moves you into the folder called bakery, if it’s inside the one you’re in. cd .. moves up one level, and cd on its own takes you home from anywhere. cat prints a file’s contents to the screen, which is the quickest way to read a short text file.
pwd
ls
cd bakery
cat specials.txtWhat does an error message tell you?
When something goes wrong, the terminal says so in a line that names the command and the problem, such as cat: specials.text: No such file or directory. Read it slowly. It tells you which command failed (cat), what it was given (specials.text) and why (there’s no file by that name here).
Nearly every “No such file” error has one of three causes: a typo, the wrong capital letter, or the wrong folder. Run ls to see the real names and pwd to check where you are. This practice terminal adds a line from Finch with a likely fix, but on a real server you only get the first line, so learn to read it.
Some commands print nothing when they work. cd is one of them. Silence usually means success, and the prompt changing is your confirmation.
Why does capitalisation matter?
On Linux, which runs most web servers, Specials.txt and specials.txt are two different files, and both can sit in the same folder. Macs and Windows usually treat them as the same name, which is why a site can work on your laptop and break on the server.
The safest habit is to use lowercase names with hyphens instead of spaces: opening-hours.txt, cinnamon-buns.jpg. They’re easy to type, they never need quotes, and they behave the same everywhere. The Break It task on this page shows what happens when one capital letter sneaks in.
How do you type less?
Press Tab after the first few letters of a file or folder name and the shell finishes it for you. If more than one name matches, it shows the options. Tab saves time and it also prevents typos, because it only ever completes names that really exist.
The Up arrow brings back the command you typed before, and pressing it again goes further back. Change a word and press Enter to run the edited version. This practice terminal supports both, so try them now. Together they make long commands far less tiring than they look.
What do AI tools get wrong here?
AI assistants are good at suggesting commands, and they often assume a folder layout that isn’t yours. A reply might say cd src or cat config/settings.txt when your project has neither. Run pwd and ls first, then adapt the command to the names you actually see.
They also mix up systems. A command written for Windows PowerShell, such as dir or type file.txt, won’t work in bash, and some Mac commands take slightly different options from their Linux versions. When a suggested command fails, the error message is the fastest guide to why.
Field notes
- You type a command, press Enter, and the computer replies with text.
- The prompt shows who you are, which computer, and which folder you are in.
pwdshows your folder,lslists it,cdmoves andcatprints a file.- A typo in a name gives a clear error that names the command and the problem.
Easy to get wrong
Folder names on Linux are case-sensitive. Bakery and bakery are different names, so the first one says there’s no such folder.
The file’s name includes .txt. The shell doesn’t guess the ending for you, but Tab completion fills it in.
cd only goes into folders. To read a file, move to its folder and use cat, or give cat the whole path: cat bakery/specials.txt.
Questions people ask
Do I need to install anything?
No. Every lesson runs in a practice terminal in this page. On a Mac, the real one is the Terminal app. On Windows, install Windows Terminal with WSL to get bash. On a web host, cPanel usually has a Terminal page, and you can connect with ssh, which a later lesson covers.
Can I break my computer with the command line?
Not in this practice terminal. On a real one, a few commands can delete files without asking, and this course points them out when they come up. Looking around with pwd, ls, cd and cat is always safe.
What’s the difference between a terminal, a shell and the command line?
The terminal is the window, the shell is the program reading what you type, and the command line is the general idea of working by typing. People use the three words loosely and almost interchangeably.
Is this the same on a Mac?
Very nearly. Macs use zsh by default, which understands everything in the early lessons the same way bash does. A few options for commands like sed differ, and the lessons mention it where it matters.