A few note: ^R only works if you’re using emacs keybindings.
A complement to the bang history (i.e. !2) is relative history – !-2 will run the command two commands previous; !-1 runs the last command and is the same as !!. You can also use the carets to replace elements from the last command; for example:
$ ls code/bitbucket.com/
...
$ ^bitbucket^github^
ls code/github.com/
Here another great tip: it’s possible to edit the current command line in
$EDITORusing<C-x><C-e>.Or do it right with a ‘set -o vi’ :P
Some of these tricks definitely rely on having emacs keybindings (those infidels!)
A few note: ^R only works if you’re using emacs keybindings.
A complement to the bang history (i.e.
!2) is relative history –!-2will run the command two commands previous;!-1runs the last command and is the same as!!. You can also use the carets to replace elements from the last command; for example:$ ls code/bitbucket.com/ ... $ ^bitbucket^github^ ls code/github.com/