A command-line interface (CLI), also known as a command-line shell, is a means of interacting with software via commands – each formatted as a line of text. The concept of interacting with a computer via text evolved over two decades, transitioning from physical hardware to sophisticated software. Before the CLI, computers were programmed using physical switches or punched cards. The shift toward a "command" style interaction began with the use of teleprinters/teletypes. Early systems like the Whirlwind I (1951) at MIT began to use typewriter-like inputs for direct control, moving away from batch processing where users would hand a stack of cards to an operator and wait hours for a result. Devices like the Teletype Model 33, introduced in 1963, allowed operators to type a command and receive a printed response from the computer. The command-line interpreter emerged when computers became powerful enough to handle multiple users at once, known as time-sharing. The Compatible Time-Sharing System (CTSS), developed in 1961 at MIT, introduced the first true command-line interpreter. For the first time, a user could type a command like LOGIN or PRINT, and a dedicated program (the supervisor) would parse that text and execute the corresponding function. In 1964, Louis Pouzin introduced the software we now recognize as a "shell" for the Multics operating system, providing a programmable environment for executing scripts. Many utilities for operating system management and software development provide CLIs. Many CLIs enable software automation, since commands can be stored in a script file that can be used repeatedly. A script allows its contained commands to be executed as a group (as a single program). Alternatives to a CLI include a GUI (including the desktop metaphor such as Windows), text-based menuing (including DOS Shell and IBM AIX SMIT), and keyboard shortcuts.
Comparison to graphical user interfaces
Compared with a graphical user interface, a command-line interface requires fewer system resources to implement. Since options to commands are given in a few characters in each command line, an experienced user often finds the options easier to access. Automation of repetitive tasks is simplified by line editing and history mechanisms for storing recently or frequently used sequences, allowing review and repetition of commands; this may extend to a scripting language that can take parameters and variable options. A command-line system may require online or paper manuals for the user's reference, although often a help option provides a concise review of the options of a command. The command-line environment may not provide graphical enhancements such as different fonts or extended edit windows found in a GUI. It may be difficult for a new user to become familiar with all the commands and options available, compared with the icons and drop-down menus of a graphical user interface, without reference to manuals.
Types
Operating system command-line interfaces Operating system (OS) command-line interfaces are usually distinct programs supplied with the operating system. A program that implements such a text interface is often called a command-line interpreter, command processor, or shell. Examples of command-line interpreters are Nushell, DEC's DIGITAL Command Language (DCL) in OpenVMS and RSX-11, the various Unix shells (sh, ksh, csh, tcsh, zsh, Bash, etc.), CP/M's CCP, DOS' COMMAND.COM, as well as the OS/2 and Windows cmd.exe programs, the latter groups being based heavily on DEC's RSX-11 and RSTS CLIs. Under most operating systems, it is possible to replace the default shell program with alternatives; examples include 4DOS for DOS, 4OS2 for OS/2, and 4NT / Take Command for Windows. Although the term shell is often used to describe a command-line interpreter, strictly speaking, a shell is a command interpreter and processor and by extension a program that provides an interface (either a user interface (command-line interface, GUI, etc...) or a programming interface) to a command interpreter and processor and to the broad capabilities of the operating system. For example, the default Windows GUI is a shell GUI named EXPLORER.EXE, as defined in the SHELL=EXPLORER.EXE line in the WIN.INI configuration file. This program, strictly speaking, is a shell GUI and, by extension, a shell (strictly speaking, the Windows shell is shell32.dll not explorer.exe, which is a shell GUI for shell32.dll), but it is not a CLI (command-line interpreter) nor a shell CLI (shell command-line interface).
Application command-line interfaces
Application programs (as opposed to operating systems) may also have command-line interfaces. An application program may support none, any, or all of these three major types of command-line interface mechanisms:
Parameters: Most command-line interfaces support a means to pass additional information to a program when it is launched. Interactive command-line sessions: After launch, a program may provide an operator with an independent means to enter commands. Inter-process communication: Most operating systems support means of inter-process communication (for example, standard streams or named pipes). Command lines from client processes may be redirected to a CLI program by one of these methods. Some applications support a CLI, presenting their own prompt to the user and accepting command lines. Other programs support both a CLI and a GUI. In some cases, a GUI is simply a wrapper around a separate CLI executable file. In other cases, a program may provide a CLI as an optional alternative to its GUI. CLIs and GUIs often support different functionality. For example, all features of MATLAB, a numerical analysis computer program, are available via the CLI, whereas the MATLAB GUI exposes only a subset of features. In Colossal Cave Adventure from 1975, the user uses a CLI to enter one or two words to explore a cave system.
… excerpt ends here. Continue reading the full article.





