If you are a Microsoft Windows user, and your work involves sending/receiving large files over a network, there's quite a possibility that you'd have at least heard of (if not used) the 7zip tool. For those who aren't aware, 7zip is an award-winning, open-source file archiver that is claimed to have "a high compression ratio."

Aside from 7z, the tool supports several other formats. For example, you can use it to package and extract the following type of files: 7z, XZ, BZIP2, GZIP, TAR, ZIP, and WIM. However, that's not it, as the 7zip tool can also be used to unpackage several other file types, including AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z.

"Compression ratio in the new 7z format is 30-50% better than the ratio of the ZIP format," the tool's official documentation says. Following are some of the other features of 7zip that the official website lists:

  • For ZIP and GZIP formats, 7-Zip provides a compression ratio that is 2-10 % better than the ratio provided by PKZip and WinZip
  • Strong AES-256 encryption in 7z and ZIP formats
  • Self-extracting capability for 7z format
  • Integration with Windows Shell
  • Powerful File Manager
  • A powerful command line version
  • Plugin for FAR Manager
  • Localizations for 87 languages

Download and Installation of 7zip

You can easily download and install the p7zip tool in Ubuntu using the following commands:

 

sudo apt-get install p7zip-full p7zip-rar

7zip Usage

Create Archive

The p7zip package installs a command line utility named 7z. Following is its syntax:

7z [adeltux] [-] [SWITCH] ...

Now, the task is to package all these 4 files in a .7z file, say files.7z. So to do this, enter the files directory on the command line, and execute the following command:

7z a files.7z *

Extract Archive

To extract from 7z

7z e files.7z 7z a [zipfile-name] [files-to-be-zipped]