Linux

Categorized | System, cli

Easy BASH command histroy

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.

Author Profile

T4L ;

Other posts by T4L

Author's web site



Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


6 Comments

  1. Andrew Chernin

    Great advice, but how do I get out of this mode without submitting the command?

    1
  2. T4L

    @Andrew: Ctrl+C does it for me. Esc also works.

    2

  3. 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_

    3
  4. T4L

    Wow. I didn’t know you can actually tag things in bash_history. Thanks for the tip.

    4
  5. nikolko

    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”.

    5

  6. @nikolko Just press ctrl+r again. Once for each other command it can find within your history.

    6

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>