Definition
The command line is the text-based interface through which a user issues instructions to an operating system. A program called the shell reads each line of input, interprets it as a command plus arguments, finds the matching executable, runs it, and prints the output back to the terminal. Bash, zsh, fish, and PowerShell are all instances of this same idea, differing in syntax and feature set but sharing the read-evaluate-print loop at the core.
The interface predates the graphical desktop by decades and persists because it is uniquely composable. Every command produces text and consumes text, which means any two commands can be wired together with a pipe. That uniformity — text in, text out — is what turns a shell into a programmable workshop rather than a fixed set of features.
Why it matters
How it works
Every shell follows the same outer loop. It prints a prompt, reads a line, performs a series of expansions — brace expansion, tilde expansion, parameter expansion, command substitution, arithmetic expansion, word splitting, pathname expansion — on the input, parses the result into a command and arguments, finds the executable on the $PATH, forks a child process, and runs it. Three standard streams connect the child to the world: standard input, standard output, and standard error. Redirection operators rewire these streams to files; pipe operators connect one process's output to another's input.
The hidden depth is everything around that loop. Job control suspends and resumes processes; environment variables propagate configuration to children; history and completion accelerate input; aliases and functions give the user their own vocabulary. Each shell adds its own conventions — bash's expansions, zsh's globbing, fish's autosuggestions — but the underlying model is shared, which is why skills learned in one transfer mostly intact to another.