Every Flavour Beans

“The time has come…to talk of many [technologies].” –Lewis Carroll(’The Walrus and the Carpenter’)
Development Tools. Web Frameworks. GNU/Linux. Nokia N800. Video Encoding.

September 21, 2006

7-Zip Compression Format Support on GNU/Linux Using p7zip

Filed under: GNU/Linux, General — tabrez @ 1:29 pm

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     86 MB     ZIP Archive
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:

sh# emerge p7zip

7zip on Debian/Ubuntu:

sh# apt-get install p7zip

(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:

sh# 7za a -t7z test.7z *

To extract the contents of an archive:

sh# 7za e test.7z

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:

sh# 7za –help

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.


If you want to receive future posts by email, enter your email address here:

Related Posts:

  • Step 2(c): Converting DVD Format(VOB) to AVI(DivX/XviD) Format Using SimpleDivX
  • Step 1: Ripping Movie DVDs to the Hard Disk(VOB format)
  • Setting Up Development Environment For Grails on GNU/Linux
  • Nokia N800 As an EBook Reader Using FBReader
  • Convert DVD Movies to iPod Format(with Subtitles) Using Free Software
  • What is New in Wordpress 2.3 (Beta 1/2)?
  • Step 4(a): Converting AVI Format to iPod Format Using Videora iPod Converter

  • 2 Comments »

    1. P7ZIP-Linux 中的 7-Zip…

      7-Zip 是一种高压缩比存档格式 7z 的管理器,不过用于 Win 平台。如果是 Linux 用户,则可以使用 P7ZIP 来代替。

      P7ZIP 的安装
      在 Debian/Ubuntu 系统,可通过 sudo apt-get install p7zip 进行安装。
      P7ZIP 的…..

      Quote

      Trackback by linuxtoy.org — September 21, 2006 @ 6:42 pm

    2. 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!

      Quote

      Comment by Michael Bunsen — June 14, 2007 @ 4:29 am

    RSS feed for comments on this post. TrackBack URI

    Leave a comment

    Subscribe without commenting


    Copyright (c) 2006, 2007 Tabrez Iqbal.
    Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved. A copy of the license is included in the section entitled "GNU Free Documentation License".


    Powered by WordPress
    This website is hosted by Dreamhost