Created
August 7, 2011 15:21
-
-
Save hdznrrd/1130453 to your computer and use it in GitHub Desktop.
sort .NEF files into dated folders
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 | |
# for all Nikon raw files in thhe folder | |
for file in *.NEF; do | |
# get create date of file | |
date=$(stat -c %y "$file" | awk '{print $1}') | |
# if there's no folder with this date yet, create one | |
if [[ ! -d "$date" ]]; then | |
mkdir "$date" | |
echo -n "d" | |
fi | |
# move photo | |
mv "$file" "$date/" | |
echo -n "." | |
# check if there's a Bibble5 metadata file already | |
# if yes, move it as well | |
if [[ -f "$file.xmp" ]]; then | |
mv "$file.xmp" "$date/" | |
echo -n ":" | |
fi | |
done | |
echo ">" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment