Bash's equivalent of Tcsh's ESC-p to jump to command starting with what you typed so far Bash's equivalent of Tcsh's ESC-p to jump to command starting with what you typed so far bash bash

Bash's equivalent of Tcsh's ESC-p to jump to command starting with what you typed so far


I was in the same boat as you, needing to switch to bash from tcsh.

I just created a new ~/.inputrc file as follows and everything works great!

$ cat ~/.inputrc"\ep": history-search-backward"\en": history-search-forward


Add this to your ~/.inputrc file:

"\e[5~": history-search-backward"\e[6~": history-search-forward

This will make PageUp act like tcsh's Esc+p and PageDown will go forward through the list.

You can bind \ep instead. If you use PageUp / PageDown, you may need to see what character sequence your keyboard/terminal produces. Just press Ctrl+V then PageUp and you'll see ^[[5~ if it's the same as \e[5~.


Personally I prefer ctrl-r - it's interactive search through history - check it, perhaps you'll like it. Subsequent ctrl-r presses jump to next match.