As alternative, you can press Ctrl+R then start typing the command or any part of the command that you are looking for. You'll see an auto-complete of a past command at your prompt. If you keep typing, more specific options will appear. You can also press Ctrl+R again as many times as you want to, this goes back in your history to the previous matching command each time (source: Navigating Bash History with Ctrl+R).
Another suggestion, if you want to find, for example, the last 5 commands from your history starting with "p", you can use the following command:
grep "^p" ~/.bash_history | tail -n 5