Bulk Rename File Extensions e.g. .JPG to .jpg

Introduction

If you've ever needed to rename multiple files which had a different file extension then this is what you need

Solution

  1. Open the terminal.
  2. Change directory to the parent directory of folder1 using the cd command.
    cd /path/to/parent/directory/of/folder1/
    
  3. Run this command to rename all files with .JPG extension to .jpg.
    find . -type f -name '*.JPG' -print0 | xargs -0 rename 's/\.JPG/\.jpg/'
Try it out on some test files first in a test folder and once happy crack on with the parent.

Leave a comment

Your email address will not be published. Comments are moderated before appearing.