How To'sLinux

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, Linux does not support zip files right away, but there is a simple workaround. Follow these steps to create ZIP files and install the utility.

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 the Name of the Archive and the 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 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 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.

Noor Qureshi

Experienced Founder with a demonstrated history of working in the computer software industry. Skilled in Network Security and Information Security.

Leave a Reply

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

Back to top button