Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 read on a blog somewhere about the possibility to use automatic history expansion before actually executing a command or even pressing the enter key in the command line. It involves the 'magic-space' and creating an ~/.inputrc configuration file.

What should that file contain exactly and when is it read (in login and non-login bash shells)?

share|improve this question
up vote 0 down vote accepted

Per the blog command you just need:

$if Bash
  Space: magic-space

The rest (the default settings) are sitting in /etc/inputrc.

This is read when GNU Readline (the input library Bash uses) is started. Because it's not directly part of Bash, reset and source ~/.bashrc et al won't work. To reload this without starting a new session, you need to run bind -f ~/.inputrc.

share|improve this answer
Very nice indeed. It works very well and makes the ~/.bashrc shell option -- shopt -s histverify -- redundant. Thank you. – Cbhihe Jun 10 '14 at 12:14
@Cbhihe Please accept the answer, if it helped you. – PradyJord Jun 10 '14 at 12:46

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.