Install and use 7 ZIP on Ubuntu Linux
In addition to the 7z format, the 7 ZIP tool also supports compression of other file formats such as XZ, BZIP2, GZIP, TAR, ZIP and WIM. Besides, users can use the tool to decompress files such as 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.
Continue reading TipsMake's article below to learn how to install and use 7 ZIP on Ubuntu Linux.
1. Install 7 ZIP on Ubuntu Linux
To download and install the p7zip tool on Ubuntu Linux, use the command below:
sudo apt-get install p7zip-full p7zip-rar
2. Use 7 ZIP on Ubuntu Linux
The p7zip package installs a command-line utility called 7z. Below is the syntax:
7z [adeltux] [-] [SWITCH] .
To make it easier to imagine, below TipsMake will explain how to use 7 ZIP on Ubuntu Linux.
To get started, let's first learn how to create a .7z archive using this command. Suppose you have a folder named files containing 4 files in it.
The task is to package these 4 files in a .7z file. To do this, enter your files directory into the command line and execute the command below:
$7z a files.7z *
The screenshot below shows how the command is working:
After the above command runs successfully, a file named files.7z will be created in your current working directory.
Suppose if you accidentally/intentionally delete 4 files in the current files folder.
And you want to get these files back by decompressing the .7z compressed file you just created. To do this, we use the command line option " e " as shown in the command below:
7z e files.7z
Above are the basic steps to create and decompress compressed files using the 7z tool on Ubuntu Linux.
Next suppose if you need to create a .zip file. To do this, use the command below:
7z a [zipfile-name] [files-to-be-zipped]
For example:
In addition, the 7zip tool also allows users to easily access compressed files (archive files) after creation. For example, suppose you have just created a compressed file and discover that you need to add certain files or folders to the compressed file. Instead of deleting the old archive you just created and creating a new one, you just need to update the archive you just created with the files and folders you want to add.
For example, suppose the file folder contains a total of 5 text files and you want to add file file5 to the compressed file files.7z. To do this, use the "u" option in the 7zip command:
To confirm the compressed file has been updated, just double click on the file to open it. Alternatively you can do this via the command line, using the " l " option in the 7z command:
In the screenshot above, you can see that the 7z command confirms that the files.7z archive has just been updated with the new text file.
If you want to delete certain files in the compressed file created by 7z, you can do this too. In this case, we use the command line option " d ". The overall syntax of the command is as follows:
7z d [archive-name] [file-to-be-deleted]
Note that you must add the " r " switch to the command in case the file in question is in a subfolder of the archive.
Important note
Here are some important notes that you need to remember when using the 7z utility:
- Do not use 7-zip format for backup on Linux/Unix because 7-zip does not store users/groups of files.
- On Linux/Unix, to backup folders, you must use tar command:
+ To backup a directory, use the command tar cf - directory | 7za a -si directory.tar.7z
+ To restore a backup use the command: 7za x -so directory.tar.7z | tar xf -
- If you want to send files and folders (not the file owner) to other Unix / MacOS / Windows users, you can use the 7-zip format.
- The " r " option should not be used .
- Do not use directory/* because " .* " files do not match " directory/.profile ").
The above article TipsMake has just shown you how to install and use 7 ZIP on Ubuntu Linux. In addition, if you have any questions or concerns like how to extract RAR files on Linux or Unix, readers can leave their comments in the comments section below the article.
You should read it
- 5 things to do when installing Ubuntu on PC
- Instructions to install Ubuntu directly from the hard drive
- How to install Pip in Ubuntu
- How to troubleshoot Ubuntu problems does not start
- How to Install Steam on Linux
- How to install fcgiwrap for Nginx on Ubuntu 20.04
- How to install and remove fonts on Linux
- How to install VPN on Ubuntu
May be interested
- How to mount and mount storage devices on Linux Terminalin the previous article tipsmake showed you how to use the yes command on linux. the next article below tipsmake will guide you on how to mount and mount storage devices on linux terminal.
- What makes Astra Linux stand out?the russian military is getting closer to replacing the windows operating system running on military computers with a debian-based linux distribution called astra linux. to find out what makes astra linux stand out, readers should continue reading tipsmake's article below.
- How to integrate Thunderbird into Tor browser on Linuxif you are concerned about the security of emails sent to and from the mozilla thunderbird application on linux, the best solution is to integrate thunderbird into the tor browser. the article below tipsmake will guide you how to integrate thunderbird into tor browser on linux.
- How to install AVG Antivirus on Ubuntuin addition to windows, you can install avg antivirus on ubuntu easily and quickly to ensure that damage is minimized in the most optimal way. along with tipsmake, see how to install avg antivirus on ubuntu below.
- 10 popular software new Ubuntu users must knowif you are new to ubuntu, below are 10 popular software you must know to install and use on your device, instead of having to search and install applications and software online.
- How to fix Steam games not working with Nvidia on Ubuntu Linuxif you're trying to play steam games on linux with a nividia graphics card, but the game won't run, you're probably missing important 32-bit graphics libraries. in that case, please follow the following article and apply some ways to fix steam games not working with nvidia on ubuntu linux.