Super User is a question and answer site for computer enthusiasts and power users. 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

There are multiple reasons why this is useful, including the ability to use shell completion to add a final argument to the command and the ability to see what command you are about to run without using the p option and needing to retype the history reference with an updated time value.

share|improve this question
up vote 2 down vote accepted

This works to always expand after you hit a space:

cat >> ~/.inputrc
$if Bash
    " ": magic-space
share|improve this answer
I just saw that a common .bashrc binding is bind Space:magic-space. Seems to work well. – jonderry May 26 '11 at 21:26
this is awesome, I've been looking for this for years! I was a tcsh holdout because the history tab completion works so well. I didn't think that bash could do anything like it. But thanks to this tip, I can now have something close: Tab: magic-space – Hans-Christoph Steiner Jul 10 '12 at 2:02
Doh! So close yet so far. Turns out setting magic-space to Tab overrides the normal Tab completion. So lame, bash, so lame. Anyone know if its possible to make bash completion and magic-space both coexist using Tab? That's how it works in tcsh and its wonderful. – Hans-Christoph Steiner Jul 10 '12 at 2:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .