You can use command-line editing to make
changes to the last command and then execute it.
|
Command Format: |
| ^old_string^new_string |
Each string can be any length. The caret (^) symbols tell history to
locate the first occurrence of the letter(s) old_string
in the previous command, substitute the letter(s) new_string
for it, and execute the modified command.
The first example in the
Figure replaces the z
in the previous command with an
s.
The second example combines history and command-line
substitution to recall and change a previous command. The :p
is used to view command number 38
first without executing it. Then the d is replaced with an s.
|