Zip is a Linux/Unix compression and file packaging utility. Zip is used to compress files/directories while its companion program (unzip) is used to unpack the zip packages. Both programs can work with archives produced by PKZIP. With the recent releases of zip, it has support for bzip2 compression if the bzip2 library is was included during zip compilation.

Zip compression Levels

Compression levels regulate the speed of compression. Tthe total number of zip compression levels is 10 – (0-9), where -0 indicates no compression (store all files), -1 indicates the fastest compression speed (less compression) and -9 indicates the slowest compression speed (optimal compression, ignores the suffix list).

The default compression level is -6.

Let’s consider an example using highest zip compression level -9. To create a zip file for ~/Desktop directory run:

$ du -sh Desktop 
2.3M Desktop

$ zip -9 Desktop 
adding: Desktop/ (stored 0%)

$ du -sh 

To use any other compression level, replace -9 with any of  (-0, -1, -2, -3, -4, -5, -6, -7, -8)

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here