Awesome new keyboard shortcuts

A few new bash shortcuts I have recently come across that fill me with joy:

  • “Alt + .”: This inserts the last argument to the last command. So say you just tailed a config file and you want to vim it. You can do tail
    1
    thing.conf

    then

    1
    vim

    , “alt + .” and you will get:

    1
    vim thing.conf

    . Can be very helpful once you get used to it being there!

  • “ctrl + r, ctrl + r”: When you do “ctrl + r” and start typing, your bash history is searched for whatever you are typing. But what if there are multiple matches, and you don’t want the first one? Press “ctrl + r” again! This is basically a “find next”. This way you can view the matches and run the one you want.

Post to Twitter Post to Delicious Post to Digg Post to Reddit

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

This entry was posted in CLI and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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