Download 7-zip for linux
When downloading 7-zip for linux, it has a version or port called p7zip. This is compatible with linux / Unix POSIX systems. There are other unofficial packages specifically for some linux distributions, created by independent developers.
Download p7zip for POSIX systems like linux / unix
To download p7zip command line, you have to know that it is the command line version of 7-Zip for linux / unix. Some POSIX compatible operating systems are Linux, Solaris, OpenBSD, FreeBSD, Cygwin, AIX, …), MacOS X and also for BeOS and AmigaOS.
The linux tool has 3 packages:
- p7zip: Light version that only supports the 7z format.
- p7zip full: Full version that supports all formats available in 7-zip, except RAR.
- p7zip rar: It is a complement that incorporates the RAR format to the other versions.
The most recommendable installation would be the p7zip-full and rar packages, in order to enjoy all the advantages of 7zip.
Install 7-Zip on linux distributions
Normally 7-Zip is not installed by default in almost any linux distribution, but don’t worry, since it is an opensource program and we can install it without any problem in our system, besides it is usually present in the official repositories of our Linux based operating systems.
Install on Ubuntu, Debian, Linux Mint… and derivatives.
In the case of installing 7-zip in the Linux distributions based on Debian and Ubuntu, we are not going to find the three packages we have mentioned above. Command to install:
- sudo apt install p7zip-full p7zip-rar.
p7zip are usually found in the repositories of linux distributions such as Ubuntu and Debian, so make sure you have enabled the use of this command before doing the installation. Enable Repository command:
- sudo add-apt-repository universe.
- sudo apt update.
Install in CentOS, Fedora, RedHat… and derivatives.
In the case of installing 7-zip in RedHat-based Linux organizations, they propose two related packages that are p7zip and p7zip-plugins. It is advisable to install both packages. To do this you must enable the EPEL repository on CentOS / RHEL distributions. In Fedora core, it will not be necessary to configure an additional repository.
Command to install:
- sudo yum install -y -q p7zip p7zip-plugins.
Install on SuSe, OpenSuSe… and derivatives.
The 7-zip installation on SuSe based Linux distributions only requires the following command. Command for installation:
- zypper install p7zip.
Compress and unzip a file with 7-Zip in Linux
When the download and installation of 7-Zip are complete, you can use the GUI (Graphical User Interface) or command line to compress or decompress files with different formats on Linux.
Using the 7-Zip GUI
With the graphical user interface or 7-Zip GUI, you can extract the .7z files as well as unzip any other compressed file in another format.
You can open the program interface and find the file to decompress. Another option is to go directly to the folder of the file, right-click on the file, and choose extract.
You can also compress a file in 7zip format graphically. Simply right-click on the file/directory and choose compress. Below you will see several file format types as options to choose from. Choose .7z for the default 7zip format.
Command-line for using 7-Zip on Linux
This is a list of the most common command line when using 7-Zip on Linux based systems.
How to decompress a file.
To unzip a .7z file, we will use the «e» option, which will extract the file into the current working directory:
- 7z e name.7z
How to compress a file.
When creating a compressed archive file with the extension .7z, we can use the parameter «a». The supported file formats for creating archives are 7z, XZ, GZIP, TAR, ZIP and BZIP2, we execute the following syntax:
- 7z to name.7z «File to be compressed»
Select the file format.
If you want to select a specific file format, we will use the -t option (format name), which gives us the possibility to select some file formats like zip, gzip, bzip2, or tar (the default value is 7z), we will use the following syntax:
- 7z a -t «format name» nomnbre.zip «file to be compressed
See the list of compressed files.
In order to see a list of files hosted in a compressed file, we will need the «l» (list) parameter, which will show the type of format, the method used, the files in the archive, and much more:
- 7z l name.7z
Checking the integrity of a compressed file.
In order to check the integrity of an archive, we must use the «t» (test-proof) option like this:
- 7z t name.7z
Create a backup of a folder or backup.
To create a backup of a directory, you will need to use the 7za utility to keep the owner and/or group of a file, the -if option enables reading stdin files.
- tar -cf – «archives» | 7za a -si «Archives».tar.7z
Download 7-Zip full for Linux
In order to download 7-Zip full for linux or one of the Unix-based distributions, we will provide you with several links to download.
Download p7zip for Linux (Posix):
p7zip is the commandline version of 7-Zip for Linux / Unix, created by an independent developer. This version is supported as official on the 7zip page and the download of the program is on SourceForge like the other official downloads of the application.