Rename Images Based on Exif Date

Renames all the files in the current folder based on the Exif date of that image. You’ll need the ‘jhead’ command tool – use apt-get to install it.


for i in *; do mv i "(jhead i | grep date | sed 's/^File date[^:]\+: \(.\+\):\(.\+\):\(.\+\) .*/\1-\2-\3/') $i"; done
Author: Binny V A
A philosopher programmer who specializes in backend development and stoicism.

1 thought on “Rename Images Based on Exif Date

  1. Also, if you want to exiv2 instead of jhead.

    for i in *; do mv i “(exiv2 i | grep timestamp | sed ‘s/^Image timestamp[^:]\+: \(.\+\):\(.\+\):\(.\+\) .*/\1-\2-\3/’) $i”; done

Leave a Reply

Your email address will not be published. Required fields are marked *