Here is a quick way to optimize all the JPEG images on *NIX system.
It needs a program - jpegoptim
Switch to root user and install jpegoptim
#yum install jpegoptim
OR
#apt-get install jpegoptim
To optimize a single image
To find all the JPEG images in a directory recursively and optimize below is a neat command.
It needs a program - jpegoptim
Switch to root user and install jpegoptim
#yum install jpegoptim
OR
#apt-get install jpegoptim
To optimize a single image
jpegoptim photo.jpeg
To find all the JPEG images in a directory recursively and optimize below is a neat command.
find . -type f -name "*.jpg" -exec jpegoptim {} \;