Single line command to group many files into groups of however many. Useful for situations where there are directories with a very large amount of files:
i=0; for f in *; do d=dir_$(printf %03d $((i/100+1))); mkdir -p $d; mv "$f" $d; let i++; done
Running that command inside a directory with 1000 files will create 10 subdirectories with each containing 100 files. Each subdirectory will be names "dir_00{whatever iteration the loop is on".
Breakdown of command: