About @BasharatSialvi answer (respectfully):
It works but it has two problems:
1- It creates I % IMG
extra directories which will remain empty
2- It has a classic bash mistake commonly known as bash pitfall number 1.
The first problem is not that critical as you can delete those extra directories, but the second problem makes everything goes wrong in many cases. For example when you have space in your file names.
So I enhance @BasharatSialvi 's answer:
COUNT=5 # Number of files to move
DES="." # Destination
DESFOLPRE="folder" # Prefix of the destination folders
I=$(find . -maxdepth 1 -mindepth 1 -type f | wc -l) # Find all files
N=$((I / COUNT)) # Number of directories needed
if [[ $((I % COUNT)) != 0 ]]; then N=$((N+1)); fi # Add one directory if cant fit files perfectly
eval mkdir "$DES"/"$DESFOLPRE"{01..$N} # Create directories
for i in $(eval echo {01..$N}) # For every directory move COUNT files
do
$(find . -maxdepth 1 -mindepth 1 -type f | sort | head -$COUNT | xargs -I filename mv filename $DES/$DESFOLPRE$i/)
done
Notice that neither Basharat's answer nor mine answer don't care about file types, so saying that they move only images is wrong. They move all files.
Hope it helps.