Command line interface

A command line interface or CLI is a method of interacting with a computer by giving it lines of textual commands (that is, a sequence of characters) either from keyboard input or from a script. It is occasionally also referred to as a CLUE, for Command Line User Environment. In its simplest form, the user types a command after the computer displays a prompt. The computer then carries out the command given. The term is usually used in contrast to a graphical user interface (GUI) in which commands are typically issued by moving a pointer (via a pointing device) and/or pressing a key (that is, by "clicking", often on a key mounted on a mouse).

Programs that implement these interfaces are often called command line interpreters. Examples of such programs include the various different Unix shells, VMS' DCL (Digital Command Language), and related designs like CP/M and DOS's command.com, both based heavily on DEC's RSX and RSTS operating system interfaces (which were also command line interfaces). Microsoft claims their next major operating system, code-named Longhorn, 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 command lines as well. The CAD program AutoCAD is a prominent example. In some computing environments like the Oberon or Smalltalk user interface, most of the text which appears on the screen may be used for giving commands.

The commands given on a command line interface are often of the form

[doSomething] [how] [toAFile]

or

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

doSomething corresponds to a verb, how to an adverb (it describes how the command should be performed in this instance—for example, should it be particularly "verbose", or particularly "quiet") and toAFile to an object (often one or more files) against which the command should be run. The standalone '>' in the second example is a redirection character, telling the operating system (i.e., usually a command shell interpreter) to send the output of the previous commands (that is, those on the left of '>') to some other place (that is, the file named to the right of the '>'). Another common and important redirection character is the pipe ('|'), which tells the CLI to treat the output of this command as the input of another; this can be a very powerful mechanism for the user, as explained under pipeline (Unix) and pipes and filters.

Contents

Advantages of a command line interface

Even though new users seem to learn GUIs more quickly to perform common operations, well-designed CLIs have several advantages:

  • Skilled users are able to use a command line faster than a GUI for many tasks. This advantage is magnified by tab completion and by the fact that programs intended to be run from the command line are often given very short names.
  • Options and operations are often invokable in a consistent form, one "level" away from the basic command. With most GUIs, the available operations and options may appear on different menus with differing usage patterns. They may be separated on several different menu levels as well. In either case, different applications (or utilities) may have different patterns; if so there is little advantage in either approach. Both are likely to annoy users.
  • All options and operations are controlled in more or less the same way. The "more or less" in this case is a common accusation against CLIs: it should be no more difficult to understand and perform a rare operation than a common one, but in practice it may require learning previously unencountered syntax. However, few GUIs offer even comparable access to their entire range of available options.
  • CLIs can often double as scripting programming languages and can perform operations in a batch processing mode without user interaction. That means that once an operation is analyzed and understood, a "script" implementing that understanding can be written and saved. The operation can thereafter be carried out with no further analysis and design effort. With GUIs, users must start over at the beginning every time, as GUI scripting (if available at all) is almost always more limited—although macros can sometimes be used in a similar way. Simple commands do not even need an actual script, as the completed command can usually be assigned a name (an "alias") and executed simply by typing that name into the CLI.

Disavantages of a command line interface

  • CLIs have a steeper learning curve than GUIs—more time and effort must be devoted to learning the basics before even simple tasks may be accomplished.
  • CLIs are unsuited to certain tasks, such as image and sound editing.

See also

External links

de:Kommandozeile es:Lnea de comandos fr:Invite de commande ko:명령 선 공용영역 nl:Opdrachtlijn Interface ja:キャラクターユーザインターフェース pl:Wiersz poleceń

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools