I have a folder with 10,000 images, I want to move them all so I have 100 images in each new sub folder. the new folders can be simply named 01,02,03 and so on. how can this be done from the command line in ubuntu? thanks
#!/bin/bash
c=1; d=1; mkdir -p folder_${d}
for file in *
do
if [ $c -eq 100 ]
then
d=$(( d + 1 )); c=0; mkdir -p folder_${d}
fi
mv "$file" folder_${d}/
c=$(( c + 1 ))
done