Created
August 17, 2011 12:57
-
-
Save navasvarela/1151482 to your computer and use it in GitHub Desktop.
Shell script to classify pictures according to month taken
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 | |
FILES=`find . -iregex '.*JPG'` | |
for file in $FILES | |
do | |
lastmod=`exiftool $file | grep 'Create Date' | awk '{print $4}' | sed 's/:/-/g'| sort | uniq` | |
echo "$file, Last Modification Date: $lastmod-" | |
month=`date --date="$lastmod" "+%B%Y"` | |
if [ ! -d $month ];then | |
mkdir $month | |
fi | |
cp $file $month | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment