Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 try to do this:

cd ~git\t

where the \t is tab character and I expect it to be expanded by bash_completion to this:

cd ~gitolite/

but it doesn't. I've uncommented the following lines in /etc/bash.bashrc and logged out and back in.

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion

What gives?

share|improve this question
up vote 0 down vote accepted

You probably have:

complete -d cd

try running this:

complete -o bashdefault -d cd

then try your cd ~git\t again.

If that works, add complete -o bashdefault -d cd to your ~/.bashrc, or wherever you put your configs for bash.

share|improve this answer
That command did the trick, as long as I have it execute after bash_completion is sourced. I put it at the end of /etc/bash.bashrc with bash_completion enabled above it, then I had to comment out the bash_completion in ~/.bashrc, so now it will work for all users. Cheers! – weston Feb 11 '11 at 6:18

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.