Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand that the format for key bindings in inputrc file is:

keyname: function-name or macro

For keyname, I saw things like:


What is the meaning of these keynames, and what is the general format for keyname ? Please share a link to docs.

share|improve this question

migrated from superuser.com Nov 7 '11 at 20:53

This question came from our site for computer enthusiasts and power users.

For your docs, I'd recommend looking at the readline(3) manpage or the readline user manual. – jw013 Nov 11 '11 at 6:10
Check you key configuration (readline - inputrc) via: $ bind -p – vigo Nov 21 '15 at 19:35
up vote 6 down vote accepted

Keybinding can be done using one of the following forms:

  1. keyname: command_name
  2. "keystroke_sequence": command_name

In first form you can spell out the name for a single key. For example, CONTROL-U would be written as control-u. This is useful for binding commands to single keys.

In the second form, you specify a string that describes a sequence of keys that will be bound to the command. The one you gave as an example is the emacs-tyle backslash escape sequences to represent the special keys

\C - Control
\M - Meta
\e - Escape

You can specify a backslash using another backslash – \\. Similarly ' and " can be escaped too - \' and \"


These characters is what is interpreted by your terminal when you press special keys. You don't want to bind regular alphabets and numerics in your key binding as you might be using them on regular basis and can cause issues when you accidentally hit a combination that has been mapped in your ~/.inputrc or /etc/inputrc file.

[1~ is what is interpreted by your terminal when you press your HOME button. 

To learn more, simply type read on your terminal prompt and press all types of special keys like Function Keys, HOME, END, Arrow Keys etc and see what gets displayed.

Here is a small reference I found that can offer some basic understanding. Good luck! :)

share|improve this answer
What does \e[1~, \M-l and \C-[OD mean? The \e, \M, and \C parts are clear. How about the rest? For example: [1~ - Should I press Shift+{+1+Shift+`? – Misha Moroshko Nov 11 '11 at 21:25
I have updated the answer for you. Hope that helps! – jaypal singh Nov 12 '11 at 2:00
The link is broken. Still don't know what the tilde or open bracket are for?? – Carl Smith Jul 17 at 23:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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