Cycle through history in linux/mac terminal

If you are like me, you often use the terminal for… well.. let’s face it, most things.
I cannot remember one day, when i’m not bashing the keys in the terminal, trying to find, script or copy my way out of things.

Often I need to do the same things more than once. This could be connecting to a server to configure something, run a script I made earlier to resize some images, some FFMPEG command that I used earlier…

Eventually you get tired from hitting the arrow up key, and some years ago I got introduced to the “reverse history search”.
This is a way to search through your recent history (history being commands you’ve used in the terminal).

Simply hit CTRL+R to start the search, and the terminal will now look like this:

When you start typing, it searches through the history of your terminal.

One thing that bothered me though, was that I could only get the most recent result, and arrow up/arrow down doesn’t search through the results.

Hitting CTRL+R again displays the next result, that has the same command.

Just wanted to share it, happy bash’ing