+48 511 790 336


Google optimizer. Bash script to recursive optimize all png and .jpg

First of all install:

sudo apt install jpegoptim


sudo apt install optipng

nesxt make script file in your website folder

touch ./optimizer.sh
chmod +x ./optimizer.sh

next paste the code to file

nano ./optimizer.sh
# Script Google Optimizer
# Autor: Szymon Wójtowicz
# Site: http://artmetic.pl
# Blog:  https://blog.artmetic.pl

for f in $(find ./ -name '*.png' -or -name '*.jpg'); 
if [[ $f == *.png ]] ;then
optipng -strip all -o5 "$f";
elif [[ $f == *.jpg ]] ; then
jpegoptim "$f" --strip-all; 

and run with command



next check speed of your site

Tagi: , , , , ,

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *

This site uses Akismet to reduce spam. Learn how your comment data is processed.