[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解压失败可归结为是压缩格式不对

tar包压缩和tar解压失败有遇到的吗、???

 “tar czvf /mnt/etc-$(date +%F-%T).tar.zg   /etc/*”

这个没有错,可以解压

tar czvf /mnt/etc-$(date +%F-%T).tar.zg   /root/22/

tar czf 33/$(date +%F).tar.gz 22

tar czf 33/$(date +%T).tar.gz 22/

都会出现 压缩包可以完成,但是解压不行

出现报错 不能解压

unzip解压失败的更多相关文章

  1. unzip解压失败( cannot find zipfile directory)

    本文链接:https://blog.csdn.net/yori_chen/article/details/80493383[root@localhost soft]# unzip QY.zip Arc ...

  2. unzip解压3G或者4G以上文件失败的解决方法

    Linux下,使用unzip解压时,报错:End-of-central-directory signature not found.  Either this file is nota zipfile ...

  3. [转]unzip解压windows zip乱码的处理

    [转]unzip解压windows zip乱码的处理 http://blog.sina.com.cn/s/blog_6c9d65a101012gz0.html 朋友从windows传过来的zip文件, ...

  4. FTP下载导致Zip解压失败的原因

    情形:网关通过FTP下载快钱对账文件时通过Apache下commons-net的commons-net-3.5.jar进行封装,对账文件中有中文和英文的文字,大部分情况下能够下载成功,而且也能解压成功 ...

  5. Ubuntu 使用unzip解压乱码的问题

    由于win使用的是GBK编码,在win下打包zip的压缩文件在ubuntu下使用unzip解压会出现乱码的问题. 解决方案: 换软件,不用unzip,使用unar 18.04是默认安装的,如果没有默认 ...

  6. SSZipArchive解压失败的原因

    SSZipArchive 解压失败的原因是路径不对解压失败后,修正路径后再次解压就会出现解压失败的情况,代理方法也不会走也没有日志输出.解决方法就是删除手机上的软件再次运行就可以了.这个问题也就在内部 ...

  7. composer install 失败,无法用 unzip 解压归档、proc_open() 函数未支持

    前言 记得最近好像有不只一个朋友问过 composer install 安装依赖时出现异常,导致项目无法运行.下面简单记录一下其中 2 个比较频繁问题的解决办法. 问题 & 解决 1.unzi ...

  8. gunzip 和 unzip 解压文件到指定的目录

    Linux 常用的压缩命令有 gzip 和 zip,两种压缩包的结尾不同:zip 压缩的后文件是 *.zip ,而 gzip 压缩后的文件 *.gz  相应的解压缩命令则是 gunzip 和 unzi ...

  9. Linux unzip解压文件到某个目录下面

    1,例如我想解压Metinfo5.2.zip  到某一个文件夹下,执行下面的命令就可以了 sudo unzip  MetInfo5.2.zip  -d  metinfo-bak

随机推荐

  1. PaginatorSet

    from django.core.paginator import Paginator, EmptyPage class PaginatorSet: def __init__(self, limit= ...

  2. 【AGC 002F】Leftmost Ball

    Description Snuke loves colorful balls. He has a total of N*K balls, K in each of his favorite N col ...

  3. BCM芯片FP原理及相关SDK数据结构介绍

    BCM芯片有几个大的模块: VLAN.L2.L3和FP等几个,其中FP的使用也最为灵活,能解析匹配数据包文的前128字节比特级的内容,动作包括转发.丢弃.结合qos修改相应字段.分配vid.流镜像.流 ...

  4. MyEclipse打不开 报xxxxxx. log。

    1.找到MyEcliPse安装目录下configuration文件夹 打开 2.删除org.eclipse.update这个文件夹 3.再打开org.eclipse.osgi/.manager 4.删 ...

  5. 【汇编语言】Win10 安装 DOXBox0.74

    1.下载package包,有用的只有前两个. 2.解压 masm 压缩文件,我把它解压到D盘. 3.双击 图1 中的 DOXBox 0.74.exe 进行安装. 4.打开 DOXBox0.74 (参考 ...

  6. python3: 自动化测试框架pytest

    最近在学习web自动化,所以在这里总结一下pytest框架. 其实pytest 和 unittest 都是自动化测试框架,但是pytest更好用一些,有以下几个优点:1)可以根据标签执行用例:2)?? ...

  7. Ubuntu更新Python3及pip3

    https://blog.csdn.net/good_tang/article/details/85001211 根据这篇文章的作者给出的方法进行的操作,但是其中出了两个问题: 我在操作之后重开bas ...

  8. WPF实战之一 桌面消息框(右下角消息弹出框)

    此版本是根据别人的项目改造的,记录下笔记 原文:https://blog.csdn.net/catshitone/article/details/75089069 一.即时弹出 1.创建弹出框 新建一 ...

  9. C# 常用类型校验Validate

    using System.Text; using System.Text.RegularExpressions; namespace 落地页测试代码 { public class Validate { ...

  10. 初识C语言(五)

    自定义函数 C语言提供了大量的库函数(右侧资料下载中有),比如stdio.h提供输出函数,但是还是满足不了我们开发中的一些逻辑,所以这个时候需要自己定义函数,自定义函数的一般形式: 注意: 1.[]包 ...