In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to decompress zip files under Linux". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "how to extract zip files under Linux"!
Usually, the Linux system does not produce zip files, but users upload the zip files to the Linux system, resulting in the need for decompression.
Command format: zip [option] compressed package name source file or source directory option:
-r: compressed directory
Example:
Zip ana.zip anaconda-ks.cfg
Compress multiple files:
Zip test.zip abc abcd
The corresponding decompression command for zip is unzip: the directory where the command is located is / usr/bin/unzip, and all users can execute it.
Command format:
Unzip [option] compressed package name
Option:-d: specify the decompression location
Example:
Unzip-d / tmp/ test.zip
2. .gz format: .gz format and .bz2 format are the most common compression formats in Linux, using the gzip command
Command format:
Note: after using gzip to compress the file, the original file will be deleted. If you want to keep the original file, you can use the-c option to write the standard output generated by the compression process to a new file. Examples are as follows: > is used to overwrite the content, and > > is used to append the content.
Compress each file in the directory: the following command will compress each file in this directory separately instead of the entire directory, that is to say, * * the gzip command will not package and compress * *
Gzip-r 123
You can also use gunzip to extract:
3. .bz2 format: .bz2 format is another commonly used compression format in Linux. The compression algorithm of this format is more advanced and the compression ratio is higher, but the compression time is longer than .gz. The compression command of .bz2 format is bzip2. Note that bzip2 cannot compress directories and will report an error.
Command format:
When decompressing, an error will be reported if the original file already exists, so it is best to delete the original file first.
4. .tar format: just packaging will not compress the file. Packaging and unpacking in .tar format all use the tar command, but the options are different.
Packaging example:
Package multiple files:
Unpack:
-C (uppercase): specify the unpackaged directory
Tip: since gzip and bzip2 cannot be packaged, they can only be compressed, while tar can only be packaged without compression, so you can package them with tar first, and then compress them with gzip or bzip2.
5. .tar.gz format and .tar.bz2 format: use tar command followed by options to achieve the combination of tar command and gzip or bzip2 command to achieve simultaneous packaging and compression, which is also the most commonly used compression and decompression method
Example:
At this point, I believe you have a deeper understanding of "how to extract zip files under Linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.