I add these two lines to my ~/.inputrc configuration file. It allows for completely integrated reverse incremental search.
For instance $ ssh<up arrow key> will show the most recent ssh command, another <up arrow key> will show the next most recent. I find this to be the number one productivity boosting change to bash. Learning pushd and popd are also good.
$ ssh<up arrow key>
And don’t forget cd - for jumping to your previous directory.
Just to be clear; this is readline configuration and not bash. Configuration options set in inputrc affect all shells linked to readline (eg, mysql and bash).
I hadn’t ever bothered finding out exactly what it was affecting. I haven’t encountered any negative side affects, but I don’t do a lot of work with mysql, or really other similar shells. Hmm… I’ll have to keep it in mind! Thanks.
or if you are a vim user:
set -o vi
i’m always shocked when working with an emacs hater who doesn’t set their line edit mode to vi!
The docs are pretty good too: https://www.gnu.org/software/bash/manual/html_node/Using-History-Interactively.html#Using-History-Interactively
And here is a better quick reference; which includes pdf cheatsheets (though it does blur the lines between readline and bash):
I changed the title to be more descriptive, if it wasn’t necessary please let me know ;)