Quiz Entry - updated: 2026.07.14
What is a Shell and what does it do?
The shell is the program that reads your typed commands, figures out what you mean, and asks the kernel to run it — it's the interpreter sitting between you and the operating system.
The name is a metaphor: the kernel is the hard core that actually controls hardware, and the shell is the layer wrapped around it that you actually touch. You never talk to the kernel directly; you talk to the shell, and it translates.
For each line you type, the shell does roughly five things:
- Prints the prompt and waits for input.
- Parses your line — splits it into command, options, and arguments, and expands wildcards/variables.
- Finds and executes the program (or runs a built-in like
cd). - Tracks context between commands: your current directory, environment variables, and the exit code of the last command.
- Acts as a full scripting language, so a sequence of commands can be saved and re-run.
| Shell | Full Name | Typically default on |
|---|---|---|
| bash | Bourne-Again Shell | Most Linux (RHEL, Ubuntu, Debian) |
| zsh | Z Shell | macOS (since 2019), popular with power users |
| sh | Bourne Shell | The classic Unix shell; /bin/sh today is usually a slim, POSIX-only shell |
Gotcha: cd is not a program — it's a shell built-in. It has to be, because changing directory must affect the shell's own state. That's why there's no /bin/cd file.