Linux Uppercase to Lowercase
- by Vince
-
in Blog
-
Hits: 2888
We migrated a web site from Windows to Linux and immediately upon viewing the site, we realized the majority of the images were broken.
In the world of Windows, filename.JPG equals the same as filename.jpg but in the world of Linux, these are not the same.
In the images folder, the filenames were listed in the uppercase form but in the HTML, the files were referenced using the lowercase form.
Rather than rewrite all of the HTML, this simple command run in the folder solved the trick.
rename 'y/A-Z/a-z/' *
To be clear, this command will rename every uppercase letter to lowercase. You might want to test this out before you set it loose on your data.