我从客户端收到一个巨大的.tar.gz文件,其中包含约800 mb的图像文件(未压缩时)。我们托管公司的ftp速度非常慢,因此在本地提取所有文件并通过ftp发送它们是不切实际的。我可以将.tar.gz文件通过ftp传输到我们的托管站点,但是当我SSH进入目录并尝试使用解压缩时,它给了我这个错误:
[esthers@clients locations]$ unzip community_images.tar.gz
Archive: community_images.tar.gz
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.
note: community_images.tar.gz may be a plain executable, not an archive
unzip: cannot find zipfile directory in one of community_images.tar.gz or community_images.tar.gz.zip, and cannot find community_images.tar.gz.ZIP, period.
我需要使用什么命令来提取.tar.gz文件中的所有文件?
键入man tar
以获取更多信息,但是此命令可以解决问题:
tar -xvzf community_images.tar.gz
另外,要提取到特定目录中
例如 将档案解压缩到自定义my_images
目录中。
tar -xvzf community_images.tar.gz -C my_images
为了进一步解释,将tar
所有文件收集到一个包中community_images.tar
。gzip程序应用了压缩,因此进行了gz
扩展。因此,该命令可以执行以下操作:
f
:这必须是命令的最后一个标志,而焦油˚F ILE后必须立即进行。它告诉tar压缩文件的名称和路径。z
:告诉tar使用g z ip解压缩档案x
:焦油可以收集文件或E X道他们。x
后者。v
:使tar说话很多。V erbose你正在提取所有文件输出显示。C
:装置Ç焊割到目录DIR
。在我们的示例中,DIR
是my_images
。本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句