Misplaced Pages

Command history: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 21:33, 17 March 2010 editR'n'B (talk | contribs)Administrators420,984 editsm Fix links to disambiguation page Bash← Previous edit Revision as of 02:33, 18 March 2010 edit undoMsnicki (talk | contribs)Extended confirmed users, Pending changes reviewers, Rollbackers10,358 edits Rewrite, point out that history started in the C shell.Next edit →
Line 1: Line 1:
{{Unreferenced|date=September 2008}} {{Unreferenced|date=September 2008}}
'''Command history''' is a common feature in ] (such as ], ], ], etc.), ] programs, and other ] that interacts with the user through a ]. 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 commands.


History was first introduced by ]<ref> by ].</ref> in the ] in 1978. It quickly became popular because it was fast and easy to use. History has since become a standard feature in other shells, including ], ] and ]'s ], History addressed two major user 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 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 of a previous one.

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>!</code>''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 ] of recent commands, which the user can select one by typing a number.


==See also== ==See also==

Revision as of 02:33, 18 March 2010

This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Command history" – news · newspapers · books · scholar · JSTOR (September 2008) (Learn how and when to remove this message)

Command 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.

History was first introduced by Bill Joy in the C shell in 1978. It quickly became popular because it was 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 major user scenarios:

  1. Executing the same command or short sequence of commands over and over. An example might be a developer frequently compiling and running a program.
  2. Correcting mistakes or rerunning a command with only a small modification of a previous one.

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.

See also

References

  1. An Introduction to the C shell by Bill Joy.
Categories: