Mac: Rename all files names in a directory to lower case

Just like my last post, I was working with a directory of about 1000 files. There were all sorts of problems with the way they were named. Anyone who is used a *nix type system will know that “.jpg”, “.Jpg”, “.JPG” are all very separate things. To solve the issue I was having I needed to rename all of the files in the directory to lowercase.

I fired up my friend the Mac terminal and ran the following command:

for i in *; do mv "$i" "$(echo $i|tr A-Z a-z)"; done

The code loops through each of the files in the current directory and renames it to the lowercase equivalent. fast, simple, elegant. Major time saver.