In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to use gunzip commands in linux", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use gunzip commands in linux" this article.
Gunzip is a widely used decompression program that is used to unzip files that have been compressed by gzip, which are preset with a .gz extension. In fact, gunzip is the hard connection of gzip, so whether it is compressed or decompressed, it can be done separately through the gzip instruction.
Linux gunzip command
We now know that compressed files can be unzipped with gzip-d or gunzip commands. The basic gunzip syntax is:
Gunzip [compressed-file-name]
The following Qaccouna example will show more clearly how the gunzip tool works:
Q1. How do I extract a file using gunzip?
The extract command is as simple as passing the name of the compressed file as an argument to the gunzip command.
Gunzip [archive-name]
For example:
Gunzip file1.gz
Linux-gunzip-commandexample
How do I extract a file using gunzip?
Q2. How do I keep gunzip from deleting the original compressed file?
As you have noticed, the gunzip command deletes the original compressed file when it is unzipped. If you want to keep the original compressed file, use the-c option.
Gunzip-c [archive-name] > [outputfile-name]
For example:
Gunzip-c file1.gz > file1Linux gunzip command example explanation Linux gunzip command example explanation
How do I keep gunzip from deleting the original compressed file?
In this way, the original compressed file will not be deleted.
Q3. How do I extract the file to another path with gunzip?
We have discussed the use of the-c option in QroomA. Using gunzip to extract the file to another path outside the working directory, you only need to add the absolute path to the target directory after the redirect operator.
Gunzip-c [compressed-file] > [/ complete/path/to/dest/dir/filename]
Examples are as follows:
Gunzip-c file1.gz > / home/himanshu/file1 more information
The following details excerpted from gzip/gunzip 's man page will be helpful for people who want to know more.
❝
Gunzip accepts a series of files on the command line and starts each with the correct magic number and suffixes a compressed file with the name .gz,-gz, .z,-z, or _ z (ignoring case), replaces it with an uncompressed file, and removes its original extension. Gunzip can also recognize compressed files with special extensions, such as .tgz and .taz, which are abbreviations for .tar.gz and .tar.Z, respectively. When compressing, gzip uses .tgz as the extension if necessary, rather than just truncating the .tar suffix.
Gunzip can currently extract files generated by gzip, zip, compress, compress-H (pack). Gunzip automatically detects the input file format. When using the first two compression formats, gunzip verifies 32-bit cyclic redundancy check codes (CRC). For pack packages, gunzip verifies the compressed length. The standard compression format does not allow compatibility testing in design. However, gunzip can sometimes detect bad .Z files. If you make an error while unzipping the .Z file, don't assume that the .Z file must be correct just because the standard decompression did not report an error. This usually means that the standard decompression process does not detect its input, but directly produces an incorrect output. SCO's compress-H format (lzh compression method) does not include CRC check codes, but does allow some compatibility checks.
The above is all the contents of the article "how to use gunzip commands in linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more 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.
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.