How To Create Simple And Password Protected ZIP File in Linux

Creating a ZIP archive helps keep things organized and makes it simple to transfer files from one device to another or upload them to the internet. Best of all, its powerful compression has a positive effect on the size – it shrinks without sacrificing data or quality after you extract it. Unfortunately, does not support zipping files right away, but there is a simple workaround. On Linux, follow these steps to ZIP a file.

How to Create a ZIP File in Linux

The command tar is the default way for Linux to create archives. However, we recommend installing the zip utility.

  1. First Open Terminal by Ctrl + Alt + T
  2. Type: sudo apt install zip unzip

After installation, if you see GUI (Graphical User Interface) do this:

    1. Open File Manager.
    2. Right-Click on the file you want to convert into a ZIP file.
    3. Select Compress
    4. Enter Name of Archive and Location
    5. Verify Checkbox
    6. Click Ok

If you prefer the old-school method, follow these steps:

  1. First Open Terminal by Ctrl + Alt + T
  2. To create a ZIP file, type: zip -r filename.zip filenamehere.extension
  3. Change .extension for the file you want to zip. For Example, .txt, .docx, .exe, etc.

How To Create Password Protected ZIP file

  1. Open Terminal
  2. Type: zip -e filename.zip filenamehere.extension

The -r option is used to recursively look into directories. The -e option enables encryption.

You’ll be prompted to enter and confirm your password. It’s normal that you won’t see the password being typed on the screen. Simply enter the password twice and press enter.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button