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

Is it possible to make bash expand wildcards on tab completion in the same style as zsh?

So imagine the following:

mkdir new
touch new/1.txt new/2.txt new/3.log


ls new/*.txt<TAB>

Would expand to

ls new/1.txt new/2.txt new/3.log

BUT ls new/ should not expand but should instead list potential matches (no wildcard).

M-* gets close but isn't quite there. If you try the above in zsh you will see the desired behaviour.

share|improve this question

I think you looking for C-x * (glob-expand-word). I've never used zsh, but see if that does what you are looking for.

share|improve this answer

If you use set -o vi then you can use <ESC>-* to expand wildcards, but it's instead of, not at the same time as pressing tab.

share|improve this answer

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.