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

First, let me go through a specific case and then explain the general case.

Suppose I have two directories A and B.

The contents of A are:


The contents of B are


I would like tab completion of 'f' or 'F' in A to expand to 'foo'. Likewise 'b' or 'B' to go to 'Bar'.

However in B I want completion of 'f' to only expand to 'foobar' and 'F' to only expand to 'Foobar'.

More generally, tab completion should be case insensitive iff the letter that is being completed on has exactly one case when matched.

Note that there is set completion-ignore-case on I can put into my '.inputrc' file, but this does not work as I want in the case of my hypothetical directory B.

share|improve this question

I may be wrong, but I don't think this can be done simply, as bash is just not built for that to happen, you can change it for just your login or for all users, but not for each directory.

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.