I was wondering is there a way to bind say "F5" to the command sudo apt-get update so I can press one key to write this into the terminal?

link|improve this question
Why not use alias? refer to man alias for details – ashofphoenix Sep 20 '10 at 8:56
feedback

1 Answer

Add the following to `~/.inputrc":

"\e[15~": "sudo apt-get update\n"

The character sequence to put in the beginning can be gotten by using od -c <<< "CtrlV F5" and changing the 033 that shows up to \e. The change won't take effect until you open a new shell though.

link|improve this answer
bind '"\e[[E": "sudo apt-get update\n"' – Jamie Sep 10 '10 at 14:40
using ~.inputrc didnt work but the finding the key thing with od -c did work – Jamie Sep 10 '10 at 14:45
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.