Created
December 31, 2011 02:04
-
-
Save elecnix/1542482 to your computer and use it in GitHub Desktop.
Moves pictures to folders named by their date
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Reads the EXIF date of all JPG files in the current folder, | |
# and moves the files to folders named by the date. | |
# | |
# On Ubuntu, the exif package is necessary: | |
# sudo apt-get install exif | |
for f in *.jpg *.JPG ; do | |
date=$(exif -t 0x9003 $f |grep Value|cut -d ' ' -f 4|tr ':' '-') | |
echo "$f: $date" | |
mkdir -p $date | |
mv $f $date/ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment