What Is the Shell?

3 min read

Core idea

When people say "the command line" they usually mean the shell — a program that reads what you type, asks the operating system to do it, and prints the result back. On almost every Linux machine that shell is bash (the Bourne Again Shell), a free-software replacement for the original Unix sh written by Steve Bourne. The shell is just another program: it accepts input, produces output, and can be replaced. What makes it special is that its input is a small language for driving the whole system.

You meet the shell through a terminal emulator — a graphical window that pretends to be one of the old hardware terminals that Unix was originally designed for. KDE ships konsole, GNOME ships gnome-terminal, macOS ships Terminal.app and iTerm2, and a hundred others (alacritty, kitty, wezterm, ghostty) compete on speed and configurability. They all do the same job: give the shell a window to read from and write to.

Why it matters

Mental model

How a keystroke becomes a result

Every command you run flows through the same pipeline. You press keys; the terminal emulator paints the characters and forwards them to the shell; the shell parses the line, finds the program you named, and asks the kernel to run it; the program produces output that flows back through the terminal to the screen.

How a keystroke becomes a result

Anatomy of a prompt

When the shell is ready it prints a prompt, by convention something like jay@laptop:~$. Reading it left to right: your username, the machine name, the current working directory (~ is your home), and a $ indicating a regular user. A # in place of $ means the session has root (superuser) privileges — that is the moment to slow down and check every command twice, because root can delete the operating system without asking for confirmation.

Practical application

Starting and ending a session

  1. Open your distribution's terminal application (or press Ctrl+Alt+T on many systems).

  2. The shell prints a prompt and waits. Type a command and press Enter.

  3. Press the up arrow to recall previous commands. Use left / right arrows to position the cursor and edit the line before running it.

  4. End the session by typing exit, pressing Ctrl+D, or closing the window.

A handful of safe commands to try

date          # current date and time
uptime        # how long the system has been running, plus load average
df -h         # free space on each mounted filesystem, human-readable
free -h       # free memory, human-readable
whoami        # your username
hostname      # this machine's name

None of these change anything on disk, which makes them perfect for getting comfortable with the prompt.

Copy and paste, the Linux way

Ctrl+C and Ctrl+V predate Windows by years in Unix land — Ctrl+C is "interrupt", Ctrl+V is "literal next character". To copy or paste inside a terminal use Shift+Ctrl+C and Shift+Ctrl+V. Most window systems also support a faster middle-button workflow: highlight text with the mouse (no keystroke needed) and press the middle button to paste at the cursor.

Example

Imagine you have just installed Linux on a spare laptop. You launch the terminal application for the first time. The prompt reads:

jay@thinkpad:~$

You want to verify three things before going further: that the machine knows what time it is, that there is room on the disk, and that you are running as a normal user — not root. You type:

date
df -h /
whoami

The first prints Mon 26 May 2026 09:14:02 PDT. The second shows the root filesystem has 42G of 120G used. The third prints jay. The prompt ends in $, not #, so you confirm: you are a regular user with plenty of disk space and a correctly-set clock. You have just performed your first system audit — three commands, no documentation needed. The rest of this site is variations on that loop.

Continue exploring

Tags