7-Zip Compression Format Support on GNU/Linux Using p7zip
7-Zip was hitherto a part only of my Windows tools arsenal; the compression tools available on GNU/Linux were so well integrated into the operating system that one hardly has to think about installing a separate compression tool. But even on Windows I had used 7-Zip to compress only to the gzip or similar popular compression formats and never to the native compression format of 7-Zip. It was only when by mistake I compressed a folder to the 7-Zip format(.7z) that couple of surprises were in store for me.
One is that, 7-Zip is lot more efficient at achieving high compression rates than most of the other popular compression tools(including gzip and bzip2). The difference in the sizes of compressed files was not trivial: .7z files were atleast 25% smaller than the .zip files created using WinZip(popular compression tool for Windows). Go to the home page of 7-Zip for some benchmarks of the different compression tools. As an example, consider the following statistics(from this source):
XAMPP Windows 1.5.4 28 MB Selfextracting 7-ZIP archive
XAMPP Lite 1.5.4 43 MB ZIP archive
XAMPP Lite 1.5.4 16 MB Selfextracting 7-ZIP archive
Even the compression and decompression times are not that high for 7-Zip.
The second surprise was that none of my GNU/Linux systems understood the .7z format ‘out-of-the-box’. Alas, the format of the most popular Free compression tool for Windows is not even recognised by the most popular Free software on the planet. A quick Google-search resulted in the port of the 7-zip package for the GNU/Linux platform – p7zip – hosted on sourceforge.net website. Below are the simple commands that will get it installed on Gentoo, Ubuntu and Debian systems. RPMs should be available for Fedora, SUSE, Mandriva etc distributions also or I think one can install it through their respective packaging systems too.
Installing p7zip:
7zip on Gentoo:
7zip on Debian/Ubuntu:
(Don’t forget to add ’sudo’ in front of the command on Ubuntu systems).
How to use p7zip on GNU/Linux:
To create an archive of all the files present in a directory:
To extract the contents of an archive:
Use ‘-t’ switch to specify the compression format to be used(zip, 7z etc). For more help on number of available command line switches, type:
The software can be built from the sources too; download the source code from here.
More information about p7zip is available on the Sourceforge website. RPMs for Fedora and Mandriva distributions are provided on the same page.
P7ZIP-Linux 中的 7-Zip…
7-Zip 是一种高压缩比存档格式 7z 的管理器,不过用于 Win 平台。如果是 Linux 用户,则可以使用 P7ZIP 来代替。
P7ZIP 的安装
Quote在 Debian/Ubuntu 系统,可通过 sudo apt-get install p7zip 进行安装。
P7ZIP 的…..
Trackback by linuxtoy.org — September 21, 2006 @ 6:42 pm
Have you had any luck using p7zip on Dreamhost? I was able to compile it, but when I try to compress something dreamhost kills the process after 30-60 seconds. Maybe it just uses too much memory when running? I’d love to be able to use it before/after backing up large files on my server. Thanks!
QuoteComment by Michael Bunsen — June 14, 2007 @ 4:29 am