Linux Commands

What is a ZIP file

The digital workplace relies heavily on file compression, and this is where ZIP files come in handy. They keep all of your data and files in one location and function similarly to normal folders on your computer. However, the contents of zipped files are compressed, reducing the amount of data needed by your computer that reduces the file size, making it easier to transmit or keep.

So you’re looking at a ZIP file if the extension .ZIP or.zip appears at the end of the file name. In addition, the file’s icon would be changed. Suppose that if you have various audio files in the format of .mp3, then after making a zip file, those files will change their format to the .ZIP, and their icon will also change. After receiving a ZIP file, the recipient can unzip (or extract) it and utilize it in its original format.

When to use a ZIP file

Let’s say you have a large number of files to transmit to a colleague or customer. Trying to send them all together in an attachment will result in an error message due to file size. Hence, you may try attaching each file to a separate email, but this may lead to duplicate files since adding each file takes a lot of time and effort. You can bundle all of the files and attach that single ZIP file to your email to send them all at once. After that, your receiver can unzip the file by downloading it and clicking on it.

How to make a ZIP file in Linux

You can install the ZIP utility in Linux by opening a terminal and typing.

$ sudo apt install zip

To make a ZIP file you need to access the directory where the files are available. The syntax is:

$ zip <folder_name>.zip <folder-name>

In our case, we have created a zip folder with the name of my_folder.zip that contains the content of a folder with the name of my_folder in it.

If you want to create a zip folder with all the available files in a directory then you can do that by typing.

$ zip docs *

In the above image, docs will be the name of the zip file in which your two text files are available. If you want to create a zip file with only a single document, you can also do that by typing the below-given command.

$ zip Textfile.zip Text_file_1.txt

Here text_file.zip will be the name of the Zip file you have created, and the text document with the name of “text_file_1.txt” will be available inside it.

How to extract a ZIP file in Linux

To extract a ZIP file you need to install the Unzip utility and you can do that by opening a terminal and type.

$ sudo apt install unzip

After installing the unzip utility, the next step is to extract a ZIP folder which is quite a simple task as well, all you need to do is to type.

$ unzip docs.zip

In the same way, as discussed above, you can extract another zip file as well by typing:

$ unzip Textfile.zip

You can also unzip these two or more files at the same time by typing:

$ unzip docs.zip Textfile.zip

How to make a ZIP file on Windows 11

First, you need to download any recommended application suitable for this job, and WinZip is one of the highly used applications globally for this purpose. Also, this guideline is for the windows 11 system only, but the application is available on all other operating systems. You can get this application by visiting their own website.

This will download the application setup, and later you need to install it to make a ZIP file. The files you wish to compress must be selected once the installation has been completed.  In our case, we have created a folder with the name “Winzip” and then we have placed three text files in the folder. After that, you need to select these files and right-click on any of them, where you will see the option of ” WinZip”. This will open up multiple options for you, and you need to choose any of the first two options if your purpose is to create a Winzip file only.

The first option can be used to create a ZIP file in any of the selected folders and after selecting this option, a new window will open with multiple options from where you can change the name as well as the destination of your newly created ZIP file. Onth the other hand, the second option can be used to make a ZIP file in the same folder as shown below.

How to extract a ZIP file in Windows 11

Extracting a ZIP file is quite a simple job to do. You can do that by selecting the ZIP file first you want to extract and then right-click on it. Now go to the WINZIP tab, which will provide you with various options for how and where you want to extract the files as shown below.

Conclusion

The most significant feature of Zip utility is that it can compress multiple files at once in a single location or folder. This means that the size of the files would be reduced, but the data will remain in its original form while unzipping it. You usually cannot open or make a ZIP file and need specific software. This article has taught you about the working and functionality of ZIP files for both Windows 11 and Linux OS.

About the author

Taimoor Mohsin