# cd <images_folder_orig>
# for IMAGE in $(find . -regextype posix-extended -regex '.*\.(jpg|jpeg|png)'); do jpegtran -copy none -progressive $IMAGE > ./optimized/$IMAGE ; done
# cd .. ; mv <images_folder_orig> <images_folder_orig>.backup ; ln -s optimized/ <images_folder_orig>