Skip to content

Instantly share code, notes, and snippets.

@JamesMarino
Created April 29, 2018 07:09
Show Gist options
  • Save JamesMarino/ca2608b95323c2e1c77e5193e1d4ea8d to your computer and use it in GitHub Desktop.
Save JamesMarino/ca2608b95323c2e1c77e5193e1d4ea8d to your computer and use it in GitHub Desktop.
Google Photos Upload Prep
# Change to directory with photos
cd /Users/me/photo/upload
# Flatten Current Directory (Forces overwrite)
find . -mindepth 2 -type f -exec mv -f '{}' . ';'
# Delete all folders (Assumes empty)
find . -type d -delete
# Split into 5000 files per folder
i=0; for f in *; do d=2014.1_$(printf %03d $((i/5000+1))); mkdir -p $d; mv "$f" $d; let i++; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment