unzip 批量解压多个文件+End-of-central-directory signature not found

简介: #find . -name ‘*.zip’ -exec unzip {} \; 2. #ls *.zip | xargs -n1 unzip 3. # for i in * do unzip $i done unzip批量解压到指定目录下 在yyy目录下有很多.zip文件,里面有个xxx目录,要把.zip文件以本身文件名建一个目录 解压到xxx目录下。

#find . -name ‘*.zip’ -exec unzip {} \;

2.
#ls *.zip | xargs -n1 unzip

3.
# for i in *
do
unzip $i
done


unzip批量解压到指定目录下

在yyy目录下有很多.zip文件,里面有个xxx目录,要把.zip文件以本身文件名建一个目录 解压到xxx目录下。shell脚本如下

for file in *.zip
do
filename=$(echo $file|cut -d'.' -f1)
unzip $file -d xxx/$filename
done

自己记录下。主要用到字符串变量处理,一开始想到,没想到用sed cut grep awk等。。

配合着资料。终于 成功了!



  Linux 下,使用unzip解压时,报错:

unzip trunk.zip

Archive:  trunk.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 trunk.zip or
        trunk.zip.zip, and cannot find trunk.zip.ZIP, period.

  文件大小为 2.2G,可能是 unzip 设置了这个限制吧。在网上查到要用 jar 来解

jar xvf trunk.zip

  如果出现

jar:Command not found

  要用yum下载

yum -y install java-1.6.0-openjdk-devel

再次运行

jar xvf trunk.zip

就能成功,看来,unzip局限蛮大的呀。


  Linux 下,使用unzip解压时,报错:

unzip trunk.zip

Archive:  trunk.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 trunk.zip or
        trunk.zip.zip, and cannot find trunk.zip.ZIP, period.

  文件大小为 2.2G,可能是 unzip 设置了这个限制吧。在网上查到要用 jar 来解

jar xvf trunk.zip

  如果出现

jar:Command not found

  要用yum下载

yum -y install java-1.6.0-openjdk-devel

再次运行

jar xvf trunk.zip

就能成功,看来,unzip局限蛮大的呀。

相关文章
CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake
CMake Error: The source “xxx“ does not match the source “yyy“ used to generate cache. Re-run cmake
1002 0
|
5月前
|
数据安全/隐私保护 Python
Python 解压还密码的压缩文件 LookupError: Couldn't find path to unrar library.
Python 解压还密码的压缩文件 LookupError: Couldn't find path to unrar library.
82 2
|
5月前
|
iOS开发
解决Error (Xcode): File not found:XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a
解决Error (Xcode): File not found:XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a
69 0
|
Java Linux
Linux使用解压命令unzip报错:unzip: cannot find zipfile directory in one of xxx.zip
在linux服务器下使用rz上传压缩文件,用unzip命令解压zip包
1299 0
tar解压出错:gzip: stdin: unexpected end of file的解决
tar解压出错:gzip: stdin: unexpected end of file的解决
|
缓存 PHP
Composer报错: Failed to execute (9) unzip -qq -o “D:\Code/vendor/composer/tmp-d44ec330d383e320b9a78bfc
Composer报错: Failed to execute (9) unzip -qq -o “D:\Code/vendor/composer/tmp-d44ec330d383e320b9a78bfc
218 0
Composer报错: Failed to execute (9) unzip -qq -o “D:\Code/vendor/composer/tmp-d44ec330d383e320b9a78bfc
CentOS cp 复制隐藏文件提示 cp: cannot stat ?.xxx*?. No such file or directory
执行的命令与错误信息: # cp -a /etc/skel/* /home/postgrescp: cannot stat ?.etc/skel/*?. No such file or directory 使用cp复制普通文件时,可以使用 * 号通配符,而在复制隐藏文件时,需要使用.
4707 0
|
Linux Windows
SVN更新被Locked,Can't open file 'folder/.svn/tmp/text-base/file.svn-base'
SVN更新被Locked,Can't open file 'folder/.svn/tmp/text-base/file.svn-base'
179 0
SVN更新被Locked,Can't open file 'folder/.svn/tmp/text-base/file.svn-base'
|
Linux C语言
安装 paddleocr 报错 gcc: error trying to exec ‘cc1‘: execvp: 没有那个文件或目录
安装 paddleocr 报错 gcc: error trying to exec ‘cc1‘: execvp: 没有那个文件或目录
910 0
|
运维
yum update 执行报错: error : unpacking of archive failed on file /usr/.../...;5d26ff7c: cpio : symlink
yum update 执行报错: error : unpacking of archive failed on file /usr/.../...;5d26ff7c: cpio : symlink早前已发现有台机一直在报这么个错误, 一用yum update 就报一堆: Error: unpacking rpm package .
2416 0