Bash and the Command Line: Interactive Practice · Lesson 1 of 21 · about 6 min
What the command line is
There are two main ways to control a computer.
- A graphical user interface (GUI) uses windows, icons, buttons and a mouse. You click on what you want.
- A command line interface (CLI) uses text. You type an instruction called a command, press Enter, and the computer carries it out and prints the result as text.
A GUI only offers actions its designers put on screen. The command line lets you ask for anything the computer can do.
Bash and the Command Line: Interactive Practice · Lesson 1 of 21 · about 6 min
Terminal, shell and Bash
These three words describe different things.
- Terminal: the window you type into. It shows text and passes your key presses on. It does not understand commands itself.
- Shell: a program that runs inside the terminal. It reads each line you type, works out what you want, runs the right program and shows the result. The shell is what understands and runs your commands.
- Bash: one specific shell and the most popular one on Linux. The name means "Bourne Again SHell", a pun on an older shell called the Bourne shell.
So you type in the terminal, the shell interprets it, and programs do the work. This course teaches Bash.
Bash and the Command Line: Interactive Practice · Lesson 1 of 21 · about 6 min
What happens when you run a command
Every command goes through the same steps.
- The shell shows a prompt, which means it is ready.
- You type a command and press Enter.
- The shell splits the line into words and finds the program named by the first word.
- The program runs and prints its output in the terminal.
- The prompt comes back, ready for the next command.
date
Mon Oct 5 14:30:12 UTC 2026Bash and the Command Line: Interactive Practice · Lesson 1 of 21 · about 6 min
Other shells
Bash is not the only shell.
- sh: the original, simple shell. Bash is built to work like it and adds more features.
- zsh: the default shell on modern Macs. Basic commands work the same as in Bash.
- fish: a shell with colours and suggestions built in. Its scripting syntax differs from Bash.
- PowerShell: the shell from Microsoft. It works quite differently.
Almost everything in this course works in Bash and zsh.
Bash and the Command Line: Interactive Practice · Lesson 1 of 21 · about 6 min
Why learn it: speed and repeating work
- Speed: renaming 500 photos by clicking takes a long time. One command can do it in a second.
- Repeatability: you can save commands in a file and run them again later. Mouse clicks cannot be saved and replayed.
- Bulk and automated work: searching ten log files for a word, or running the same steps every night, is far faster with commands than with clicking.
Clicking still makes sense for one-off visual tasks, such as picking a colour in a drawing app or watching a video.
Bash and the Command Line: Interactive Practice · Lesson 1 of 21 · about 6 min
Why learn it: servers and combining tools
- Servers have no screen: most computers that run websites have no desktop and no mouse. The terminal is how you manage them.
- Combining tools: each command does one small job. You can connect them so the output of one becomes the input of the next, and build solutions no single button offers.
- Career: developers, system administrators, DevOps engineers, data scientists and security specialists use it daily.
The command line is not outdated. It is still used every day around the world.
Bash and the Command Line: Interactive Practice · Lesson 1 of 21 · about 6 min
Your first look at commands
You will run these in the next lesson. For now, notice that each is short and readable.
ls
mkdir photos
grep "error" server.log
lslists the files in the current folder.mkdir photosmakes a new folder namedphotos.grep "error" server.logprints every line ofserver.logthat contains the word "error".
You do not need to memorise anything yet. Practice builds the habits.
Back to the lesson
Leave this lesson?
Your answers so far will not be saved, and you will start this lesson from the beginning next time.