Skip to content

Instantly share code, notes, and snippets.

@Framartin
Created August 16, 2022 19:25
Show Gist options
  • Save Framartin/a8691461b301b08eb22f88753591c06a to your computer and use it in GitHub Desktop.
Save Framartin/a8691461b301b08eb22f88753591c06a to your computer and use it in GitHub Desktop.
Crude script to sort a single folder of photos into year/month subfolders
cd my_huge_DCIM_folder
for Y in {2017..2019} ; do
echo "****** YEAR $Y ******"
for M in {01..12} ; do
echo "------ Month $M ------"
mkdir -p "$Y/$M"
mv IMG_${Y}${M}*.jpg "$Y/$M/"
mv VID_${Y}${M}*.mp4 "$Y/$M/"
mv PANO_${Y}${M}*.jpg "$Y/$M/"
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment