Skip to main content

Install and Use 7-Zip on Linux

· Updated: Jul 27, 2026 · Linux, Compression, File Management

Table of contents

Introduction

7-Zip is a file compression tool that provides high compression ratios and supports a wide range of archive formats. This guide covers installing and using 7-Zip on Linux.

What is 7-Zip?

7-Zip is an open-source file archiver utility that excels at compressing files and creating archives. It stands out for its high compression ratio and support for various archive formats, making it an invaluable tool for reducing file sizes and organizing data.

Installation

Getting started with 7-Zip on Linux is a breeze. Depending on your Linux distribution, you can use the package manager to install it.

For Ubuntu/Debian:

sudo apt update
sudo apt install p7zip-full p7zip-rar

For CentOS/RHEL:

sudo yum install epel-release
sudo yum install p7zip p7zip-plugins

For Arch based:

sudo pacman -S p7zip

For Gentoo:

sudo emerge -av app-arch/p7zip

Basic Usage

Once installed, you can harness 7-Zip’s capabilities using the command-line interface. Here are some essential commands to get you started:

  1. Creating an Archive:

    To create a new archive, use the 7z command followed by the archive name and the files you want to include:

    7z a archive.7z file1.txt file2.txt directory/
  2. Extracting Files:

    Extracting files from an archive is just as simple. Use the 7z command followed by the x flag and the archive name:

    7z x archive.7z
  3. Listing Contents:

    To view the contents of an archive without extracting it, use the l flag:

    7z l archive.7z
  4. Adding to an Existing Archive:

    You can add files to an existing archive by using the u flag:

    7z u archive.7z newfile.txt

Conclusion

7-Zip is a handy compression tool for reducing storage space on your Linux system. With the command-line interface you can compress, extract, and manage various archive formats, whether you’re handling personal files or managing server backups.