Skip to content

Instantly share code, notes, and snippets.

@oleksiyp
Created July 15, 2016 18:08
Show Gist options
  • Save oleksiyp/2c88f8b07544e303c791455581fb29a3 to your computer and use it in GitHub Desktop.
Save oleksiyp/2c88f8b07544e303c791455581fb29a3 to your computer and use it in GitHub Desktop.
Deduplicate and orgranize directories by date
find . -type f -print0 | \
while IFS='' read -r -d '' x; do
d=$(date -r "$x" +%Y-%m-%d)
mkdir -p "$d"
mv -f "$x" "$d/"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment