Created
March 25, 2015 21:04
-
-
Save pif/c59a9cae30983b6e7bc5 to your computer and use it in GitHub Desktop.
Move all Dropbox Camera Uploads files to separate folders. New folder format is YYYY_MM_DD. E.g.: 2015_01_22
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
~/D/Camera Uploads ❯❯❯ IFS=$'\n'; for f in $(ls | cat) | |
do | |
folder=$(echo $f | sed "s/\(\) \([0-9][0-9]\.[0-9][0-9]\.[0-9][0-9].*\)/\1/g" | sed "s/-/_/g") | |
echo "Moving $f to $folder" | |
mv $f ~/BACKUP/$folder | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment