Ubuntu's Terminal uses case-sensitive auto-completion, as I suppose would be expected for Linux.

But I think it would often be more convenient to use a case-insensitive one instead, to save you having to be accurate while starting a name, and would probably be worth the extra false positives. Is it possible to change this behaviour?

link|improve this question
Just to say regarding the tagging, I put "terminal" because I wasn't sure whether it was bash-specific or not. Please retag if appropriate. – Matthew Dec 12 '11 at 18:54
feedback

2 Answers

up vote 16 down vote accepted

Open a terminal, run

# If ~./inputrc doesn't exist yet, first include the original /etc/inputrc so we don't override it
if [ ! -a ~/.inputrc ]; then echo "\$include /etc/inputrc" > ~/.inputrc; fi

# Add option to ~/.inputrc to enable case-insensitive tab completion
echo "set completion-ignore-case On" >> ~/.inputrc

Start a new shell / terminal

to make this change for all users, edit /etc/inputrc

For details , see man bash . Yes it is a long page, but bash is a somewhat complex program, and if you want just search that page for "case-insensitive" to go to the relevant section. People usually learn bash one option at a time or one bash script at a time and it takes a long time to master all the nuances. Your interest may vary.

link|improve this answer
Thanks. I appreciate the user-specific/non-admin friendly solution. The echo line seems to have worked, but now I seem to have lost the ability to use Ctrl-Left/Right to move the cursor. Also, would >> be safer than >? – Matthew Dec 12 '11 at 6:27
In general >> is going to be safer, my mistake, I was assuming you did not have a ~/.inputrc . I also set noclobber =) Bit sure why your arrow keys are not working, I can not replicate that. You can remove ~/.inputrc and start a new shell. – bodhi.zazen Dec 12 '11 at 6:30
Yeah, it works again if I remove it.. According to linuxfromscratch.org/blfs/view/5.1/postlfs/inputrc.html the new inputrc might be overriding the global one? – Matthew Dec 12 '11 at 7:00
On my system, I can move the cursor with just the arrow keys. – bodhi.zazen Dec 12 '11 at 7:14
Try addin a first line $include /etc/inputrc to your ~/.inputrc. – enzotib Dec 12 '11 at 8:16
show 7 more comments
feedback

Open a terminal and type the below command:

echo set completion-ignore-case on | sudo tee -a /etc/inputrc

Enter password. Restart terminal.

If in some case you want to remove case insensitive, just edit /etc/inputrc file by removing the set completion-ignore-case line.

That's all.

link|improve this answer
if in some case you want to remove case insensitive.. just edit /etc/inputrc file by removing ...set completion-ignore-case line – nitinmartolia Dec 12 '11 at 5:52
Instead of adding extra information about your answer in a comment, you can edit the original answer :) – Caesium Dec 12 '11 at 10:18
i know i could have ... but that was a spontaneous act...i didn't think of it much... thanks for the recommendation :) ... that was little irresponsible from side to properly guide someone... – nitinmartolia Dec 12 '11 at 14:52
OK, I clarified that for you. It takes a while to learn about bash, but keep exploring, reading, and asking. linuxcommand.org is a popular start ;) – bodhi.zazen Dec 14 '11 at 16:46
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.