Recently studied shell programming, need to download some. tar.gz files, but often encountered decompression failure situation:
[Email protected] ~]# TAR-JXVF tcl8.4.16-src.tar.gz bzip2: (stdin) is not a bzip2 File.tar:Child returned status 2tar: Error isn't recoverable:exiting now
Today, we have studied carefully how to solve this problem:
1. What is the real property of the file?
[Email protected] ~]# TAR-ZXVF tcl8.4.16-src.tar.gz gzip:stdin:not in gzip formattar:child returned status 1tar:erro R is not recoverable:exiting Now[[email protected] ~]# file tcl8.4.16-src.tar.gz tcl8.4.16-src.tar.gz:html Document text
I race, unexpectedly is HTML, this time finally know is why.
The reasons are as follows:
File download link is not directly to the file, but first point to a page, in this page is the real download link, so on the previous page to save the file directly, actually saved is a page.
If the property is an BZ file, use the BZ file decompression method.
Add the File command:
With the file directive, we were able to identify the type of the document.
-B The file name is not displayed when the identification results are listed.
-C Displays the instruction execution process in detail to facilitate troubleshooting or analysis of the execution of the program.
-f< name File > Specify a name file with the contents of one or more file names, let file identify these files sequentially, in the format of one file name per column.
-L Displays the category of the file that the symbolic connection points to directly.
-m< Magic Digital File > Specify Magic Digital file.
-V Displays version information.
-Z try to interpret the contents of the compressed file.
2. Re-get the tar package path, first open with the browser, from the pop-up Save dialog box to get the download link
This time it's perfect!
Unzip. tar.gz error Gzip:stdin:not in gzip format tar:/child returned status 1 Tar:error are not recoverable:exiting now