Terminal vs Shell

"Open your terminal." "Use the shell." "Run this in the console." "That's a CLI command."

Everyone uses these words interchangeably. They're not the same thing. Let me clear this up once and for all.

The Simple Explanation

Think of it like a car:

  • Terminal = the car's dashboard and steering wheel (the interface)
  • Shell = the engine (does the actual work)

You interact with the terminal. The terminal passes your commands to the shell. The shell executes them and sends results back to the terminal.

┌─────────────────────────────────────────────────────────┐
│                    TERMINAL                              │
│  (The window you type in - GNOME Terminal, iTerm2)       │
│                                                          │
│   ┌───────────────────────────────────────────────────┐  │
│   │                                                   │  │
│   │  user@hostname:~$ ls -la                         │  │
│   │  total 32                                         │  │
│   │  drwxr-xr-x 4 user user 4096 Jan 14 file.txt     │  │
│   │                                                   │  │
│   └───────────────────────────────────────────────────┘  │
│               ↑                    ↓                     │
│          You type            You see output              │
└───────────────────────────────────────────────────────────┘
                    ↑                    │
                    │                    ↓
┌─────────────────────────────────────────────────────────┐
│                      SHELL                               │
│  (The program that interprets commands - bash, zsh)      │
│                                                          │
│  1. Receives "ls -la" from terminal                      │
│  2. Parses and understands the command                   │
│  3. Executes it (talks to the OS)                        │
│  4. Sends output back to terminal                        │
└─────────────────────────────────────────────────────────┘

Terminal (Terminal Emulator)

The terminal is the window where you type commands. That's it.

When you open:

  • macOS: Terminal.app, iTerm2
  • Windows: Windows Terminal, PowerShell window
  • Linux: GNOME Terminal, Konsole, Alacritty

You're opening a terminal emulator - a program that displays text and captures your keyboard input.

Why 'Emulator'?

Back in the day, terminals were physical hardware - monitors connected to mainframes. Modern terminal "emulators" replicate that experience in software.

Shell

The shell is the program that interprets your commands and executes them.

Common shells:

  • bash (Bourne Again Shell) - the default on most Linux systems
  • zsh (Z Shell) - default on macOS since Catalina
  • fish - user-friendly, great for beginners
  • sh - the original Bourne shell, very basic
Terminal
$echo $SHELL
/bin/bash
$# This shows which shell you're using

Try this in your terminal - you'll probably see /bin/bash.

Why Does This Matter?

Because different shells have slightly different syntax.

hljs bash
# This works in bash and zsh
if [[ $name == "bar" ]]; then echo "hi"; fi

# This might not work in sh
# sh uses single brackets: [ $name = "bar" ]

For this course, we're using bash - it's the most common and the one you'll encounter on 99% of servers.

Pro Tip

When you write shell scripts, always start with #!/bin/bash at the top. This tells the system "run this with bash, not whatever the default shell is."

The Other Terms

Let's define the rest:

TermMeaning
CLICommand Line Interface - any text-based interface
ConsoleOriginally physical hardware, now often means terminal
Command PromptWindows' name for their CLI (not the same as bash)
TTYTeletype - historical term, now means terminal session

A Quick Test

Terminal
$# What terminal are you using?
$echo $TERM
xterm-256color
$
$# What shell are you using?
$echo $SHELL
/bin/bash
$
$# List available shells on this system
$cat /etc/shells
/bin/sh /bin/bash /usr/bin/bash /bin/zsh /usr/bin/zsh

The Practical Takeaway

When someone says "open your terminal and run this command":

  1. Open your terminal application (the window)
  2. The shell (probably bash) is already running inside it
  3. Type the command
  4. The shell interprets and executes it
  5. Results appear in the terminal

That's the workflow. Every single time.

Knowledge Check

Which of the following is a shell, not a terminal emulator?

Key Takeaways

  • Terminal = the window/interface you type in
  • Shell = the program that executes your commands (bash, zsh, fish)
  • bash is the most common shell and what we'll use in this course
  • Different shells have slightly different syntax
  • When in doubt, just say "terminal" - everyone will understand

Next: let's decode that cryptic user@hostname:~$ thing you see when you open a terminal.