For something more rustic, an .inputrc file with this:
# history-search-backward / history-search-forward bound to the up and down arrows
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
set show-all-if-ambiguous on
set completion-ignore-case on
Will search through anything matching what you've already entered. Type something like "gr" and scroll up or down to see all your previously used grep commands.
Saw this long ago on here and it's on every machine I use now, can't live without it. Thankyou to whoever originally posted it.