This is an oldie… bind the up and down arrow keys to searching `bash` history:
The post below shows the old method… Here’s an updated version:
# make bash autocomplete with up arrow
# make tab cycle through commands instead of listing
Type this into vi ~/.bash_profile, and in place of
type control + v, then up arrow. In place of
type control + v then down arrow. (Control V tells vi to put the next character in the doc, rather than just moving up when you press up arrow etc.)
bind '"<up>":history-search-backward' bind '"<down>":history-search-forward'
Then close all Terminal windows, and quit the app, then open Terminal again and you should have the feature.
PS, don’t forget to add these to your .inputrc while you’re at it:
set show-all-if-ambiguous on
set completion-ignore-case on