Server Fault is a question and answer site for system and network administrators. 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 there a way to make the file/dir auto-complete in bash case insensitive?

For example I would like to write:
/opt/ibm/whatever/test [TAB]

And bash will auto-complete it to:

Or at least only the last part of test to TESTfile.

I know that filesystems are case-sensitive, I just don't want to remember which parts are UPPER-case, I want auto-complete to fix the path for me.

And if I have both TESTfile and testfile, just show me both of them like bash does today with auto-complete conflicts.

share|improve this question

To add a little bit to this discussion;

shopt -s nocaseglob

This will affect wildcard expansion, so ls w* would show w1.txt W1.txt. However, as I understand it, tab-completion will ignore this setting.

You can affect tab-completion with inputrc;

echo 'set completion-ignore-case On' >> /etc/inputrc 

Or (~/.inputrc if your system is setup this way)


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.