
A command-line interface (CLI) processes
command
COMMAND.COM is the default command-line interpreter
A command-line interface (CLI) processes command (computing), commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line ...
s to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-line processor. Operating systems implement a command-line interface in a
shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness is very small when compared with other dimensions, and ...
for interactive access to operating system functions or services. Such access was primarily provided to users by
computer terminal
A computer terminal is an electronic or electromechanical
In engineering
Engineering is the use of scientific principles to design and build machines, structures, and other items, including bridges, tunnels, roads, vehicles, and b ...
s starting in the mid-1960s, and continued to be used throughout the 1970s and 1980s on
VAX/VMS
OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing
Multiprocessing is the use of two or more central processing units (CPUs) within a single computer system
A computer is a machine that can be programmed to carry out ...
,
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser
Multi-user software is computer software
Software is a collection of Instruction (computer science), instructions that tell a computer how to work. This is in contrast t ...

systems and personal computer systems including
DOS
DOS (, ) is a platform-independent acronym for disk operating system which later became a common shorthand for disk-based operating systems on IBM PC compatible
IBM PC compatible computers are similar to the original IBM Personal Computer, IB ...

,
CP/M
CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system
An operating system (OS) is system software
System software is software designed to provide a platform ...
and
Apple DOS
Apple DOS is the family of disk operating systems for the Apple II series of Personal computer, microcomputers from late 1978 through early 1983. It was superseded by Apple ProDOS, ProDOS in 1983. Apple DOS has three major releases: DOS 3.1, DOS ...

