Forget pulling up Photoshop, GIMP, or any other GUI program for a simple CLI job. With utilities like ‘mogrify‘ for Linux and ‘sips‘ for Mac OSX, it’s incredibly quick and easy to batch resize images through the command line. For example, if I wanted to resize all images within a particular folder to a width of 800px without losing aspect ratio, I would use the following commands:
mogrify -resize 800 *.jpg
Under Mac OSX:
sips --resampleWidth 800 *.jpg
There are many more options for these programs, so play around and be sure to read the man pages.
Another usage example that I heard about today was to use the commands above in a script that will automatically create a thumbnail, small, medium, and large image sizes from a supplied image and then copy them off to the appropriate folder. This is useful in building a website that has a lot of different image sizes required for the same image.