Using the Linux terminal is a fantastic thing. It gives you access to hundreds of great commands and programs, can make navigating through complex directories quick and easy, and offers tools like tab auto-complete that make doing all this a breeze. However, there is a caveat for some people: Linux is case-sensitive. Personally, I love how Linux is case-sensitive, but I know that not everyone will agree with me.

There are ways to create case-insensitive partitions, but doing this has its own technical and functional limitations. If anyone is interested, drop me a line, and I’ll work on a post on this topic.

For those that don’t like how everything in Terminal is case-sensitive, there is a solution that will relieve some of the pain. You can configure your system to make tab auto-complete case-insensitive even on a case-sensitive file system.

Before detailing how to make the change, I do have to make sure that you understand that this is a system-wide setting and will not be limited to just your user. So, if you share the system with other people, you will want to run this by them first to make sure that they are on board with the change.

This change is not permanent. If you would like to try it out and don’t like it, the change is easily reversed.

Note: My instructions are specific to Ubuntu; however, this process will work on most distros with little or no modification.

The first thing we need to do is open up Terminal (Applications > Accessories > Terminal).

Create a Backup

We’re going to make modifications to the /etc/inputrc file. In order to protect ourselves from destroying the file and to make it easy to revert back to a case-sensitive auto-complete, we need to backup the file:

sudo cp -p /etc/inputrc /etc/inputrc.bak

Now if you need to restore the original file, you can simply run the following command to restore the file from the backup:

sudo cp /etc/inputrc.bak /etc/inputrc

After opening a new Terminal window, the behavior will return to the way it was before.

Modify /etc/inputrc

There are a variety of ways to make this modification. Since I don’t know what editors you have or have not used, I’m going to provide a set of instructions that anyone can execute as is without having to know how to use vim, nano, Emacs, or any of the other editors.

We first need to change our user to root:

sudo su

Note: Your prompt will change after running this command. The familiar ‘$’ is now a ‘#’. This is to remind you that you are now the root user. Being root gives you full access to do anything without the system asking for confirmation. Delete a file, and it’s gone, no questions asked. So make sure that you do not go through and start changing or removing things if you don’t know what you’re doing while having root access.

echo "set completion-ignore-case on" >> /etc/inputrc
exit

The first command makes the change while “exit” exists out of root access, restoring your original prompt.

Test the Change

Open up a new Terminal window and try using the tab auto-complete. A good way to do this is to make sure that you are in your home directory (cd ~) and type “cd de<tab><tab>”. If the change has worked, this should either auto-complete to “Desktop” or show a list of possible options that includes “Desktop”.

Reversing the Change

As mentioned before, you can restore the original /etc/inputrc file by running the following:

sudo cp /etc/inputrc.bak /etc/inputrc

Did I help you?