-
Notifications
You must be signed in to change notification settings - Fork 12
Description
This morning, I showed how to easily recover the last commands you entered by using the arrow keys in your keyboard. There is also a way to traverse the commands you typed starting with a given sequence. E.g., if you already executed a find command with particular options and you want to recover it, you could just start typing find and press the key combination CTRL-PgUp as many times as you need until you find the command you are looking for (CTRL-PgDown will move you down this list).
In order for this to work, you need to have the following key mappings in your ~/.inputrc file (you can create it if it doesn't exist):
"\e[1~": beginning-of-line
"\e[2~": yank
"\e[3~": delete-char
"\e[4~": end-of-line
"\e[5~": history-search-backward
"\e[6~": history-search-forwardIn order to take effect, you'll need to restart the shell, or bind -f ~/.inputrc in your current session. You can find some addional information here: https://www.linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html