Suppose I want to execute a sequence of four commands that I have executed before. If the first one is 432 in the command-history, then I could do:
$ !432; !433; !434; !435
I'm curious, is there a more efficient way to accomplish this?
|
Suppose I want to execute a sequence of four commands that I have executed before. If the first one is 432 in the command-history, then I could do:
I'm curious, is there a more efficient way to accomplish this? |
||||
|
|
|
If it refers to commands run just recently, a more efficient way is to reference them with negative numbers:
Also, once you do it, your last history entry will contain the whole chain of commands, so you can repeat it with Edit:
If you haven't already, get familiar with the great builtin function
This has one caveat, though: after this, the A safer way of doing this is to use the default
You can even reverse the order of the range of commands: |
|||||||||||||
|
|
To view a range of commands in the history:
To execute them again:
|
|||||||||||
|