I have a folder full of DNG and JPG files like


and I want to rename them to



I am currently using these exiftool args

 exiftool -d '%Y%m%d-%H%M%S-%%f.%%le' '-filename<CreateDate' '-FileCreateDate<CreateDate' '-FileModifyDate<CreateDate' -fileOrder DateTimeOriginal -ext mp4 -ext jpg -ext heic -ext mov -ext dng ./**/*

It handles a bit more then DNG and JPG files and I'd like to keep it that way, since my folders can be mixed with different image and video format files.

I think I'd have to specify a source for the EXIF data extraction, which would be the DNG or JPG (they seem to have the exact some createDate in them). But in case a MOV or MP4 would have to be renamed, the tagsFromSource arg might not work.

  • 4
    \$\begingroup\$ This "question" has no question. \$\endgroup\$
    – xiota
    Jul 24, 2019 at 23:34
  • \$\begingroup\$ Not in one go... After renaming the JPGs, you can rename the DNGs to assume the name of the JPG they are associated with: for d in *.dng; do echo mv $d $(basename *$(basename $d .dng).jpg .jpg).dng ;done \$\endgroup\$
    – xenoid
    Jul 25, 2019 at 0:21
  • 3
    \$\begingroup\$ I recommend you taking this to Stackoverflow as its not all that related to photography. Writing a program such as this is quite easy in eg Python. \$\endgroup\$
    – timvrhn
    Jul 25, 2019 at 5:57
  • 1
    \$\begingroup\$ Are you asking if you can rename the .DNG files based upon the CreateDate in the .JPG file (or vice versa)? Does one of the file not have a CreateDate value? I would think it would be easier to make sure both files have proper timestamps, but take a look at this exiftool forums post for some details on how to rename both files based upon metadata in one of the files. You may have to use a separate command to handle the video files, though. \$\endgroup\$
    – StarGeek
    Jul 25, 2019 at 17:14
  • 1
    \$\begingroup\$ I figured out the DNG and JPG contain the exact same timestamps so I can just rename them based on their EXIF info which turns out to work great. Thanks all for your help! \$\endgroup\$
    – philk
    Aug 7, 2019 at 8:38

1 Answer 1


I have used for all my renaming needs, images and general files, Bulk Rename Utility. Works like a charm for me every time. You can make pretty complex bulk changes with it.


  • \$\begingroup\$ Thanks. I prefer a command line tool to run it headless, though. \$\endgroup\$
    – philk
    Aug 7, 2019 at 8:37
  • \$\begingroup\$ Bulk Rename Utility also has a command line tool. Check their website for more details. \$\endgroup\$ Aug 7, 2019 at 9:26
  • \$\begingroup\$ @IanTrolles Given the ./**/* in the question, and the reference to running "headless", OP is likely not using Windows, so the program you recommend wouldn't work. \$\endgroup\$
    – xiota
    Aug 7, 2019 at 18:14
  • \$\begingroup\$ If the OP uses Linux there is pyRenamer and if Mac there is Transnomino, if Finder itself cannot get the job done. \$\endgroup\$ Aug 7, 2019 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.