Command-Line Interface
Also known as: CLI, Command line
Text-based interface in which users interact with a computer by typing commands and reading text output rather than using graphical menus.
A command-line interface (CLI) lets a person control a computer by typing text commands, each usually consisting of a program name followed by options and arguments, and reading the text the program prints in response. Listing the files in a folder sorted by size, or searching thousands of files for a word, can be done with a single typed line. The program that reads and runs these commands is called a shell, such as Bash, zsh or PowerShell, and on graphical systems it runs inside a terminal emulator window.
Command lines are the oldest interactive way of using computers, descended from the teletype terminals of the 1960s and 1970s. The Unix tradition, developed at Bell Labs by Ken Thompson, Dennis Ritchie and colleagues, shaped the command line most people use: many small programs that each do one job well and can be connected with pipes, so that the output of one becomes the input of the next. Graphical interfaces became dominant for general users from the 1980s onward, but command lines remained central to programming, system administration and servers, which often have no graphical interface at all.
The command line offers precision, speed for experienced users and, above all, automation: any sequence of commands can be saved as a shell script, repeated exactly, scheduled or run on hundreds of remote machines. Many developer tools, from Git to package managers and cloud utilities, are designed for the command line first. The trade-off is discoverability, since commands must be learned rather than found in menus, and destructive commands may run without confirmation. Fluency at the command line is widely regarded as a foundational technical skill.
Key points
- A command-line interface accepts typed commands and returns text output, interpreted by a program called a shell.
- The Unix approach of small programs connected by pipes shaped most command lines in use.
- Command lines remain central to programming, system administration and servers despite graphical interfaces.
- Any sequence of commands can be saved as a script and repeated, which makes CLIs well suited to automation.
Related entries
Shell Scripting
Writing programs for a command-line shell, such as Bash, that automate sequences of commands, file operations and system administration tasks.
Bash
Unix shell and command language written for the GNU Project, long the default interactive shell and scripting language on Linux systems.
Cron
Time-based job scheduler in Unix-like operating systems that runs commands or scripts automatically at specified times, dates or intervals.
Git
Free and open-source distributed version control system created by Linus Torvalds in 2005, used to track changes in source code.
Operating System
System software that manages a computer's hardware resources and provides common services and interfaces for the programs that run on it.
Linux
Free and open-source Unix-like kernel created by Linus Torvalds in 1991 that underpins Android, most servers and many embedded devices.
Ken Thompson
American computer scientist who created the Unix operating system and the B language and later co-designed the UTF-8 encoding and the Go language.
Daemon
Computer program that runs in the background, without direct user interaction, to provide services or perform tasks on Unix-like systems.
Featured in guides
Referenced by
Other entries that discuss or point to Command-Line Interface.