3

I’m new to Linux/Ubuntu. To my knowledge it’s not possible to make file or folder with only difference in case e.g. I can’t create the files Text.ini and text.ini (well you can but it will not work, it gives you an error), so why does the terminal care about case when you write path to something e.g. cd folder/folder but if the second folder starts with capital F then command doesn’t work?

In Windows it doesn’t matter with capital letters or not it works, so is there any way for the terminal to ignore case if the names are correct?

3
  • 2
    This is the difference between Windows and Ubuntu (any Linux). Ubuntu file and folder names are case sensitive. That is Text.ini and text.ini are indeed two different files.
    – user68186
    Apr 2, 2019 at 16:47
  • 2
    In Unices you can very well do e.g. touch Text.ini text.ini, this will create these files and not throw any error because file (and directory) names are case-sensitive. To my knowledge there’s no easy way to change that behaviour. Are you asking for a way for just the bash shell to ignore case in filenames?
    – dessert
    Apr 2, 2019 at 16:47

1 Answer 1

6

It's possible to make the terminal autocomplete behave in a case-insensitive manner which gets close to what you are most likely looking for. Add the line

set completion-ignore-case on

to /etc/inputrc and start a new terminal. After that,

cd foldTab/foldTab
will get you to the correct directory even if the second folder is in reality Folder. You'll see the autocompletion change the directory name on the fly accordingly.

1
  • I added it to the .inputrcfile into my home and it work as well.
    – aledruetta
    Apr 26, 2020 at 19:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .