The shell lets you display or modify previous commands. Commands in the history list can be modified using:
The fc command
Line-edit mode emulates many features of the vi and Emacs editors. The history list is treated like a file. When the editor is invoked, you type editing keystrokes to move to the command line you want to execute. You can also change the line before executing it. When you're ready to issue the command, press the Enter key.
Emacs editing mode is the default. To control
command-line editing, you must use either
-o vi or
set -o emacs;
Bash does not use variables to specify the editor.
Note that vi starts in input mode; to type a vi command, press the Escape key first.
Get previous command.
Get next command.
Get previous command containing string.
Move back one character.
Move forward one character.
Move back one word.
Move forward one word.
Delete previous character.
Delete character under cursor.
Delete word forward.
Delete word backward.
Transpose two characters.