Command line addition

from Wikipedia, the free encyclopedia
Example of a command line addition in bash.

The command-line completion , and tab-completion called, is a specific form of auto-completion when entering text into an electronic word processor. It facilitates and accelerates the use of a command line interpreter such as bash on Unix / Linux or Windows PowerShell on Windows . It is triggered by the tab or escape key , depending on the setting . Escape backslash is also common.

Example under Unix / Linux

Should z. For example, if you cd /ewant to change to the / etc directory, you just need to type it in and then press the add-on button - the rest of the name is added automatically.

/# cd /e 
/# cd /etc 

However, this only works if there is no second directory with an e at the beginning. If there are several subdirectories in the current directory that begin with e , the various suitable directories are offered one after the other, or another character is requested (e.g. by a tone), depending on the command line interpreter and its configuration.

/# cd /s     Es ertönt ein Piep-Ton.
/# cd /sb 
/# cd /sbin 

Command line extension on Windows

The Windows command line interpreter cmd.exe also supports command line extensions. This must first be activated in Windows 2000 ( cmd.exe / F: ON ). This is standard in subsequent Windows versions.

Alternative additional programs (e.g. 4DOS / 4NT ) as command line interpreters have supported the command line extension for Windows for years.

Context-dependent addition

In addition to the simple command line completion for programs and files, some command line interpreters such as bash and Windows PowerShell support the so-called programmable completion for context-dependent addition to the possible arguments for the respective program.

The completion includes path, file, variable, host and user name completion up to the freely programmable completion, as found since version 2.04 in the bash widespread in the Unix environment and previously in the Z shell (zsh ) and TENEX-C-Shell (tcsh).

Individual evidence