Site icon Thetechhacker

How to ZIP a File on Linux

ZIP File in Linux

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.

  1. Open Terminal by pressing Ctrl + Alt + T on the keyboard.
  2. Type this:
    sudo apt install zip unzip
  3. If prompted, enter your administrator password.
  4. 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:

  1. Open your File Manager app.
  2. Right-click on the file you want to convert into ZIP.
  3. Select Compress from the list.
  4. Enter a name for the archive and change the location if you want.
  5. Verify that a checkbox in front of .zip is ticked.
  6. Click on OK.

If you prefer the old-school way, do this:

  1. Open Terminal (Ctrl + Alt + T on keyboard)
  2. 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.
  3. To ZIP a file, type this:
    zip -r archive-name.zip name-of-file.extension
  4. 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?

  1. Open Terminal, and navigate to the location in the same way as above.
  2. This time, type:
    zip -e archive-name name-of-file
  3. 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.
  4. Now, you have to Verify password by entering it again.
  5. 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.

Exit mobile version