Linux provides Zip command to work with a file like compressing the file and decompressing with a password. It’s not come with built-in you need to install from an external source. The Zip command has two different utility(zip and unzip). zip is used for compressing the file and unzip is used for decompressing the file.
Use this command in Ubuntu, Debian, and Linux mint.
sudo apt install zip unzip
For Arch Linux:
sudo pacman -S zip unzip
For Red Hat, Fedora, and CentOS.
sudo dnf install zip unzip
Zip the file with the following commands.
zip -re OUTPUT_FILE.zip FOLDER
While running this command it will ask the password for a zip file.
zip -re output_data.zip gfg
Check your file(output_data.zip) is created with password protected.
You can easily unzip the file with these commands.
While running this command it will ask the password for a decompressing zip file.
Create a Password-Protected ZIP File in Linux Using GUI
We can use our GUI window to create a zip file and unzip too. Here are the following steps:
Step 1: Go to the file location and right-click on the file.
Step 2: Then click on the compress option.
Step 3: Then click on the other option and set your password and click on Create option.
Your Password-Protected ZIP File is created.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.