Revision as of 16:52, 5 January 2006 edit83.70.72.108 (talk) fixed "see also" links← Previous edit | Latest revision as of 11:47, 18 December 2023 edit undoInternetArchiveBot (talk | contribs)Bots, Pending changes reviewers5,381,557 edits Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5 | ||
(29 intermediate revisions by 17 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Software feature}} | |||
'''Command history''' is a common feature in ]s in ]s (such as ], ], ], etc.), ] programs, and other ] that interacts with the user through a command line. Command history involves making previously-entered commands, usually up to some limit, easy to once again input to the command line. The usual method is for the user to use the Up (and Down) ] keys to navigate through the command history, but some programs also offer the facility for the user to press a certain function key which will show a ] of recent commands, from which the user can select one by typing a number. | |||
'''Command history''' is a feature in many ], ] programs, and other ] that allows the user to recall, edit and rerun previous ]. | |||
Command line history was added to ] in ]'s ] of 1978; Joy took inspiration from an earlier implementation in ].<ref> {{Webarchive|url=https://web.archive.org/web/20180713012111/http://www.kitebird.com/csh-tcsh-book/csh-intro.pdf |date=2018-07-13 }} by ].</ref> It quickly became popular because it made the C shell fast and easy to use. History has since become a standard feature in other shells, including ], ] and ]'s ]. History addressed two important scenarios: | |||
Command history takes advantage of the fact the user may want to execute the same command many times, such as a developer frequently compiling and running a program, or else the new command may be a small modification of a previous one, hence necessitating little typing to modify it. It therefore saves a lot of ] for the user and increases the speed and accuracy of input to the computer. | |||
# Executing the same command or a short sequence of commands over and over. An example might be a developer frequently compiling and running a program. | |||
# Correcting mistakes or rerunning a command with only a small modification. | |||
In Joy's original C shell, the user could refer to a previous command by typing an exclamation, <code>!</code>, followed by additional characters to specify a particular command, only certain words, or to edit it in some way before pasting it back into the command line. For example: | |||
:<code>!!</code> meant the entire previous command. | |||
:<code>!$</code> meant just the last word of the previous command. | |||
:<code>!''abc''</code> meant the command that started with ''abc''. | |||
The usual implementation today is to combine history with command-line editing. The cursor keys are used to navigate up and down through the history list and left or right to anyplace on the line, where the user can simply type a desired change. But some implementations are ]-based: The user presses a certain function key which displays a menu of recent commands, which the user can select one by typing a number. | |||
Some implementation such as ] support to record command history to a file (<code>history</code> command).<ref>{{Cite web|url=https://en.wikiversity.org/Bash_programming/Bash_History|title = Bash programming/Bash History - Wikiversity}}</ref><ref>{{Cite web|url=https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Bash-History-Builtins|title = Bash Reference Manual}}</ref> | |||
==See also== | ==See also== | ||
*] | |||
*] | |||
*] | *] | ||
*] | *] | ||
*] | |||
*] | |||
*] | |||
==References== | |||
{{Reflist}} | |||
] |
Latest revision as of 11:47, 18 December 2023
Software featureCommand history is a feature in many operating system shells, computer algebra programs, and other software that allows the user to recall, edit and rerun previous commands.
Command line history was added to Unix in Bill Joy's C shell of 1978; Joy took inspiration from an earlier implementation in Interlisp. It quickly became popular because it made the C shell fast and easy to use. History has since become a standard feature in other shells, including ksh, Bash and Microsoft's cmd.exe. History addressed two important scenarios:
- Executing the same command or a short sequence of commands over and over. An example might be a developer frequently compiling and running a program.
- Correcting mistakes or rerunning a command with only a small modification.
In Joy's original C shell, the user could refer to a previous command by typing an exclamation, !
, followed by additional characters to specify a particular command, only certain words, or to edit it in some way before pasting it back into the command line. For example:
!!
meant the entire previous command.!$
meant just the last word of the previous command.!abc
meant the command that started with abc.
The usual implementation today is to combine history with command-line editing. The cursor keys are used to navigate up and down through the history list and left or right to anyplace on the line, where the user can simply type a desired change. But some implementations are menu-based: The user presses a certain function key which displays a menu of recent commands, which the user can select one by typing a number.
Some implementation such as Bash support to record command history to a file (history
command).
See also
- Command-line completion
- Autocomplete
- IntelliSense
- HISTORY (CONFIG.SYS directive)
- DOSKEY
- Comparison of command shells
References
- An Introduction to the C shell Archived 2018-07-13 at the Wayback Machine by Bill Joy.
- "Bash programming/Bash History - Wikiversity".
- "Bash Reference Manual".