Skip to content

Instantly share code, notes, and snippets.

@hagope
Created November 20, 2015 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hagope/ec868b100a12d0c5ca7c to your computer and use it in GitHub Desktop.
Save hagope/ec868b100a12d0c5ca7c to your computer and use it in GitHub Desktop.
renames jpg files using exif creation date as filename in the same format as Dropbox Camera Uploads folder YYYY-MM-DD HH.MM.SS.jpg
#!/bin/bash
# requires exif command line utility
shopt -s nocaseglob #find both *.jpg and *.JPG
for i in *.JPG; do
j=`exif -t 0x9003 "$i" | grep Value: | sed 's/Value://' | sed s/:/-/g | sed s/-/./3 | sed s/-/./3`.jpg
mv -i "$i" "$j"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment