Command line interface

From Free net encyclopedia

Image:Bash screenshot.png

A command line interface or CLI is a method of interacting with a computer via a text terminal. 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, in response to the success of Apple's release of the Macintosh OS in 1984, introduced Windows the following year. Nevertheless, a significant minority of computer users prefer to use CLIs, some due to visual disability, but most because they feel that CLIs provide an environment with enhanced productivity. They are most often used by programmers and system administrators, especially in Unix-based operating systems; in engineering and scientific environments; and by a smaller subset of technically advanced home users.

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's next operating system, Windows Vista, will include support for a new command line interface named MSH (Microsoft Shell, codename Monad), which hopes to combine features of traditional Unix shells with their object oriented .NET framework. Windows current CLI programs like DOS and Windows Script Host are commonly considered inadequate or insecure. MinGW is a third-party software for Windows that offers a true Unix CLI.

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).

See also

External links

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