Linux Command History

Linux Command history


The history command displays a list of previously executed commands prefixed with a command number.

The exclamation point character, ! , is a meta-character that is used to expand previous commands without having to retype them. ! number expands to the command matching the number specified. ! string expands to the most recent command that begins with the string specified.

Linux Command History


The arrow keys can be used to navigate through previous command lines in the shell’s history. Up Arrow edits the previous command in the history list. Down Arrow edits the next command in the history list. Use this key when the Up Arrow has been pressed too many times. Left Arrow and Right Arrow move the cursor left and right in the current command line being edited.

The Esc+. Key combination causes the shell to copy the last word of the previous command on the current command line where the cursor is. If used repeatedly, it will continue to go through earlier commands. 




Tech info

Comments