tar命令解压.zip文件出错:gzip: stdin has more than one entry--rest ignored

今天用 tar 命令解压 .zip 文件报错:

gzip: stdin has more than one entry--rest ignored

tar: Child returned status 2

tar: Error is not recoverable: exiting now

因为tar命令调用了gzip,而gzip并不是可以解压所有文件的,有如下一段话:

Files created by zip can be uncompressed by gzip only if they have a single member compressed with the 'deflation' method.

后来用以下命令解决:(unzip命令,-d指定输出目录)


将压缩文件text.zip在当前目录下解压缩。

unzip test.zip

将压缩文件text.zip在指定目录/tmp下解压缩,如果已有相同的文件存在,要求unzip命令不覆盖原先的文件。

unzip -n test.zip -d /tmp

查看压缩文件目录,但不解压。

unzip -v test.zip

将压缩文件test.zip在指定目录/tmp下解压缩,如果已有相同的文件存在,要求unzip命令覆盖原先的文件。

unzip -o test.zip -d tmp/

你可能感兴趣的:(tar命令解压.zip文件出错:gzip: stdin has more than one entry--rest ignored)