Extract 7z file in Linux

7-Zip is a file archiver program that claims to compress files into smaller size compared to other programs such as WinRAR and WinZip. The program can pack and unpack various formats such as ZIP, GZIP, BZIP2, TAR, and of course, its own format, 7z. The 7z format itself is actually a container that supports few compression method such as LZMA, Deflate and BZIP2, with LZMA as default.

Installation

The program is usually packaged in Linux as p7zip. If you're running Ubuntu, you can install the program by running the following command at the terminal.

$ sudo apt-get install p7zip

To install it from source, download the source from it's official website and follow the instruction from the website.

Usage

After installation, 7z file can be extracted using the command line or GUI based programs

Command line

Command line option to extract a 7z file is as simple as the following example;

p7zip -d example.7z

Nautilus

Nautilus is a file browser for GNOME. Once p7zip is installed, one can extract the file by right-clicking on the file and click on the Extract here option as shown below.