Skip to content

Instantly share code, notes, and snippets.

@spidgorny
Created January 4, 2018 20:36
Show Gist options
  • Save spidgorny/4dd2a359d927d1a069d6e371707bfca5 to your computer and use it in GitHub Desktop.
Save spidgorny/4dd2a359d927d1a069d6e371707bfca5 to your computer and use it in GitHub Desktop.
move android DCIM photos to the folders corresponding to the month like 2018-01/
#!/bin/bash
year=2018
for i in `seq -f "%02g" 1 12`;
do
mask="???_$year$i*";
folder="$year-$i/";
mkdir -p $folder;
echo ""
echo -e "mv \t $mask \t $folder";
mv $mask $folder;
done
@spidgorny
Copy link
Author

Moves IMG_20180101_123456.jpg to 2018-01/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment