While history will bring up a log of past commands,
using Cntrl+R
will allow you to search through old commands.
When I search for “qsub” on insert_computer_cluster, my most recent submission
involving “qsub” appears.
I can continue going through previous options using Cntrl+R
again.
(reverse-i-search)\`qsub\': qsub basher.sh
Pressing an arrow key will bring you out of the search and back to the command prompt, so you can edit the command before executing. As always, Cntrl+C will end the search.