What is the Shell?
Terminal, shell, bash, zsh — what they are and why every developer needs them
Skills taught: linux.shell, linux.terminal, linux.bash, linux.why-cli
Terminal vs Shell — the distinction
Terminal (the window)
└── Shell (the interpreter running inside)
└── Your commands
Examples:
Terminal apps: iTerm2 (macOS), Windows Terminal, GNOME Terminal, Alacritty
Shell programs: bash, zsh, fish, sh, dash
Default shells by OS:
Ubuntu/Debian Linux → bash
macOS (Catalina+) → zsh
Alpine Linux/Docker → sh (dash, minimal)
Amazon Linux → bash
Check your current shell:
echo $SHELL # → /bin/zsh or /bin/bash
$SHELL --version # → bash 5.2 or zsh 5.9
Your first commands
# Print text to the screen
echo "Hello, World!"
# Show current date/time
date
# Who am I?
whoami
# Where am I? (current directory)
pwd
# What computer is this?
hostname
# Show system info
uname -a
# Clear the screen
clear # or Ctrl + L
Anatomy of a command
command [options/flags] [arguments]
ls -la /home/user
│ │ └─ argument: the path to list
│ └──── option: -l (long format) + -a (show hidden)
└──────── command: list directory contents
Conventions:
-l short flag (single dash + letter)
--long long flag (double dash + word)
--color=auto flag with value
Some commands use positional arguments:
cp source destination
│ └─ where to copy to
└───────── what to copy
Get help on any command:
man ls # full manual page (q to quit)
ls --help # brief help
tldr ls # community examples (install: npm i -g tldr)
Tip: Essential keyboard shortcuts: Tab — autocomplete file/command names. Ctrl+C — cancel running command. Ctrl+L — clear screen. Up/Down arrow — navigate command history. Ctrl+R — search command history. Ctrl+A / Ctrl+E — jump to start/end of line.
Frequently Asked Questions
Should I learn bash or zsh?
They are very similar for everyday use. Learn bash syntax first — bash scripts run everywhere (all Linux servers, CI/CD systems, Docker containers). zsh adds better interactive features (better autocomplete, plugins via Oh My Zsh) but is mostly compatible with bash for scripting. Most developers use zsh interactively (it is the macOS default) but write scripts in bash for portability.
Is the shell different on Windows?
Windows has PowerShell (Microsoft's shell) and cmd.exe (legacy). For Linux-style shell work on Windows, install WSL2 (Windows Subsystem for Linux) — it gives you a real Ubuntu/Debian environment inside Windows. Git Bash (bundled with Git for Windows) also provides bash. For development, WSL2 is the recommended approach.