Created
June 12, 2016 15:16
-
-
Save edib/408f497b2766f66d336b63195ff4f74b to your computer and use it in GitHub Desktop.
grouping many image files into sub directories
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
#!/bin/bash | |
dirno=1 | |
fileno=0 | |
for i in `ls *.JPG` | |
do | |
mod=$(($fileno%40)) | |
if [ "$mod" -eq "0" ] | |
then | |
dir="g$dirno" | |
mkdir $dir | |
((dirno+=1)) | |
fi | |
mv $i $dir/ | |
((fileno+=1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment