Skip to content

Quickly access commands you already entered #2

@jesusff

Description

@jesusff

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-forward

In 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions