Ubuntu

Install 7Zip Compression Tool on Ubuntu

How to Install 7-zip on Ubuntu and use it to compress and decompress any file or folder

When you want to transfer large size of files or folder from one location to another then you need to use any good compression tools for making the task easier.  Many free tools are available to compress and decompress files and folders. One of them is 7-zip file archiver. It is an award-wining open-source file archiver with high compress ratio. This software supports most of the popular operating systems and multiple file formats. You can use this to compress and decompress files and folders in 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM formats. Some important features of this tool are mentioned below.

  • It provides better compression ratio which is 2-10% better than other similar tools.
  • It uses strong AES-256 encryption.
  • It has self-extracting capability for 7z file format.
  • It supports 87 languages

In this tutorial, you will learn how you can install and use 7-zip file archiver on Ubuntu operating system.

7-zip Installation:

Update your operating system before running the command to install 7-zip file archiver.

$ sudo apt-get update

p7zip package contains 7-zip. Two types of p7zip packages are available. These are p7zip and p7zip-full. If you want to make auto extractable archive also with other archive options then install p7zip-full. The command for p7zip-full package is executed here.

$ sudo apt-get install p7zip-full

Check the package is properly installed or not by using 7z command.

$ 7z

p7zip 16.02 version is installed here which contains 7-zip 16.02.

Using 7-zip

Select any file or folder to make compress file by using 7-zip. Type ls -la command to show the list of all files and folders of the current directory. Here, data.txt file is selected for compression. The size of the file is 540 bytes.

$ ls -la

Run the command to create compressed file named data.7z. The option a is for archive or compress.  After compression, the size of archive file is 152 bytes.

$ 7z a data.7z data.txt

To show the detail information list of any archive file, run 7z command with l option.

$ 7z l data.7z

Run 7z command with e option to decompress or extract the files and folder from a archive file.

$ 7z e data.7z

By using above steps you can create archive file of any folder also. You can create archive file of files and folders without using commands or terminal. Go to file location, select the file and right click on it to open pop-up menu. Click compress option from menu to create archive file.

Three archive options are available in the dialog box which are .zip, .tar.xz, .7z. Here, .zip is selected to create a compressed file named myfile.zip.

7-zip archiver is an efficient tool to compress and decompress your necessary files and folder.  You can easily transfer large amount of data by using this archiver.

 

About the author

Fahmida Yesmin

I am a trainer of web programming courses. I like to write article or tutorial on various IT topics. I have a YouTube channel where many types of tutorials based on Ubuntu, Windows, Word, Excel, WordPress, Magento, Laravel etc. are published: Tutorials4u Help.