There is a tool called mogrify in linux that allows mass image editing on Command Line Interface,and it works perfectly.I cannot stop admiring the tools that are available in the CLI,that surpasses the GUI counterparts for many reasons..
I use this tool regularly to compress photos I get from my friends' cameras that are big in size and resolution.And it takes just a single line of simple commands to compress entire folders of photos to desired resolution.Actually mogrify provides a huge ( and I mean huge...) amount of modifications and editing capabilities...I haven't used any other than resize option..but a regular photoshop or gimp user might appreciate the value of this.It helps a lot when you are low on memory to run a full fledged proper image editing tool to perform some of those operations...and I no longer have to wait for the big images to be loaded in GIMP to then save them with lower resolution..
I just need
vivek@vivek-desktop:~$ mogrify -resize 640 *.jpg
mogrify comes in Ubuntu with the imagemagick pack.Install using aptitude...
vivek@vivek-desktop:~$ apt-get install imagemagick
Please do try this tool and post your comments..I really love it...