Command Line
In short: The text-based input line through which commands are passed directly to a shell — also called the command prompt or CLI (Command Line Interface).
In more detail: Unlike a graphical interface (GUI), actions here are triggered by typed commands instead of clicks. Advantages: precise, automatable (repeatable via script) and often more resource-friendly — but with a steeper learning curve than a GUI.
In Depth
Structure of a command
A typical command consists of the actual command, followed by options (flags, usually with - for short form or -- for long form) and arguments, e.g. ls -la /home/user — lists (“ls”) in long format (“-l”, shows permissions, size, date) also hidden files (“-a”) of the given directory. Short and long form can usually be combined (-la instead of -l -a), and many commands also accept named options with values (--output=file.txt).
Productivity features
Most command lines also support:
- Tab completion: automatically complete half-typed file/command names (press Tab); modern shells even complete subcommands and flags of known tools.
- Command history: recall and edit previous commands with the arrow keys, often searchable (Ctrl+R in Bash for reverse search).
- Aliases: define your own short forms for long/frequently used commands (
alias ll="ls -la"). - Pipes and redirection: use one command’s output directly as input for the next (
|) or write it to a file (>).
GUI vs. command line
The decisive advantage over a graphical interface (GUI) shows up especially with repetition and automation: a command typed once can be saved into a script and repeated exactly the same way as often as you like — a click path through several menus, by contrast, can’t, and even when a GUI offers automation (macros), it’s usually considerably more fragile against small UI changes. A command-line script can also be checked into version control, code-reviewed and exactly traced — with GUI click paths, that’s practically impossible.
Why the command line has survived
Despite a decades-old basic idea (the first interactive command lines date from the 1960s/70s), the command line remains a central tool for system administration, software development and DevOps — server-side systems (cloud VMs, containers, CI/CD pipelines) often have no graphical interface at all and can only be operated via the command line. For developers, it’s also often faster than a GUI once you’ve internalised the relevant commands — no searching through menus, direct entry of the desired action.
Terminal vs. shell vs. command line
These terms are often used synonymously in everyday language, but technically mean different things: the “terminal” (or terminal emulator) is the program window that displays text and takes input; the “shell” is the program that runs inside it and interprets commands (e.g. Bash, PowerShell); the command line itself is finally just the specific input line you type into. A terminal can in principle host different shells, similar to how a browser can display different websites.
See also: Shell, CMD, PowerShell