This shell script loops over all the files in the current directory and creates thumbnails in JPG format with a quality factor of 50% in the ‘new’ directory.
#!/bin/bash
FILES=*
for f in $FILES
do
echo “Processing $f file…”
convert $f -thumbnail 90×90\> -unsharp 0x.5 -quality 50 ./new/s_${f%.*}.jpg
done