While in a Terminal session, press Ctrl+R and start typing a part of a previous command. The prompt will autocomplete the command from the bash history and you won’t need to type it all over again.
While in a Terminal session, press Ctrl+R and start typing a part of a previous command. The prompt will autocomplete the command from the bash history and you won’t need to type it all over again.
Great advice, but how do I get out of this mode without submitting the command?
@Andrew: Ctrl+C does it for me. Esc also works.
I use this alot along with tagging the things in bash_history.
Once you tag the frequently used lines of your ~/.bash_history you then just ‘ctrl-r’ #tag ‘enter’
See http://tinyurl.com/5angra for more info.
_lunix_
Wow. I didn’t know you can actually tag things in bash_history. Thanks for the tip.
but who knows how to “jump” between lines, which contains string after ctrl+r? If I type just ctrl+r and “word”, only the first occurrence will be shown. But in case I need second? pressing up arrow will bring me out of this “word” I type and just show the preceding command of that containing my “word”.
@nikolko Just press
ctrl+r
again. Once for each other command it can find within your history.