[英]How can I unzip files in Linux when other files are present
I have files such as these 我有这样的文件
a1.tif
a2.tif
a1.zip
sa.zip
ff.zip
wqqq.zip
I am getting this 我得到这个
unzip /*zip
unzip: cannot find or open /*zip, /*zip.zip or /*zip.ZIP.
You are searching for anything in the root directory that ends with "zip". 您正在根目录中搜索以“ zip”结尾的任何内容。 Use
*.zip
for any file in the current directory ending in ".zip", or more explicitly use ./*.zip
, ./
being the current directory. 使用
*.zip
的任何文件在“.ZIP”结束当前目录,或者更明确地使用./*.zip
, ./
是当前目录。
That said, if you have more than one match it will pass all of them to the unzip
command with the first being interpreted as the archive file and the remaining matches as files to extract from the archive. 就是说,如果您有多个匹配项,它将把所有匹配项都传递给
unzip
命令,第一个被解释为存档文件,其余匹配项作为要从存档中提取的文件。 Avoid this by using find to pass each match to unzip
. 通过使用find将每个匹配项传递给
unzip
来避免这种情况。
find . -name '*.zip' -exec unzip {} \;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.