Skip to content

Instantly share code, notes, and snippets.

@henningjensen
Last active November 17, 2018 20:45
Show Gist options
  • Save henningjensen/f5784670faaf32b3c3af378ca8a9702a to your computer and use it in GitHub Desktop.
Save henningjensen/f5784670faaf32b3c3af378ca8a9702a to your computer and use it in GitHub Desktop.
exiftool cheat sheat

Rename files according to date taken

  • rename according to DateTimeOriginal-tag

  • lowercase the file extension

  • recursive from current directory

  • move to output directory in a date hierarchy

    $ exiftool -progress "-filename<DateTimeOriginal" -d "output/%Y/%Y-%m/%Y-%m-%d_%H%M%S%%-c.%%le" -r .

MP4 video files from cellphone

$ exiftool -progress "-filename<CreateDate" -d "output/%Y/%Y-%m/%Y-%m-%d_%H%M%S%%-c.%%le" -ext MP4 -r .

PNG files from cellphone, without much tags

$ exiftool -progress "-filename<FileModifyDate" -d "output/%Y/%Y-%m/%Y-%m-%d_%H%M%S%%-c.%%le" -ext PNG -r .

Add base directory name, without date, to EXIF:UserComment. Current organization of files is in directories like: 2018-03-04 - Trip to the coast. This adds "Trip to the coast" to the Exif:UserComment tag.

$ exiftool "-usercomment<${directory;s(.*?[0-9]{4}-[0-9]{2}-[0-9]{2} - )()}" -overwrite_original -r .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment