Created
May 17, 2022 17:06
-
-
Save blackhalt/f3e32952ab5c1577995039710b1c2d40 to your computer and use it in GitHub Desktop.
Sadala datnes pa direktorijiem
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
#!/bin/bash | |
dir_size=5000 | |
dir_name="0" | |
n=$((`find . -maxdepth 1 -type f | wc -l`/$dir_size+1)) | |
for i in `seq 1 $n`; | |
do | |
mkdir -p "$dir_name$i"; | |
find . -maxdepth 1 -type f | head -n $dir_size | xargs -i mv "{}" "$dir_name$i" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment