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

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

Now,

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

You must log in to answer this question.

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