What is the Command Line and Why Learn It?
Understand what the terminal, shell and Bash actually are, and why almost every developer and IT person ends up learning them.
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. Your desktop, your web browser and your phone apps all use a GUI.
- 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 the actions its designers put on screen. The command line lets you ask for anything the computer can do, including things no button exists for. It takes a little time to learn, but it gives you much more control.
Terminal, shell and Bash
Three words are used for the command line and people often mix them up. They are three separate things.
- Terminal: the window you type into. It shows text and sends your key presses onward. A terminal does not understand commands by itself.
- Shell: a program that runs inside the terminal. It reads each line you type, works out what you are asking for, starts the right program and shows you the result. The shell is the part that actually understands and runs your commands.
- Bash: one specific shell, and the most popular one on Linux. The name stands for "Bourne Again SHell". It is a pun on an older shell called the Bourne shell.
So the chain is: you type in the terminal, the shell (usually Bash) interprets what you typed, and the programs you asked for do the work.
When someone says "run this in the terminal", they mean "type it into your shell". This course teaches Bash.
What happens when you run a command
Every command goes through the same steps.
- The shell shows a prompt. This is a short piece of text that means "I am ready for a command".
- You type a command and press Enter.
- The shell reads the line, splits it into words and finds the program that matches the first word.
- The program runs and prints its output in the terminal.
- The shell shows the prompt again, ready for the next command.
For example, the command date prints the current date and time:
date
The output looks something like this:
Mon Oct 5 14:30:12 UTC 2026
Other shells
Bash is not the only shell. Some others you will meet:
- sh: the original, very simple shell. Bash is built to work like it and adds more features.
- zsh: the default shell on modern Macs. Its basic commands work the same as 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 from Bash.
Almost everything in this course works in both Bash and zsh. If you learn Bash well, other shells will feel familiar.
Why learn the command line
- Speed: renaming 500 photos by clicking takes a long time. One command can do it in a second.
- Repeatability: you can save a list of commands in a file and run it again whenever you want. Mouse clicks cannot be saved and replayed.
- Servers have no screen: most computers that run websites have no desktop and no mouse. The terminal is the normal way to manage them.
- Combining tools: commands are small and each does one job. You can connect them so the output of one becomes the input of the next, which lets you build solutions no single button could offer.
- Career: developers, system administrators, DevOps engineers, data scientists and security specialists all use the command line every day.
Your first look at commands
You do not need to understand these yet. The next lessons explain how to run them. For now, notice that each one 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 of the fileserver.logthat contains the word "error".
What this course covers
You will learn to move around the filesystem, manage files, read and change permissions, connect commands with pipes, search and edit text, use variables, write scripts with decisions and loops, control running programs, schedule jobs and build a small backup tool. Each lesson builds on the one before it.