linux commands

How to use OptiPNG recursively

Few hours ago I wrote about image optimization with Jpegoptim. Now I'll write few words about Optipng, a PNG and GIF optimizer. 

OptiPNG is a PNG optimizer that re-compresses image files to a smaller size, without losing any information. This program also converts external formats (BMP, GIF, PNM and TIFF) to optimized PNG, and performs PNG integrity checks and corrections. If you wish to learn how PNG optimization works, or to know about other similar tools, see the PNG-Tech article A guide to PNG optimization.

How to use Jpegoptim recursively

Jpegoptim is a Linux software that does what the name suggests: is does optimize jpg images. It is one of the two recommended software for Google Pagespeed optimization.

As this software doesn't have a recursion parameter, we use a trick to parse all the subdirectories where we have jpeg images to be optimized.

Chmod files and directories recursively

Chmod directories recursively: find . -type d -exec chmod 755 {} \;

Chmod files recursively: find . -type f -exec chmod 644 {} \;

Subscribe to RSS - linux commands


Samples of work done for me or my customers, for free or not, like websites, repairs, photography etc.
View all my recent work



I'm giving away some knowledge in my areas of expertise. Did you like something here? Share it please!
View all tutorials



Useful Linux commands or other code snippets I often use.
View my useful shortcuts



Few bookmarks I find useful. Do you want website here? Give me a good reason and I can help you.
View my favourite web resources

About me

Hi there! My name is Marius Cârneală.

About me?

Loving husband, dad of one two three, drone pilot, web designer and administrator, SEO specialist, IT support guy, electronic hobbyist and content writer. This list is open.