How to Zip Files on Linux

In this tutorial, we will guide you on how to zip files on Linux. Knowing how to zip files on Linux can come in very handy. At times, one wants to compress files in order to save space. Furthermore, you can change the compression method as well. Linux allows the user to even change the location where the zipped files would be saved.

Step 1 – Select the Compress option

First of all, right click on any file or folder and choose the “Compress” option from the drop down menu.

Choose Compress option

Step 2 – Adjust settings in Compress Utility

With that done, the compress utility window opens up. Here you can re-name the folder, change the compression method and the location where the zipped file will be saved.

Work with the Compress utility window

Step 3 – Set password for zip file

Click on Other options to and over here you can set a password for the zip file.

Set password

Step 4 – Create a zip file

Once done, simply click on the “Create” option in order to create a zip file in linux. You can see the recently created zip file on the desktop.

Creating a zip file

Step 5 – Zip files via the terminal

You can also create zip files in linux through the terminal as well. With the terminal application opened up, go to the directory where the file or folder that you want to compress is placed. Since the files are on the desktop, let’s input “cd Desktop” to access the location

Use the terminal to zip files

Step 6 – View the directory

Now let’s type in “dir” and hit the enter key. This will display all the files and folders within the directory. Over here you can see two items: Test_Folder and Test_File.

Dir command for directory

Step 7 – Command for zipping the folder

Now type in
“zip –r Test_Folder and hit enter. This will zip the folder.

Enter command to zip

Step 8 – Check desktop for the zipped files

Similarly, let’s zip the test file as well. You can notice on the desktop that as we use the commands in the terminal application, the zip file is created on the desktop.

View location for zipped files