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

Detailed explanation of how to decompress multiple files with unzip command under Linux

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

Share

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

There is no unzip command solution in linux.

If you use the unzip command to extract the .zip file, you may not have installed the unzip software. Here is how to install it.

Command: yum list | grep zip/unzip # to get the installation list

Installation command: yum install zip # when prompted for input, enter y

Installation command: yum install unzip # when prompted for input, enter y

Using unzip * .zip to decompress multiple files directly under Linux will cause an error.

You can use the unzip'* .zip' or unzip "* .zip" or unzip\ * .zip command

Or use for z in * .zip; do unzip $z; done to perform decompression

As you can see below, there are six zip package files in the current directory

[root@autoServer COLLECTION] # ll-stotal 24-rw-r--r--. 1 root root 1681 Sep 11 15:38 00004.zip4-rw-r--r--. 1 root root 1325 Sep 11 15:38 00005.zip4-rw-r--r--. 1 root root 1540 Sep 11 15:43 00010.zip4-rw-r--r--. 1 root root 1392 Sep 11 15:43 00011.zip4-rw-r--r--. 1 root root 1541 Sep 11 15:48 00016.zip4-rw-r--r--. 1 root root 1390 Sep 11 15:48 00017.zip

Using the unzip\ * .zip command to extract, you can see that all six files have been decompressed successfully.

[root@autoServer COLLECTION] # unzip\ * .zipArchive: 00005.zip inflating: GAB_ZIP_INDEX.xml inflating: 15366516000003-BASIC_1004.bcp Archive: 00010.zipreplace GAB_ZIP_INDEX.xml? [y] es, [n] o, [A] ll, [N] one, [r] ename: n inflating: 15366518460006-SOURCE_1001.bcp Archive: 00016.zipreplace GAB_ZIP_INDEX.xml? [y] es, [n] o, [A] ll, [N] one, [r] ename: An inflating: GAB_ZIP_INDEX.xml inflating: 15366519060012-SOURCE_1001.bcp Archive: 00017.zip inflating: GAB_ZIP_INDEX.xml inflating: 15366519080014-SOURCE_1002.bcp Archive: 00004.zip inflating: GAB_ZIP_INDEX.xml inflating: 15366516000001-BASIC_1003.bcp Archive: 00011.zip inflating: GAB_ZIP_INDEX.xml inflating: 15366518480008-SOURCE_1002.bcp 6 archives were successfully processed.

Then check the unzipped files in the current directory.

[root@autoServer COLLECTION] # ll-stotal 524-rw-r--r--. 1 root root 294 Sep 11 15:40 15366516000001-BASIC_1003.bcp4-rw-r--r--. 1 root root 158 Sep 11 15:40 15366516000003-BASIC_1004.bcp4-rw-r--r--. 1 root root 104 Sep 11 15:45 15366518460006-SOURCE_1001.bcp4-rw-r--r--. 1 root root 80 Sep 11 15:45 15366518480008-SOURCE_1002.bcp4-rw-r--r--. 1 root root 104 Sep 11 15:50 15366519060012-SOURCE_1001.bcp4-rw-r--r--. 1 root root 80 Sep 11 15:50 15366519080014-SOURCE_1002.bcp4-rw-r--r--. 1 root root 1681 Sep 11 15:38 00004.zip4-rw-r--r--. 1 root root 1325 Sep 11 15:38 00005.zip4-rw-r--r--. 1 root root 1540 Sep 11 15:43 00010.zip4-rw-r--r--. 1 root root 1392 Sep 11 15:43 00011.zip4-rw-r--r--. 1 root root 1541 Sep 11 15:48 00016.zip4-rw-r--r--. 1 root root 1390 Sep 11 15:48 00017.zip4-rw-r--r--. 1 root root 2056 Sep 11 15:45 GAB_ZIP_INDEX.xml

Supplementary commands for unzip usage

Extract the file to the current directory

Unzip test.zip

The-d parameter is required to extract the file to the specified directory

Unzip-d / temp test.zip

Do not overwrite existing files after decompression, use the-n parameter; to decompress in an overlay way, use the-o parameter

Unzip-n test.zipunzip-n-d / temp test.zip

Extract the compressed file test.zip under the specified directory tmp. If the same file already exists, overwrite the original file with-o

Unzip-o test.zip-d / tmp/

Just look at the sub-files contained in the zip package without decompressing it, using the-l parameter

Unzip-l test.zip

The list of files displayed also contains the compression ratio, with the-v parameter

Unzip-v test.zip

Check the zip file for corruption, using the-t parameter

Unzip-t test.zip

Summary

The above is the whole content of this article, I hope that the content of this article has a certain reference and learning value for your study or work, if you have any questions, you can leave a message and exchange, thank you for your support.

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