Command line interface

The Television & Movie Wiki: for TV, celebrities, and movies.

Image:Bash screenshot.png

A command line interface or CLI is a method of interacting with a computer. Commands are entered as lines of text (that is, sequences of typed characters) from a keyboard, and output is also received as text. CLIs originated when teletype machines were connected to computers in the 1950s. In terms of immediate interaction and feedback, they represented an advance over the use of punch cards.

With the use of CRTs as interface devices, CLIs began evolving toward graphical user interfaces (GUIs) like Microsoft Windows, Mac OS, and the X Window System, and were largely supplanted by GUIs when Microsoft introduced Windows (prompted by the success of Apple). A significant minority of computer users prefer to use CLIs, some due to visual disability, and others because they feel that CLIs provide an environment with significantly enhanced productivity. They are most often used in scientific, engineering, and technical environments, by programmers, especially in UNIX-based operating systems.

In its simplest form, a CLI displays a prompt, the user types a command on the keyboard and terminates the command (usually with the Enter key), and the computer executes the command, providing textual output.

A program that implements such interface is often called a command line interpreter or shell. Examples include the various Unix shells (sh, ksh, csh, tcsh, bash, etc.), the historical CP/M, and DOS's command.com ("Command Prompt"), the latter two based heavily on DEC's RSX and RSTS CLIs. Microsoft claims their next major operating system, Windows Vista, will include an enhanced command line interface named MSH (Microsoft Shell, codename Monad), which combines the features of traditional Unix shells with the object-oriented .NET framework.

Some applications provide both a CLI and a GUI. One example is the CAD program AutoCAD. The engineering/scientific numerical computation package Matlab provides no GUI for some calculations, but the CLI can handle any calculation. The three-dimensional-modelling program Rhinoceros 3D (used to design the cases of most cell phones, as well as thousands of other industrial products) provides a CLI (whose language, by the way, is distinct from Rhino's scripting language). In some computing environments, such as the Oberon or Smalltalk user interface, most of the text which appears on the screen may be used for giving commands.

The commands given to a CLI are often of the form

[doSomething] [how] [toFiles]

or

[doSomething] [how] < [inputFile] > [outputFile]

doSomething is in effect to a verb, how an adverb (for example, should the command be executed "verbosely" or "quietly") and toFiles an object or objects (typically one or more files) on which the command should act. The '>' in the second example is a redirection character, telling the command line interpreter to send the output of the command not to the screen but to the file named on the right of the '>'. Another redirection character is the pipe ('|'), which tells the CLI to use the output of one command as the input to the next command; this "operator-stream" mechanism can be very powerful, as explained under pipeline (Unix) and pipes and filters.

See also

External links

de:Kommandozeile es:Línea de comandos fr:Invite de commande ko:명령 선 공용영역 hu:Parancssoros felhasználói felület nl:Opdrachtlijn Interface ja:キャラクターユーザインターフェース pl:Wiersz poleceń sk:Príkazový riadok zh:命令行界面

Personal tools
Toolbox