Quickly Search the Terminal History in Unix Using Ctrl+R

A neat little trick for getting around the terminal history is by using the “reverse-i-search” feature of the terminal. To use this, simply hit [ctrl+r] in the terminal. What you’ll see is


Simply start typing and it will find previously used commands. You can hit [ctrl+r] again to search through the history if there is more than one match. For example, I typed in “hi” and it found the text pattern in my history of the command “which ifconfig”. At this point, I can hit [enter] and it will re-run the command or I can modify the command if I choose with the arrow keys like normal.

(reverse-i-search)`hi': which ifconfig

Happy terminaling!

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:

There's 0 Comment So Far

Share your thoughts, leave a comment!