The command line or command line is part of a computer program that accepts a line of text as input from the user and interprets it in context . In English it is known as command-line or command prompt. Often a prompt is used to identify.
The English term command-line interface , or CLI for short , describes the use of command lines to interact with a user. CLI is seen as the opposite and the historical forerunner of the graphical user interface , or GUI for short , although there are also command lines under graphical user interfaces .
A command line interface (CLI) is the simplest method of human interaction with a computer, and thus a possibility of human-computer interaction , English Human-Computer Interaction (HCI). Lines of text are transferred to the computer either directly via the keyboard or in the form of a script, which the computer then executes.
The input follows a syntax which usually consists of a command and the associated parameters. The commands are entered as character strings using the keyboard. These are usually taken from English, sometimes as an abbreviation such as the command for directory on CP / M and PC-compatible DOS or the command for list (directory) on Unix systems . The commands were seldom translated into German, for example with QBasic (which was shipped with MS-DOS 5.0 to 6.22).
The commands are executed by an interpreter , whereby each command can receive different parameters that influence the execution. There are also multi-line commands and command blocks (which extend over several lines), for example in the case of loops .
To indicate that or where a command can be entered, a command promptly signals that the program is waiting for an entry or is ready for it. The prompt thus signals to the user that the computer or the program is ready and waiting for an input, but is otherwise inactive ( English idle ). Conversely, with many command lines the prompt is not available during the execution of a command and thus signals the opposite, i.e. that no command can be executed at this time.
From a technical point of view, the command line is an input line offered by a program that is equipped with a certain amount of editor capabilities. The input is terminated by pressing a specific key. On PCs , this is the enter key , which causes the carriage return and / or linefeed characters to be sent to the program that opened the input line. The command line text entered by the user is interpreted as a reaction; For example, if the input is recognized correctly, a command line interpreter executes the corresponding commands, which then immediately display any output on the screen. A new prompt sequence then appears, which signals that another command line can be entered.
Command lines were historically the first methods of interacting with operating systems. They can therefore also be found on terminals or terminal emulations . In many operating systems , the command line is evaluated by a shell or a command line interpreter (also called command interpreter ) and the corresponding function is executed. Command lines only require text mode , but are also available in graphics mode in modern operating systems, for example as terminal emulation.
The execution of the commands is usually controlled directly from the line by additionally specified parameters ( command line parameters ). Programs that question the user interactively are rather unusual at this level, but possible (in text mode, for example, via a character-oriented user interface ). A command line program thus typically runs once with the given parameters before a new command can be entered. An automated processing of multiple commands is on Unix-like operating systems as shell - script called. Under CP / M and DOS is the name for this batch ( batch ). The files that contain the commands are called batch files .
Some application programs offer command lines, sometimes as an alternative to a graphical user interface . In the mathematical software Matlab , for example, it is an important part of the otherwise graphical user interface. This is also the case with CAD programs such as AutoCAD . Some file managers (which are in fact character-based user interfaces ), such as Norton Commander and its numerous clones such as Midnight Commander , provide access to the shell in which they run. Also Debugger often offer a combination of command line and other elements to control them. Special variants of the command line can be found in FTP client programs for text mode. In addition to the actual functionality, some Telnet clients also offer a command line for control, which can typically be called using a so-called escape key combination.
Computer games from the PC area, more precisely their underlying game engines , often offer command lines. Usually hidden and not necessary for the actual game, they allow an alternative configuration or a more profound influence on the game. It simplifies the testing of program code in development and allows specific states to be reached for troubleshooting, as well as the entry of cheat commands by players. An example of such a console is the Quake engine .
With text adventures , the command line is the only interface between the player and the game. In order to move around the game and trigger actions, appropriate commands must be entered, such as: B