Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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

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

Your Answer

 
discard

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.