Ubuntu set file date/ filename from jpg exif Images Photos / exiftool

Preparations

Copy images from subdirectories to current dir

  • find ./ -type f -exec cp '{}' ./ \;

Normalize Extension

  • rename s/JPG$/jpg/ *

File Date

  • sudo apt-get install jhead
  • jhead -ft *.jpg

Filename

  • sudo apt-get install exiftool
  • exiftool '-filename<CreateDate' -d %Y-%m-%d_%H-%M-%S%%-c.%%le -r -ext jpg .

Filename + Filedate ( => often used)

  • exiftool '-filename<CreateDate' -d %Y-%m-%d_%H-%M-%S%%-c.%%le '-FileModifyDate<DateTimeOriginal' -r -ext jpg .

With added "event name" in filename

  • exiftool '-filename<CreateDate' -d my_event_name_%Y-%m-%d_%H-%M-%S%%-c.%%le '-FileModifyDate<DateTimeOriginal' -r -ext jpg .

With original filename

e.g. 2021-08-07_15-45-20_IMG_7335.jpg

  • exiftool '-filename<CreateDate' -d %Y-%m-%d_%H-%M-%S%%-c_%f.%%le '-FileModifyDate<DateTimeOriginal' -r -ext jpg .

Create directories for each year and day

  • exiftool "-Directory<DateTimeOriginal" -d "%Y/%Y-%m-%d" .

Create directory foreach day, change filename to exif date, fix timestamp

exiftool '-filename<CreateDate' -d '%Y-%m-%d/%Y-%m-%d_%H-%M-%S%%-c.%%le' '-FileModifyDate<DateTimeOriginal' -r -v -ext jpg .

Exiftool Options

https://sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html

Get infos:

exiftool -a -u -g1 DSC_0003.JPG