here's an example of the first useful grep I learned :
history | grep "git push"
history | grep "git push"
But how do you then pipe that to tail? :D
What you can do is press Ctrl-R again and it will search the older match. There's also forward match but I can't recall the shortcut.
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head2936 git 1166 cd 409 ll 343 ssh 302 l 279 vagrant 223 ls 201 la 151 cat 140 mkdir
history | awk '{print $2}' | sort | uniq -c | sort -rn
https://github.com/junegunn/fzf
It's a fuzzy searcher for Ctrl-r that shows all possible results, updating as you type.