7-Zip

Installed and started using 7-Zip compression on my OpenSolaris desktop. Installation of v4.57 is very smooth. The tool requires libstdc++.so.6 though, which is not bundled by default as part of OpenSolaris. So I have to pkg-get that and change my LD_LIBRARY_PATH like this:

bash-3.00$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/csw/lib

To check the efficiency of compression, took a random pdf file and checked the results of 7-zip against bzip2 and gzip.

bash-3.00$ ls -altr testdoc.pdf
-rw——- 1 spurthi staff 9159460 Mar 21 17:45 testdoc.pdf
bash-3.00$ cp testdoc.pdf testdoc.pdf.orig
bash-3.00$ /usr/local/bin/7za a testdoc.pdf.7z testdoc.pdf

7-Zip (A) 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06
p7zip Version 4.57 (locale=C,Utf16=off,HugeFiles=on,2 CPUs)
Scanning

Creating archive testdoc.pdf.7z

Compressing testdoc.pdf

Everything is Ok
bash-3.00$ gzip testdoc.pdf
bash-3.00$ cp testdoc.pdf.orig testdoc.pdf
bash-3.00$ bzip2 testdoc.pdf
ls -altrbash-3.00$ ls -altr
total 36712
-rw——- 1 spurthi staff 3307274 Mar 21 17:45 testdoc.pdf.gz
-rw——- 1 spurthi staff 9159460 Mar 21 17:45 testdoc.pdf.orig
-rw——- 1 spurthi staff 3068502 Mar 21 17:45 testdoc.pdf.7z
drwxrwxrwt 11 root sys 1286 Mar 21 17:51 ..
-rw——- 1 spurthi staff 3240181 Mar 21 17:51 testdoc.pdf.bz2
drwxr-xr-x 2 spurthi staff 394 Mar 21 17:51 .
bash-3.00$ du -sh *
2.9M testdoc.pdf.7z
3.1M testdoc.pdf.bz2
3.2M testdoc.pdf.gz
8.7M testdoc.pdf.orig
bash-3.00$

Overall, the compressed file is about 33% of the original file. Moreover, 7-zip offered 10% and 7% (approx) better space savings over gzip and bzip2 respectively. The only inconvenience I can foresee is the need to set the LD_LIBRARY_PATH, which I don’t do automatically for other reasons.

Note that 7-zip is not an alternative backup tool (for tar) because it won’t preserve user credentials, etc. First prepare a tar ball and then apply 7-zip compression rather, for backups.

By Raju Alluri

Blogging on my personal site since 2006, I try to cover both personal and work related events and thoughts in this blog. You can reach me on Instagram, Facebook or Twitter.

3 comments

Leave a comment

Your email address will not be published.

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