The following bash script is for resizing directories of .JPG images. Its got its basics from this months Linux Format (UK) and has been written on SuSE 9.1 though there is no reason why it wont work on any Linux system with bash installed.

Copy and paste the following code into a text editor and save it as something like

for i in `ls *.JPG`;
echo "Now working on $i - Resizing to $resolution"
convert -resize $resolution $i ${root}_${counter}.jpg
echo "Image Done - ${root}_${counter} "
counter=`expr $counter + 1`

You can changed the variable root to whatever you want your pictures to start with and similarly with the resolution.

Once this is done open up the console and type:

chmod u+x


./ /home/user/photos (or whatever directory of images you want to resize.

You should see an output something like:

[email protected]:~/photos> ./ /home/pwhite/photos/
Now working on 000_0058.JPG - Resizing to 1152x864
Image Done - pic_1