BASH Shell setup filename tab-completion case insensitive

by Vivek Gite on August 16, 2007 · 5 comments

Q. I’m using BASH shell filename tab completion feature to complete file names and other stuff. However default tab-completion in bash case-sensitive. It cannot show me /tmp/Y* or /tmp/Y* files. How do I force filename tab-completion in bash case insensitive?

A. According to bash man page completion-ignore-case set to Off. If set to On, readline performs filename matching and completion in a case-insensitive fashion. Readline has variables that can be used to further customize its behavior. A variable may be set in the /etc/inputrc file with a statement of the form. So all you have to do is type following command:
$ set completion-ignore-case on

You need to add set completion-ignore-case on to /etc/inputrc command:
vi /etc/inputrc
Append text as follows:
set completion-ignore-case on
Close and save the file. For more information read bash man page.

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 5 comments… read them below or add one }

1 Corey Hart August 17, 2007

For tcsh / zsh users:

set complete enhance

Reply

2 B.Su September 14, 2007

Thanks to you. This enabled me to explore further on input configurations and startup settings

Reply

3 B.Su September 14, 2007

Thanks to you. This enabled me to explore /etc more and will be helpful in startup settings and input configurations.

Reply

4 Rob January 13, 2012

Doesn’t work.

Reply

5 Rob January 13, 2012

Last one was meant @Corey Hart. WP does not seem to take into account which Reply button was clicked, quite surprising behavior…

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 14 + 6 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: