So, you decided to look for instructions on creating a ZIP file on Linux. Great, we’re glad to have you here. Generating a ZIP archive is a great thing – it helps keeps things organized, and it’s easy to transfer from one device to another or upload to the Internet. Best of all, its powerful compression affects the size positively – it goes down without a loss in data or quality after you extract it. Unfortunately, doesn’t support zipping files right off the bat, but there’s an easy way around it. This is how to ZIP a file on Linux.
Steps to make a ZIP file on Linux
Linux does have a default way to create archives, through a command called tar. We recommend installing a utility called zip, however.
- Open Terminal by pressing Ctrl + Alt + T on the keyboard.
- Type this:
sudo apt install zip unzip
- If prompted, enter your administrator password.
- A wall of text will show the installation progress and indicate whether it was successful.
After this is installed, if you like to see the graphical interface, do this:
- Open your File Manager app.
- Right-click on the file you want to convert into ZIP.
- Select Compress from the list.
- Enter a name for the archive and change the location if you want.
- Verify that a checkbox in front of .zip is ticked.
- Click on OK.
If you prefer the old-school way, do this:
- Open Terminal (Ctrl + Alt + T on keyboard)
- Inside the Terminal, navigate to the address your file is in. For example, type:
cd Documents/My Files/
Explanation: There’s no need to add root folders such as Home/YourUsername/ manually, they’re automatically included.
- To ZIP a file, type this:
zip -r archive-name.zip name-of-file.extension
- Exchange these generic names with the actual names on your computer. You don’t have to type .zip on the archive name, but you have to replace the extension for the file you want to zip. For example, .txt, .docx, .xlsx, .exe, etc.
Is it possible to put a password on the ZIP file?
- Open Terminal, and navigate to the location in the same way as above.
- This time, type:
zip -e archive-name name-of-file
- After this, you are asked to Enter password.
Don’t worry if you see no visual indication that your keystrokes are accepted. This is intentional and prevents prying eyes from remembering the number of characters in your password.
- Now, you have to Verify password by entering it again.
- After this, the archive will appear in the same folder as the file.
It was pretty quick and easy, wasn’t it? Now that you know how to generate a ZIP file, keep using the skill. And, don’t forget to mention who taught you – a little kindness goes a long way.