Skip to content

Instantly share code, notes, and snippets.

@DiogenesAnalytics
Forked from RagingTiger/split_directory.sh
Created December 15, 2023 18:46
Show Gist options
  • Save DiogenesAnalytics/21fcddd4523a085883551c6b9075baf2 to your computer and use it in GitHub Desktop.
Save DiogenesAnalytics/21fcddd4523a085883551c6b9075baf2 to your computer and use it in GitHub Desktop.
Split a directory of 1000 files into 10 directories of 100 files.
for number in $(seq 1 10); do mkdir "Part_${number}" && mv "$(ls *.mp4 | head -n 100)" "Part_${number}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment