Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to extract the Zip file under Linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to decompress the Zip file under Linux, the article is very detailed, has a certain reference value, interested friends must read it!

Zip is the most common and popular way to create compressed archive files. It is also an ancient document archiving format, which was created in 1989. Because of its widespread use, you will often encounter zip files.

In an earlier tutorial, I showed you how to compress a folder with zip on Linux. In this quick tutorial for beginners, I'll show you how to extract files on Linux.

Prerequisites: check if you have unzip installed.

To extract the zip archive, you must have the unzip package installed on your system. Most modern Linux distributions provide support for unzipping zip files, but there is always no harm in verifying these zip files to avoid future corruption.

On Unbutu-based and Debian-based distributions, you can install unzip using the following command. If you have already installed it, you will be told that it has been installed.

Sudo apt install unzip

Once you can confirm that unzip is installed on your system, you can extract the zip archive through unzip.

You can also use command-line or graphical tools to achieve your goal, and I'll show you two ways:

Use the command line to extract the file

Using the unzip command under Linux is very simple. In the directory where you put the zip file, use the following command:

Unzip zipped_file.zip

You can provide an unzipped path to the zip file instead of unzipping to the current path. You will see the extracted file in the terminal output:

Unzip metallic-container.zip-d my_zipArchive: metallic-container.zip inflating: my_zip/625993-PNZP34-678.jpg inflating: my_zip/License free.txt inflating: my_zip/License premium.txt

There is a small problem with the above command. It will extract all the contents of the zip file to the current folder. You will leave a bunch of unorganized files under the current folder, which is not a good thing.

Unzip it to the folder

Under the Linux command line, it is a good practice to extract the files into a folder. In this way, all extracted files will be stored in the folder you specified. If the folder does not exist, it is created.

Unzip zipped_file.zip-d unzipped_directory

Now everything in the zipped_file.zip is extracted into the unzipped_directory.

Since we are talking about good practices, here is another note that we can view the contents of the compressed file without actually unzipping it.

View the contents of the compressed file without extracting the compressed file unzip-l zipped_file.zip

The following is the output of the command:

Unzip-l metallic-container.zipArchive: metallic-container.zip Length Date Time Name- 6576010 2019-03-07 10:30 625993-PNZP34-678.jpg 1462 2019-03-07 13:39 License free.txt 1116 2019-03-07 13:39 License premium.txt- -6578588 3 files

There are other uses of unzip under Linux, but I think you now know enough about using unzipped files under Linux.

Use the graphical interface to extract files

If you use desktop Linux, you don't have to use the terminal all the time. Under the graphical interface, how do we extract the files? I use the GNOME desktop, but other desktop Linux distributions are pretty much the same.

Open the File Manager and jump to the folder where the zip file is located. Right-click on the file and you will see "extract here" in the pop-up window. Select it.

Unzip File in Ubuntu

Unlike the unzip command, this extraction option creates a folder with the same name as the compressed file (LCTT translation: the folder does not have a .zip extension) and stores all the contents of the compressed file in the folder you created. Compared to the default behavior of the unzip command is to extract the compressed file to the current file, the graphical interface decompression is a very good thing for me.

There is also an option to "extract to." You can select a specific folder to store the extracted files.

The above is all the contents of the article "how to extract Zip files under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report