2015 Daily Photo

MAC: Rename all file name extensions to lower case in a directory structure to lower case

You need to know how to use Mac OS terminal app:

Open, type cd and then drag and drop the root directory containing the folder structure containing files to rename into the Terminal window.
If needed, confirm you’re in the correct directory, type ls and hit enter. You will see a list of all files in the directory.

I used this to rename multiple files in multiple folders within a single directory to change files that were named “xx.PDF” to “xx.pdf”
Paste this code and hit enter:

 find . -type f -name "*.PDF" -exec sh -c 'mv "$1" "${1%.PDF}.pdf"' _ {} \;

This issues the “find” command from the base directory of your directory structure containing the PDF files, or specify that directory in place of the “.” right after “find” in the above line of code.

Leave a Reply

Your email address will not be published.