Command-line completion is useful in several ways, as illustrated by the animation accompanying this article. Commonly accessed commands, especially ones with dos commands cheat sheet pdf names, require fewer keystrokes to reach.
Commands with long or difficult to spell filenames can be entered by typing the first few characters and pressing a completion key, which completes the command or filename. In the case of multiple possible completions, some command-line interpreters, especially Unix shells, will list all possible completions beginning with those few characters. An alternate form of completion rotates through all matching results when the input is ambiguous. Completable elements may include commands, arguments, file names and other entities, depending on the specific interpreter and its configuration. The domain was also expanded from only program names on the Berkeley system to both program names and files on Tenex.
Tenex implemented command line completion using the Macro-20 assembler call COMND JSYS which fully described the interaction and implementation. From there it was borrowed by Unix. This is a long command to type. Instead we can use command-line completion. Other command line shells may perform slightly differently.
This is just eight keystrokes, which is considerably less than 52 keystrokes we would have needed to type without using command-line completion. This is just seven keystrokes, comparable to prompting-style completion. This works best if we know what possibilities the interpreter will rotate through. For Korn shell users, file name completion depends on the value of the EDITOR variable. This allows the user to e. A modern zsh installation comes with completion definitions for over five hundred commands. The ‘complete’ builtin command provides fully programmable completion.
The source code comes with a ‘complete. It is possible to use a separate key-binding for matching directory names only. A Bash completion overview – “Working more productively with bash 2. This page was last edited on 28 October 2017, at 22:48.