.
Today, many users rely upon
graphical user interface
The graphical user interface (GUI "UI" by itself is still usually pronounced . or ) is a form of user interface
In the industrial design
Industrial design is a process of design
A design is a plan or specification for the construction ...
s and menu-driven interactions. However, some programming and maintenance tasks may not have a graphical user interface and may still use a command line.
Alternatives to the command line interface include
text-based user interface
In computing, text-based user interfaces (TUI) (alternately terminal user interfaces, to reflect a dependence upon the properties of computer terminals and not just text), is a retronym describing a type of user interface (UI) common as an earl ...
menus (for example,
IBM AIX SMIT
The System Management Interface Tool (SMIT) is a menu-based management tool for the IBM AIX operating system.
It allows a user to navigate a menu hierarchy of commands, rather than using the command line.
See also
* Object Data Manager
* IB ...
),
keyboard shortcut
In computing, a keyboard shortcut is a series of one or several computer keyboard, keys that invoke a software program to perform a preprogrammed action. This action may be part of the standard functionality of the operating system or applicat ...
s, and various
desktop metaphor
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and soft ...
s centered on the
pointer (usually controlled with a
mouse
A mouse, plural mice, is a small mammal
Mammals (from Latin language, Latin , 'breast') are a group of vertebrate animals constituting the class (biology), class Mammalia (), and characterized by the presence of mammary glands which ...
). Examples of this include the Microsoft Windows,
DOS Shell
DOS Shell is a file manager
A file manager or file browser is a computer program
In imperative programming, a computer program is a sequence of instructions in a programming language that a computer can execute or interpret. In declarative pr ...
, and Mouse Systems PowerPanel. Command-line interfaces are often implemented in terminal devices that are also capable of screen-oriented text-based user interfaces that use cursor addressing to place symbols on a display screen.
Programs with command-line interfaces are generally easier to automate via
scripting.
Many software systems implement command-line interfaces for control and operation. This includes programming environments and utility programs.
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 may often find the options easier to access. Automation of repetitive tasks is simplified by line editing and history mechanisms for storing frequently used sequences; this may extend to a
scripting language
A scripting language or script language is a programming language
A programming language is a formal language
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathe ...
that can take parameters and variable options. A command-line history can be kept, allowing review or repetition of commands.
A command-line system may require paper or online 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
In metal
A metal (from Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population is approxim ...
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
An icon (from the Greek#REDIRECT Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population is appr ...
and
drop-down menu
135px, A drop-down list or drop-down menu or drop menu, with generic entries
A drop-down list (abbreviated drop-down, or DDL; also known as a drop-down menu, drop menu, pull-down list, picklist) is a graphical control element, similar to a lis ...
s of a graphical user interface, without repeated 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
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness is very small when compared with other dimensions, and ...
.
Examples of command-line interpreters include
DEC's DIGITAL Command Language
DIGITAL Command Language (DCL) is the standard command language
adopted by many of the operating system
An operating system (OS) is system software
System software is software designed to provide a platform for other software. Examples of syst ...
(DCL) in
OpenVMS
OpenVMS, often referred to as just VMS, is a multi-user
Multi-user software is software, computer software that allows access by multiple User (computing), users of a computer. Time-sharing systems are multi-user systems. Most batch processing s ...
and
RSX-11
RSX-11 is a discontinued family of multi-user
Multi-user software is software, computer software that allows access by multiple User (computing), users of a computer. Time-sharing systems are multi-user systems. Most batch processing systems for ...
, the various
Unix shell
A Unix shell is a command-line interpreter or shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness ...
s (
sh,
ksh,
csh,
tcsh
tcsh ( “tee-see-shell”, “tee-shell”, or as “tee see ess aitch”, tcsh) is a Unix shell
A Unix shell is a command-line interpreter or shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of struc ...
,
zsh
The Z shell (Zsh) is a Unix shell
A Unix shell is a command-line interpreter or shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a thr ...
,
Bash, etc.),
CP/M
CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system
An operating system (OS) is system software
System software is software designed to provide a platform ...
's
CCP,
DOS
DOS (, ) is a platform-independent acronym for disk operating system which later became a common shorthand for disk-based operating systems on IBM PC compatible
IBM PC compatible computers are similar to the original IBM Personal Computer, IB ...

'
COMMAND.COM
COMMAND.COM is the default command-line interpreter for MS- DOS, Windows 95
Windows 95 is a consumer-oriented operating system
An operating system (OS) is system software that manages computer hardware, computer software, software reso ...
, as well as the
OS/2
OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 re ...
and the Windows
CMD.EXE
cmd.exe is the default command-line interpreter
A command-line interface (CLI) processes commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-l ...
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
4DOS is a command-line interpreter
A command-line interface (CLI) processes command (computing), commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or comm ...
for DOS,
4OS2
4OS2 is the OS/2
OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to ...
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' can be any program that constitutes the user-interface, including fully graphically oriented ones. For example, the default Windows GUI is a shell program named
EXPLORER.EXE, as defined in the SHELL=EXPLORER.EXE line in the WIN.INI configuration file. These programs are shells, but not CLIs.
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 operating systems support a means to pass additional information to a program when it is launched. When a program is launched from an OS command-line shell, additional text provided along with the program name is passed to the launched program.
* ''Interactive command-line sessions'': After launch, a program may provide an operator with an independent means to enter commands in the form of text.
* ''Inter-process communication'': Most operating systems support means of
inter-process communication
In computer science
Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application.
Computer science is the study of , ...
(for example,
standard streams
In computer programming
Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task. Programming involves tasks such as: analysis, generati ...
or
named pipe
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithm
of an algorithm (Euclid's algorithm) for calculating the greatest common ...
s). Command lines from client processes may be redirected to a CLI program by one of these methods.
Some applications support only a CLI, presenting a CLI prompt to the user and acting upon command lines as they are entered. 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 computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and ...
. 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
MATLAB (an abbreviation of "MATrix LABoratory") is a and environment developed by . MATLAB allows manipulations, plotting of and data, implementation of s, creation of s, and interfacing with programs written in other languages.
Althoug ...
, a
numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic computation, symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). Numerical analysis ...
computer program, are available via the CLI, whereas the MATLAB GUI exposes only a subset of features.
The early Sierra games, such as the first three ''
King's Quest
''King's Quest'' is a graphic adventure game series, released between 1980 and 2016 and created by the American software company Sierra Entertainment. It is widely considered a classic series from the golden era of adventure games. Following the s ...
'' games (1984–1986), used commands from an internal command line to move the character around in the graphic window.
History
The command-line interface evolved from a form of dialog once conducted by humans over
teleprinter
A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point (telecommunications), point-to-point and point- ...
(TTY) machines, in which human operators remotely exchanged information, usually one line of text at a time. Early computer systems often used teleprinter machines as the means of interaction with a human operator. The computer became one end of the human-to-human teleprinter model. So instead of a human communicating with another human over a teleprinter, a human communicated with a computer.
The mechanical teleprinter was replaced by a
"glass tty", a keyboard and screen emulating the teleprinter.
"Smart" terminals permitted additional functions, such as cursor movement over the entire screen, or local editing of data on the terminal for transmission to the computer. As the
microcomputer revolution
The history of the personal computer as a mass-market consumer electronic device began with the microcomputer revolution of the 1970s. A personal computer is one intended for interactive individual use, as opposed to a mainframe computer where t ...
replaced the traditionalminicomputer + terminals
time sharing
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and sof ...
architecture, hardware terminals were replaced by
terminal emulator
A terminal emulator, terminal application, or term, is a computer program
In imperative programming, a computer program is a sequence of instructions in a programming language that a computer can execute or interpret. In declarative programmin ...
s — PC software that interpreted terminal signals sent through the PC's
serial port
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and so ...

s. These were typically used to interface an organization's new PC's with their existing mini- or mainframe computers, or to connect PC to PC. Some of these PCs were running
Bulletin Board System
A bulletin board system or BBS (also called ''Computer Bulletin Board Service'', ''CBBS'') is a computer server
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes th ...
software.
Early operating system CLIs were implemented as part of
resident monitor
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and software ...
programs, and could not easily be replaced. The first implementation of the shell as a replaceable component was part of the
Multics
Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experi ...

time-sharing
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes and development of both computer hardware , hardware and softw ...
operating system
An operating system (OS) is system software
System software is software designed to provide a platform for other software. Examples of system software include operating systems (OS) like macOS, Linux, Android (operating system), Android and Mi ...

.
In 1964,
MIT Computation Center The MIT Computation Center was organized in 1956 as a 10-year joint venture between the Massachusetts Institute of Technology
Massachusetts Institute of Technology (MIT) is a private
Private or privates may refer to:
Music
* "In Private
...
staff member
Louis Pouzin
Louis Pouzin (born 1931 in Chantenay-Saint-Imbert, Nièvre, France) is a French computer scientist. He designed an early packet-switched, packet communications network, CYCLADES.
This network was the first actual implementation of the pure datagram ...

developed the
RUNCOM
In the context of Unix-like systems, the term ''rc'' stands for the phrase "run commands". It is used for any file that contains startup information for a command. It is believed to have originated sometime in 1965 at a runcom facility from the MIT ...
tool for executing command scripts while allowing argument substitution.
Pouzin coined the term "
shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness is very small when compared with other dimensions, and ...
" to describe the technique of using commands like a programming language, and wrote a paper about how to implement the idea in the
Multics
Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing
In computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experi ...

operating system.
Pouzin returned to his native France in 1965, and the first Multics shell was developed by
Glenda Schroeder.

The first
Unix shell
A Unix shell is a command-line interpreter or shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness ...
, the
V6 shell, was developed by
Ken Thompson
Kenneth Lane Thompson (born February 4, 1943) is an American pioneer of computer science. Thompson worked at Bell Labs for most of his career where he designed and implemented the original Unix operating system. He also invented the B (programmi ...

in 1971 at
Bell Labs
Nokia Bell Labs (formerly named Bell Labs Innovations (1996–2007), AT&T Bell Laboratories (1984–1996) and Bell Telephone Laboratories (1925–1984)) is an American industrial research and scientific development company
A company, ab ...
and was modeled after Schroeder's Multics shell.
The
Bourne shell
The Bourne shell (sh) is a shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is characterized by its geometry, being a three-dimensional solid whose thickness is very small when c ...
was introduced in 1977 as a replacement for the V6 shell. Although it is used as an interactive command interpreter, it was also intended as a scripting language and contains most of the features that are commonly considered to produce structured programs. The Bourne shell led to the development of the
KornShell
KornShell (ksh) is a Unix shell which was developed by David Korn (computer scientist), David Korn at Bell Labs in the early 1980s and announced at USENIX Annual Technical Conference, USENIX on July 14, 1983. The initial development was based ...
(ksh),
Almquist shell
Almquist shell (also known as A Shell, ash and sh) is a lightweight Unix shell
A Unix shell is a command-line interpreter or shell
Shell may refer to:
Architecture and design
* Shell (structure)A shell is a type of structural element which is ...
(ash), and the popular
Bourne-again shell
Bash is a Unix shell
A Unix shell is a command-line interpreter or shell that provides a command line user interface
300px, The Reactable, an example of a tangible user interface ">tangible_user_interface.html" ;"title="Reactable, an exampl ...
(or Bash).
Early microcomputers themselves were based on a command-line interface such as
CP/M
CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system
An operating system (OS) is system software
System software is software designed to provide a platform ...
,
DOS
DOS (, ) is a platform-independent acronym for disk operating system which later became a common shorthand for disk-based operating systems on IBM PC compatible
IBM PC compatible computers are similar to the original IBM Personal Computer, IB ...

or
AppleSoft BASIC
Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with the Apple II series of computers. It supersedes Integer BASIC and is the BASIC in Read-only memory, ROM in all Apple II series computers af ...

. During the 1980s and 1990s, the introduction of the
Apple Macintosh
The Macintosh (mainly Mac since 1998) is a family of personal computers designed, manufactured, and sold by Apple Inc. (originally as Apple Computer, Inc.) since January 1984.
The Macintosh 128K, original Macintosh is the first successful m ...

and of
Microsoft Windows
Microsoft Windows, commonly referred to as Windows, is a group of several proprietary
{{Short pages monitor, supplemented with commands from the separate ''toolbox'' binary.
* Routers with Cisco IOS, Junos and many others are commonly configured from the command line.
Scripting
Most command-line interpreters support script (computer programming), scripting, to various extents. (They are, after all, interpreters of an interpreted programming language, albeit in many cases the language is unique to the particular command-line interpreter.) They will interpret scripts (variously termed shell scripts or batch files) written in the programming language, language that they interpret. Some command-line interpreters also incorporate the interpreter engines of other languages, such as REXX, in addition to their own, allowing the executing of scripts, in those languages, directly within the command-line interpreter itself.
Conversely, scripting programming languages, in particular those with an eval function (programming), function (such as REXX, Perl, Python
PYTHON was a Cold War contingency plan of the Government of the United Kingdom, British Government for the continuity of government in the event of Nuclear warfare, nuclear war.
Background
Following the report of the Strath Committee in 1955, the ...
, Ruby (programming language), Ruby or Jython), can be used to implement command-line interpreters and filters. For a few operating system
An operating system (OS) is system software
System software is software designed to provide a platform for other software. Examples of system software include operating systems (OS) like macOS, Linux, Android (operating system), Android and Mi ...

s, most notably DOS
DOS (, ) is a platform-independent acronym for disk operating system which later became a common shorthand for disk-based operating systems on IBM PC compatible
IBM PC compatible computers are similar to the original IBM Personal Computer, IB ...

, such a command interpreter provides a more flexible command-line interface than the one supplied. In other cases, such a command interpreter can present a highly customised user interface employing the user interface and input/output facilities of the language.
Other command-line interfaces
The command line provides an interface between programs as well as the user. In this sense, a command line is an alternative to a dialog box. Editors and databases present a command line, in which alternate command processors might run. On the other hand, one might have options on the command line, which opens a dialog box. The latest version of 'Take Command' has this feature. DBase used a dialog box to construct command lines, which could be further edited before use.
Programs like BASIC, diskpart, Edlin, and QBASIC all provide command-line interfaces, some of which use the system shell. Basic is modeled on the default interface for 8-bit Intel computers. Calculators can be run as command-line or dialog interfaces.
Emacs provides a command-line interface in the form of its minibuffer. Commands and arguments can be entered using Emacs standard text editing support, and output is displayed in another buffer.
There are a number of text mode games, like ''Colossal Cave Adventure, Adventure'' or ''King's Quest#Series, King's Quest 1-3'', which relied on the user typing commands at the bottom of the screen. One controls the character by typing commands like 'get ring' or 'look'. The program returns a text which describes how the character sees it, or makes the action happen. The text adventure ''The Hitchhiker's Guide to the Galaxy (video game), The Hitchhiker's Guide to the Galaxy'', a piece of interactive fiction based on Douglas Adams, Douglas Adam's book of the same name, is a teletype-style command-line game.
The most notable of these interfaces is the standard streams
In computer programming
Computer programming is the process of designing and building an executable computer program to accomplish a specific computing result or to perform a specific task. Programming involves tasks such as: analysis, generati ...
interface, which allows the output of one command to be passed to the input of another. Text files can serve either purpose as well. This provides the interfaces of piping, filters and redirection. Under Unix, Everything is a file, devices are files too, so the normal type of file for the shell used for stdin,stdout and stderr is a Teleprinter#Teleprinters in computing, tty device file.
Another command-line interface allows a shell program to launch helper programs, either to launch documents or start a program. The command is processed internally by the shell, and then passed on to another program to launch the document. The graphical interface of Windows and OS/2 rely heavily on command-lines passed through to other programs – console or graphical, which then usually process the command line without presenting a user-console.
Programs like the OS/2 E (PC DOS), E editor and some other IBM text editor, editors, can process command-lines normally meant for the shell, the output being placed directly in the document window.
A web browser's URL input field can be used as a command line. It can be used to "launch" web apps, about:config, access browser configuration, as well as perform a search. Google, which has been called "the command line of the internet" will perform a domain-specific search when it detects search parameters in a known format. This functionality is present whether the search is triggered from a browser field or on Google's website.
There are JavaScript libraries that allow to write command line applications in browser as standalone Web apps or as part of bigger application. An example of such a website is the CLI interface to DuckDuckGo.DuckDuckGo TTY
/ref> There are also Web-based SSH applications, that allow to give access to server command line interface from a browser.
Many video games on the PC feature a command line interface often referred to as a console. It is typically used by the game developers during development and by mod developers for debugging purposes as well as for cheating or skipping parts of the game.
See also
* Comparison of command shells
* List of command-line interpreters
* Console application
* Interpreter directive
* Read-eval-print loop
* Shell script
* Run command
*
* ''In the Beginning... Was the Command Line''
Notes
References
External links
The Roots of DOS
David Hunter, ''Softalk for the IBM Personal Computer'' March 1983. Archived at Patersontech.com sinc
Command-Line Reference
Microsoft TechNet Database "Command-Line Reference"
{{DEFAULTSORT:Command-Line Interface
Computing commands,
History of human–computer interaction
Software architecture
User interface techniques
User interfaces