from small one page howto to huge articles all in one place

search text in:

Which kernel version do you use?

poll results

Last additions:
using iotop to find disk usage hogs

using iotop to find disk usage hogs






average rating: 1.7 (83 votes) (1=very good 6=terrible)

May 25th. 2007:




why adblockers are bad

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels

Workaround and fixes for the current Core Dump Handling vulnerability affected kernels






average rating: 1.3 (28 votes) (1=very good 6=terrible)

April, 26th. 2006:

Druckversion . pdf icon
You are here: System

Assign commands to key

A lot of programs (esspecially Bash) use the GNU Readline library for command line input. Readline allows to define each key with a custom value. This definition is stored in the file .inputrc in the users home directory.

If you want to assign an often used command, e.g. less /var/log/message to the key F1, you'll need to add the following line to your .inputrc:

"e[11~": "less /var/log/messages^M"

The last char in e[11~ is a tilde char. All characters have to be entered exactly as given, with only one exception: the ^M at the end. The ^M means Enter and causes a direct execution of the command. Without the ^M, the
command would be simply copied into the command line and which would wait for the input of enter or a different char.

The way you enter the ^M depends on the editor you use. In vi you have to press ctrl-V and Enter.
It has to be one single char (ASCII-code 13).

The character sequence e will be interpreted as an Escape char from Readline. The given sequence works in X11. In the console the sequence differs, but both definitions can be in the same .inputrc file.

The change in .inputrc applies with a fresh started Shell. You can refresh the setting with the key sequence ctrl-X and ctrl-R in the running shell. F1 should work now.

How to use the trick with other keys? First you have to know the code that the key generates.

You can get the code when you press ctrl-V and the desired key.

You will get an Escape-sequence (the first 2 chars are ^[ which is equal to ctrl-[ and equal to Escape)

If you replace ^[ with e, you got the sequence for .inputrc.

More details of the usage of readline can be found in the bash manpage (man bash).

Translated from

rate this article:
current rating: average rating: 2.0 (3 votes) (1=very good 6=terrible)
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)

Support this site

Please read "Why adblockers are bad".

Other free services
Shorten long
URLs to short
links like
Reverse DNS lookup
Find out which hostname(s)
resolve to a
given IP or other hostnames for the server
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2013 Sascha Nitsch Unternehmensberatung UG(haftungsbeschränkt)
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 4.9 ms