Created
March 16, 2013 08:55
-
-
Save hezila/5175579 to your computer and use it in GitHub Desktop.
split multifiles into sub-folders
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
# from http://ubuntuforums.org/showthread.php?t=976447 | |
let fileCount=200 | |
let dirNum=1 | |
for f in * | |
do | |
[ -d $f ] && continue | |
[ $fileCount -eq 200 ] && { | |
dir=$(printf "%03d" $dirNum) | |
mkdir $dir | |
let dirNum=$dirNum+1 | |
let fileCount=0 | |
} | |
mv $f $dir | |
let fileCount=$fileCount+1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment