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.zip Desktop adding: Desktop/ (stored 0%) $ du -sh desktop.zip 4.0K desktop.zip
To use any other compression level, replace -9 with any of (-0, -1, -2, -3, -4, -5, -6, -7, -8)
I followed this on Linux Mint. The results were outstanding, 68M down to 12K. Then I opened the file and found there was nothing inside it. I found that you need to use `-r` for recursive. So the command that worked for me was `zip -9 -r desktop.zip Desktop`
I used the following command:
zip -FS9r example.zip example
According to “du -sh,” the example folder is 23 gigs, and the zip file is 22 gigs…
Is there no way to achieve higher compression by using another zip flag?