The Computer Oracle

Bulk rename .jpeg to .jpg

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Island

--

Chapters
00:00 Bulk Rename .Jpeg To .Jpg
00:31 Accepted Answer Score 13
01:08 Thank you

--

Full question
https://superuser.com/questions/1023904/...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #commandline #batchrename

#avk47



ACCEPTED ANSWER

Score 13


  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 .jpeg extension to .jpg.

    find . -type f -name '*.jpeg' -print0 | xargs -0 rename 's/\.jpeg/\.jpg/'
    

The above command uses the Perl rename program which is installed by default in Debian-based operating systems. In some other Linux distributions, the same Perl rename program is called prename. prename can be installed by following the instructions from: Get the Perl rename utility instead of the built-in rename.