How to Find Commands in Your Bash History

| 2 Comments
One of the things that drives me mad is typing long commands or sequences that I need to type over and over again.

Luckily there is a way to search your previous commands in bash.

Simply type CTRL R and you will get a new command prompt. Then start typing part of the command.
To keep looking back through other instances of the command just keep hitting CTRL R.
Once you've found the line you want a simple "arrow up" or similar will get you back to your normal command prompt.

Thanks to Paul / Niall for the tip.
  • Currently 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
Rating: 0 /5( 0 votes cast)

2 Comments

Uber Techie , but very useful. It also works on Cygwin (Linux Console for Windows).

Been wondering how to do this for a while now ...

Paul

Paul

I use that command all the time :)

All my personal domains are hosted on servers without any control interfaces apart from SSH. I used to rely on grepping .bash_history until someone showed me this really cool solution :)

Michele

OpenID accepted here Learn more about OpenID
Powered by Movable Type 4.2-en

About this Entry

This page contains a single entry by Michele Neylon published on September 9, 2007 1:02 PM.

domainrenewal-online.com - Still Spamming and Scamming was the previous entry in this blog.

FeedBurner Service Outage? is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.