Linux not picking up correctly product image paths and folders- different upper and lower cases creating havoc

October 1, 2014 818 views

We are trying to load products and images onto our website but we are using a CENTOS Linux server and it is not matching up with the paths we were given. Simple example /Tire.jpg is already ready to go into the site and /TIRE.jpg is what Linux seems to have to have. I don't know if there is a program or an easy way to get these to match up as I hear Linux has to match case on everything, pictures, paths, folders, etc.
Everything we are trying to load came already ready but the cases don't match and I have no idea how to correct this without going into each one manually and editing it. Please help.

1 Answer

On Linux systems, all file names are case sensitive. If you need to rename files from the command line, there are many ways to do it. For example, if you wanted to recursively make all files on a path lowercase, you could use:

find ./ -type f -exec rename 'y/A-Z/a-z/' {} \;

What this is doing is finding all files in the directory with find ./ -type f then executing the command rename 'y/A-Z/a-z/' on each one. This uses a regular expression to find all upper case characters and change them into lower case ones.

Though this might not be the best solution for your problem. It's a bit unclear what has led to your issue. If you could tell us more about the software you are using and what you are trying to accomplish, we might be able to help you better.

Have another answer? Share your knowledge.