Skip to content

Instantly share code, notes, and snippets.

@angrychimp
Created January 12, 2017 23:17
Show Gist options
  • Save angrychimp/b3cd314bd0fff75ea241acf58abe6bf9 to your computer and use it in GitHub Desktop.
Save angrychimp/b3cd314bd0fff75ea241acf58abe6bf9 to your computer and use it in GitHub Desktop.
# Dumps all files into the same folder
folders=($(ls targets/))
find source/ -type f -print0 | \
xargs -r0 -P 10 -I{} \
mv --target-directory=targets/${folders[$(expr $RANDOM % ${#folders[@]})]}/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment