I use a custom .inputrc file so that hitting up- and down- arrow keys only goes through the parts of my history that match what I’ve typed so far.

Pretty sure I got the technique from here: https://coderwall.com/p/oqtj8w/the-single-most-useful-thing-in-bash