ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

unzip解压失败

2019-04-24 16:52:11  阅读:521  来源: 互联网

标签:解压 unzip zip installing 失败 usr p7zip local


[root@localhost soft]# unzip QY.zip 
Archive:  QY.zip
  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 QY.zip or
        QY.zip.zip, and cannot find QY.zip.ZIP, period.

 

刚开始以为是压缩包文件部分信息丢失,导致解压出错了,不应该呀,怎么会出错呢,,emmmm,还是感觉不对劲,于是Google了下:

  1. 一般在linux下解压zip文件,直接用系统默认的extract here进行解压(默认使用的是 unzip)
  2. 如果压缩文件.zip是大于2G的,那unzip就无法使用了,这是由于C库中long类型数据所能表示的文件偏移在32位机子上只能有2G
  3. 所以如果要解压大文件,可以使用7zip来解压
  • 如果执行make命令时,提示安装g++的话,请执行 yum install gcc-c++

  • 出现 tar (child): bzip2: Cannot exec: No such file or directory,请安装yum install bzip2 -y

发现yum install p7zip -y 也可以安装    

./install.sh /usr/local/bin /usr/local/lib/p7zip /usr/local/man /usr/local/share/doc/p7zip 
- installing /usr/local/bin/7za
- installing /usr/local/man/man1/7z.1
- installing /usr/local/man/man1/7za.1
- installing /usr/local/man/man1/7zr.1
- installing /usr/local/share/doc/p7zip/README
- installing /usr/local/share/doc/p7zip/ChangeLog
- installing HTML help in /usr/local/share/doc/p7zip/DOC

7z命令的使用

解压缩7z文件

7za x test.zip -r -o./

参数含义:

  • x 代表解压缩文件,并且是按原始目录树解压(还有个参数 e 也是解压缩文件,但其会将所有文件都解压到根下,而不是自己原有的文件夹下)
  • test.zip 是当前目录下的压缩文件,这里用做测试文件
  • -r 表示递归解压缩所有的子文件夹
  • -o 是指定解压到的目录,-o后是没有空格的,直接接目录(-o./ 为当前目录)

压缩文件/文件夹

7za a -t7z -r test.7z /opt/test/*
  • 1

参数含义:

  • a 代表添加文件/文件夹到压缩包
  • -t 是指定压缩类型,这里定为7z,可不指定,因为7za默认压缩类型就是7z
  • -r 表示递归所有的子文件夹
  • test.7z 是压缩好后的压缩包名
  • /opt/test/* 是压缩目录

注意:7za不仅仅支持.7z压缩格式,还支持.zip.、tar、.bz2等压缩类型

标签:解压,unzip,zip,installing,失败,usr,p7zip,local
来源: https://www.cnblogs.com/kesz/p/10763187.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有