.tar.gz and .gz files are two different files and need to be treated differently. Of course, the decompression commands are also different. Let’s share their respective decompression methods.
1. .tar.gz file, this file is a compressed file of a tar file and can be decompressed using the tar command.
For example:
Extract: tar zxvf pythontab.tar.gz
Extract the file to the specified folder: tar xzvf fenci.py.tar.gz -C pythontab/
2. Simple. gz file decompression. This kind of file cannot be decompressed using the tar command. It needs to be decompressed with gunzip. Use the command gzip
to decompress: gzip -b pythontab.gz
But note: gzip does not seem to be able to be set to decompress to a specified directory. , can only be decompressed to the current directory.
Method 2 to decompress a simple .gz file:
Use the zcat command, and then save the standard output to a file.
For example:
zcat pythontab.gz > pythontab.py
Of course, this solves the need to unzip to the specified directory.
zcat pythontab.gz > /home/test/aa/pythontab.py
The above is the decompression of .tar.gz and .gz files under Linux