SHELL
Platform Ops Glossary Shell
Fundamentals, Kernel & Shell · Term #4

Shell

The command interpreter that reads what you type and asks the kernel to act on it.

Category
Fundamentals, Kernel & Shell
Complexity
Beginner
Glossary Entry
#4 of 190
BashTerminal & CLIShell ScriptingBashTerminal & CLIShell Scripting
What Is It

The Short Answer

A shell is just another program — not part of the kernel — whose entire job is to read a line of text, figure out what you meant, and turn that into system calls (usually via fork() and exec() to start new processes). It's the layer between you and the kernel.

Linux ships with several shells (bash, zsh, dash, fish, ksh) that share a common core vocabulary but differ in scripting features, interactive conveniences (autocomplete, prompts), and POSIX compliance.

How It Works

Under The Hood

Every shell runs the same basic loop: read a line, parse it into words (respecting quotes, expanding variables and globs), decide if the first word is a builtin (like cd, handled inside the shell itself) or an external command (found via PATH and executed as a new process), run it, wait for it to finish, and print the next prompt.

Shells can run interactively (you type, it responds) or as an interpreter for scripts (a file of commands executed top to bottom). The same shell binary does both — a script is just a shell reading its input from a file instead of your keyboard.

In Practice

Example Commands

check and change your shell
echo $SHELL
# your current login shell
cat /etc/shells
# list of shells installed and considered valid login shells
chsh -s /bin/zsh
# change your default login shell
Watch Out For

Common Mistakes

⚠️Writing a script with #!/bin/sh but using bash-only syntax like [[ ]] — on distros where /bin/sh is dash, not bash, this fails silently or behaves differently.
⚠️Assuming your interactive shell's aliases and functions are available inside a script — non-interactive shells don't read .bashrc by default.
VA
Vishal Abhinav
Platform Ops Engineer · Linux & Unix Glossary