Created
August 13, 2022 20:42
-
-
Save corolla96/8896ddc1525ecda13335bd01a07745ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
folder_count=$(($(ls | wc -l) / 1000 + 1)) | |
for (( i=1; i<=$folder_count; i++ )) | |
do | |
d=dir_$(printf %03d $i); | |
mkdir -p $d; | |
done | |
j=0; | |
for f in $(find . -maxdepth 1 -type f); | |
do | |
d=dir_$(printf %03d $((j/1000+1))); | |
mv "$f" $d; | |
let j++; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment