To reverse search the history of commands you used, you can use Ctrl+R and then type any part of the command. For example,
Suppose, you type the command history and want a slight modification in the 250th command.
!250:p
If you want to run a command similar to 250th command, but want to modify before running that command, use this format. This will print the command. Then, using up arrow key, you can edit the command and re-run.
configure && make && make install
Here, if you want to execute this commands again (after several commands)
Just type ctrl+R and type make
If not displayed, type ctrl+R again.
Once your command is displayed, type Enter.
To cancel the suggested command, type ctrl+C (as usually done in Linux terminal)
Suppose, you type the command history and want a slight modification in the 250th command.
!250:p
If you want to run a command similar to 250th command, but want to modify before running that command, use this format. This will print the command. Then, using up arrow key, you can edit the command and re-run.
No comments:
Post a Comment