I have a directory which contain more than thousand images. I want to split the files in to multiple sub directories, each containing 100 files. How do I do this?
the following worked well for me. Open the directory in terminal, and just copy & paste the following script, press enter. sub directories will be created inside having names dir_001, dir_002 and so on.
i=0; for f in *; do d=dir_$(printf %03d $((i/100+1))); mkdir -p $d; mv "$f" $d; let i++; done