# Terminal and Shell Basics

> What the command line is, and how the terminal and the shell split the work. Why most servers run Linux and are used by typing, not clicking.

**Course:** [Linux Command Line](https://learn.benibix.com/learn/infrastructure-linux)  
**Time:** 10 min

**After this lesson you can:**

- Tell the terminal from the shell
- Run a command and read its reply
- Say why servers are run by typing

## What happens when you type a command

The command line is a way to use a computer by typing instead of clicking. You type one line, press Enter, and the computer runs it and prints a reply. Two programs share the work. The terminal is the window you type into. The shell reads your line and runs it. On Linux, the usual shell is bash.

Linux is the system that runs most of the world's servers. It is free, and many groups ship their own version of it. Ubuntu is the one most guides assume, so the examples in this course use it. The commands work the same way on nearly every version.

When the shell is ready, it shows a short line ending in a $ sign. You type after it. The first word is the command, such as ls. The words after it change what it does. A word that starts with a dash, such as -l, is an option.

The shell finds the program with that name, starts it and waits. Whatever the program prints comes back to the terminal window. Then the $ sign returns, and you can type the next line. If the program finds nothing to say, it often prints nothing at all.

The terminal and the shell are easy to mix up, because they always appear together. A terminal is like a phone, and the shell is the person on the line. You can change the phone and keep the same person, or the other way round. That is why the same commands work in any terminal app.

Servers are run this way for good reasons. A server usually has no screen, and typing works fine over a slow link. Commands can be saved in a file and run again, exactly the same, next week or on a hundred servers.

The command line does exactly what you say, at once, with no undo. There is no bin to restore from. A common mistake is to paste a command from a web page without reading it. Read every word first, and if one is new, look it up before you press Enter.

```console
$ echo Hello
Hello
$ whoami
emma
```
Two commands and their replies. The $ sign means the shell is ready for the next one.

![A terminal window on the left shows the line $ ls photos and the reply beach.jpg cat.jpg. An arrow marked your line goes to a box marked shell, such as bash, which reads the line, finds the program and starts it. An arrow goes on to a box marked ls, the command. A curved arrow carries what the command prints back to the window.](https://learn.benibix.com/diagrams/infc-terminal-shell.svg)

### Example: Jack finds a big folder

Jack's laptop is almost full. In the file manager he clicks through 40 folders and still cannot find what is taking the space.

In the terminal he types one line, du -sh * in his home folder. In two seconds it lists every folder with its size. The biggest is 38 gigabytes of old videos.

**Words in this lesson:** [Command Line](https://learn.benibix.com/term/infrastructure/command-line), [Terminal](https://learn.benibix.com/term/infrastructure/terminal), [Shell](https://learn.benibix.com/term/infrastructure/shell), [Linux](https://learn.benibix.com/term/development/linux), [Ubuntu](https://learn.benibix.com/term/development/ubuntu)

**Question:** What sets the terminal apart from the shell?

**Answer:** The terminal is the window, and the shell reads and runs what you type. The terminal is the window that shows text. The shell is the program inside it that reads each line and starts the command.

---

Source: https://learn.benibix.com/learn/infrastructure-linux/terminal-and-shell-basics
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
