Skip to content

Instantly share code, notes, and snippets.

@dpq
Created December 28, 2014 19:11
Show Gist options
  • Save dpq/db783def6e0a8ffd9906 to your computer and use it in GitHub Desktop.
Save dpq/db783def6e0a8ffd9906 to your computer and use it in GitHub Desktop.
Batch rename JPEG files to match the datetime they had been taken on
for x in $(ls -1 *JPG); do mv -i $x IMG_$(exif $x | grep Date | head -1 | awk '{ print $4"_"$5 }' | sed 's/[|:]//g').jpg; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment