Terminal, Shell, and Kernel: What Is What?
The terminal is the window, the shell is the brain that understands your commands, and the kernel is the engine doing the real work — three separate pieces that people constantly confuse.
Why Learn This Distinction?
Most beginners say “I opened the terminal and typed a command” without realizing they actually used three different programs:
- The terminal emulator drew the window and your keystrokes
- The shell interpreted what you typed and handed it to the system
- The kernel executed the work the shell requested
When a command “does not work”, knowing which layer broke is half the debugging. And when someone says “learn bash”, they mean the shell — not the terminal, and definitely not the kernel.
You can switch terminals freely; your shell and its configuration follow you. The kernel is invisible, but every single command you ever run passes through it.
1. The Kernel: The Invisible Engine
The kernel is the core program that owns the hardware. It decides which process gets CPU time, which program may read a file, and how data moves to disk and network cards.
┌──────────────────────────────────────┐
│ Your command: ls -la /etc │
└───────────────┬──────────────────────┘
│
┌───────────────▼──────────────────────┐
│ Shell (bash): parses the command, │
│ finds /bin/ls, starts a process │
└───────────────┬──────────────────────┘
│ system calls (open, read, write, ...)
┌───────────────▼──────────────────────┐
│ Kernel: reads the directory from │
│ disk, checks permissions, returns │
│ the raw data │
└───────────────┬──────────────────────┘
│
┌───────────────▼──────────────────────┐
│ Hardware (disk, CPU, memory) │
└──────────────────────────────────────┘
What the kernel actually does
- Process management — starts, stops, and schedules every running program
- Memory management — gives each process its own slice of RAM
- Filesystem access — everything on disk is a file, and the kernel mediates all reads and writes
- Device drivers — talks to graphics, USB, network hardware on your behalf
- Network stack — handles sockets, TCP/IP, firewalls
The kernel is never “used” directly by normal programs — they request services through system calls, a controlled API.
2. The Shell: Your Command Interpreter
The shell is a program with a prompt. It reads the line you type, interprets it, and executes what you asked for. It is also a full programming language, which is why shell scripting is a core Linux skill.
The most common shells
| Shell | Prompt hint | Notes |
|---|---|---|
| bash | $ | “Bourne Again SHell” — the Linux default; what most tutorials assume |
| sh | $ | The original POSIX shell; bash runs in sh compatibility mode |
| zsh | % | Superset of bash with better completion; macOS default since Catalina |
| fish | > | “Friendly interactive shell” — autosuggestions out of the box, not POSIX |
| ksh / csh | $ / % | Older shells, still found on legacy Unix systems |
Check which shell you are using:
echo $SHELL
echo $0
/bin/bash
bash
What the shell does with your input
When you type ls -la /etc | head -5, the shell:
- Parses the line into the command
lsand arguments-la /etc - Expands shortcuts —
~to your home directory,$USERto your username,*to matching filenames - Finds the program — searches every directory in
$PATHfor an executable namedls - Executes it — starts the process and waits
- Wires up pipes — connects
ls’s output intohead’s input - Reports the exit code (
0for success) via$?
3. The Terminal: The Window You Type Into
The terminal emulator is a graphical program that displays a shell. It handles fonts, colors, copy/paste, tabs, and windows — but knows nothing about your commands.
Common terminal emulators
| Terminal | Platform | Notes |
|---|---|---|
| GNOME Terminal | Linux (GNOME) | Default on Ubuntu/Fedora desktop |
| Konsole | Linux (KDE) | Default on KDE Plasma |
| Alacritty / Kitty | Linux | GPU-accelerated, config-file driven |
| Terminal.app | macOS | Bundled with macOS |
| iTerm2 | macOS | Power-user favorite, heavily customizable |
| Windows Terminal | Windows | Runs WSL shells, tabs, and themes |
| PuTTY | Windows | Old-school SSH client |
The same shell works in all of them. Switching from GNOME Terminal to Alacritty changes nothing about how commands behave.
4. How They Fit Together
Terminal emulator (window, keys, pixels)
└── Shell (bash/zsh: parses & runs your commands)
└── Kernel (executes the actual work)
└── Hardware
Example: start ssh on your laptop — the terminal window is local, the shell is local bash, and the kernel is your laptop’s. When ssh connects to a server, you get a remote shell on the remote kernel, still displayed in your local terminal.
That single line explains remote servers: nothing runs on your screen except a window; everything else happens on the other machine.
Common Pitfalls
- “Terminal” and “shell” are not synonyms — if a script fails, the terminal is not the suspect; check the shell or the program itself.
- GUI ≠ shell knowledge — clicking through a file manager teaches nothing about pipes, redirects, or scripting.
- Changing shells does not lose your data — but bash and zsh config files differ (
.bashrcvs.zshrc). shis not always a symlink to bash — on Debian/Ubuntu,/bin/shisdash, which is faster but smaller; scripts with#!/bin/bashmay behave differently under plainsh.
Related Pages
| Page | Why it is related |
|---|---|
| What Is Linux? | The kernel explained from the distribution side |
| Opening a Terminal | How to actually get to a shell on any system |
| Keyboard Shortcuts | Make typing at the shell prompt faster |
Terminal / Shell / Kernel Cheatsheet
| Task | Command / fact |
|---|---|
| Which shell am I in? | echo $SHELL |
| Which shell is running me now? | echo $0 |
| List installed shells | cat /etc/shells |
| Change your default shell | chsh -s /bin/zsh |
| Shell config (bash) | ~/.bashrc |
| Shell config (zsh) | ~/.zshrc |
| Kernel version | uname -a |
| Terminal emulators on Linux | GNOME Terminal, Konsole, Alacritty, Kitty |