LearnWithShobhan

Terminal vs shell: what's the difference? (Bash, Zsh, PowerShell explained)

Shobhan Biswas··5 min read
>_From the course CLI Mastery: 57 lessons, lifetime access.

People use "terminal", "shell", "console" and "command line" as if they were the same thing. They are related, but they are different pieces, and the difference explains a lot: why your aliases live in .zshrc, why a Bash script fails in PowerShell, and why servers are managed the way they are.

The clearest way to understand it is the way it actually happened.

Why it's called a "terminal"

Think of a bus terminal: the place you go to get access to the bus. A computer terminal is the place you go to get access to the computer.

In the 1950s computers filled whole rooms. There were no keyboards or screens for regular users. Say a professor wanted to generate grade cards for 100 students. They'd prepare 100 punch cards, hand them to a technician, who would wait to collect a batch of cards from other people, then feed them into the computer. If one card had a mistake, the whole loop started again.

Diagram: a professor hands punch cards to a technician who runs them on a computer in a computer room
Before terminals: punch cards, a middleman, and batch processing.

Around the 1960s the terminal removed the middleman: a keyboard-like input device plus a screen (or printer), wired directly to the computer. Type a command, see the result immediately. One big computer could have many terminals, one for maths, one for chemistry.

So originally, a terminal was a physical device. Today it's an app that emulates that device: a terminal emulator.

The shell: the layer that understands you

Computers only understand binary. You type commands in something close to English. Something has to interpret them. That something is the shell.

Picture the computer in layers, like an egg:

Diagram: hardware in the centre, kernel/OS around it, shell as the outermost layer, connected to a terminal with a keyboard
Hardware at the core, the kernel (operating system) around it, the shell on the outside. The terminal talks to the shell.
  • Hardware: CPU, disk, memory.
  • Kernel: the core of the operating system, which controls the hardware.
  • Shell: the outermost layer. It reads your command, works out what you mean, and asks the kernel to do it.
  • Terminal: the window you type into. It passes keystrokes to the shell and draws whatever comes back.

When you type ls and press Enter: the terminal sends ls to the shell, the shell interprets it and asks the operating system to list the directory, and the result travels back to the terminal to be displayed.

Which terminal and shell does your OS use?

Table: Windows terminals (Command Prompt, PowerShell, WSL with Bash, Git Bash); Mac (Terminal app, iTerm2 with zsh or Bash); Linux (GNOME Terminal, XTerm with Bash or zsh)
Terminal emulators per operating system, and the shells they run.
OSTerminal emulatorsShell inside
WindowsCommand Prompt, PowerShellCommand Prompt, PowerShell
WindowsWSL, Git BashBash
macOSTerminal app, iTerm2Zsh by default (Bash before Catalina)
LinuxGNOME Terminal, XTerm, KonsoleBash by default

One terminal can run different shells. Check yours, and switch inside the same window:

bash
$ echo $0
-zsh
$ bash
bash-5.2$ echo $0
bash
bash-5.2$ exit
$

Same window, different interpreter. That's the clearest proof the two are separate.

Free to watch. Get all 57 lessons →

Why developers choose Bash or Zsh

In 1969, Ken Thompson and Dennis Ritchie created Unix at Bell Labs, a portable operating system instead of one per hardware vendor. Ritchie created the C language in 1972 largely to write it.

From there, two families grew:

Unix family

  • ▸macOS (built on BSD Unix)
  • ▸Linux (Linus Torvalds' open-source rewrite, 1991)
  • ▸Android, servers, cloud, routers, cars
  • ▸Shells: Bash, Zsh

MS-DOS family

  • ▸Windows (graphical layer on MS-DOS roots)
  • ▸Great for office and business software
  • ▸Shells: Command Prompt, PowerShell
  • ▸Different commands and conventions

Almost every server, cloud machine and container you will touch as a developer runs Linux, and its default shell is Bash. macOS's Zsh is nearly identical for everyday work. So learning Bash-style commands means the same skills work on your laptop, on AWS, in Docker and in CI pipelines.

On Windows, use WSL or Git Bash to get the same experience.

Why this matters in practice

  • Config belongs to the shell, not the terminal app. Aliases and prompt changes go in ~/.zshrc (Zsh) or ~/.bashrc (Bash). Switching from Terminal to iTerm2 changes nothing.
  • Scripts name their shell with a first line like #!/bin/bash. More in Shell scripting for beginners.
  • Tutorials assume a shell. If a command fails, check whether it was written for Bash and you're in PowerShell.

Key takeaways

  • ✓Terminal = the window (once a physical device). Shell = the program that interprets your commands.
  • ✓Layers: hardware → kernel → shell → terminal.
  • ✓Linux defaults to Bash, macOS to Zsh, Windows to PowerShell (use WSL or Git Bash for Bash).
  • ✓Learn Bash-style commands and the same skills work on servers, cloud and containers.

Learn the terminal properly, once

CLI Mastery is 57 short lessons that take you from "what is a shell" to scripting and running a web server on AWS. Every idea is drawn first, then done live. Lifetime access, and three lessons are free to watch.

Free download

Linux command line cheat sheet

One printable page: navigation, files, permissions, pipes, processes, scripts and SSH.

Occasional emails with new tutorials and courses. Unsubscribe any time.

Keep reading