我使用名为test.war的7za命令创建了这个文件
# file test.war
test.war: 7-zip archive data, version 0.4我试图在另一台RHEL机器中使用命令解压缩该文件:
# unzip test.war
Archive: test.war
End-of-central-directory signature not found. Either this file is not
a zipfile, or it constitutes one disk of a multi-part archive. In the
latter case the central directory and zipfile comment will be found on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of test.war or
test.war.zip, and cannot find test.war.ZIP, period.这是否意味着我无法解压缩使用7zip创建的文件?
发布于 2016-11-13 13:25:28
在这种情况下,不行,您不能使用unzip解压缩文件;您需要使用7za来解压缩它。
默认情况下,7za创建7z格式档案。它还可以创建压缩格式的存档,可以使用unzip提取;为此,可以指定带有.zip扩展的归档,也可以使用-tzip指定类型:
7za a -tzip test.war ...这将产生一个test.war文件,该文件可以用unzip提取。
注意,如果您正在创建一个JavaEE WAR文件,您应该无论如何使用jar工具(或者为您的构建工具提供适当的插件),而不是使用zip或7za。
发布于 2016-11-13 11:34:33
这个问题(和评论)提到了两种类型的程序:
通常,后面的归档器/压缩器可以解压缩/解压缩旧工具编写的文件。例如,编写信息邮编 (zip/unzip)是为了处理由pkzip (MS实用程序)创建的文件。7zip是另一个更晚的归档程序,它可以处理由info-zip创建的文件。
gzip (GNU)是一个压缩器,与上面提到的任何一个工具无关.虽然它与info-zip的编写时间大致相同,但它的编写是为了取代压缩和解压 (Unix实用程序)。最后这些是标准的Unix实用程序;其他的都没有标准化。
https://unix.stackexchange.com/questions/322936
复制相似问题