In the UNIX world (which means basically everything not Windows, including Mac OS X) it goes something like:
for img in *.jpg; do convert -quality 70 -resize 640x480 $img small/$img; done
which performs the same operation on all jpegs in current directory: fit inside a 640x480 frame, set compression quality to 70%, and put resulting image into subdirectory
small. You can also do most other image processing tasks in the same command (blur, sharpen, despeckle etc).
ImageMagick rocks! Being able to use it without needing the GUI is a big advantage when it comes to repeated tasks. Highly recommended for Mac users!

(It's supposed to run on Windows too, but I don't how well.)