假设当前目录下有多个zip文件
data.zip invoices.zip pictures.zip visit.zip,
直接
unzip *.zip
等价于
unzip data.zip invoices.zip pictures.zip
会报错
Archive: data.zip
caution: filename not matched: invoices.zip
caution: filename not matched: pictures.zip
caution: filename not matched: visit.zip
因为会认为后面三个zip文件是在第一个zip文件里面的,因此需要
unzip '.zip’
或者
unzip ".zip"
或者
unzip *.zip
来屏蔽掉linux的通配符(man可以看到Be sure to quote any character that might otherwise be interpreted or modified by the operating system, particularly under Unix and VMS.)
或者
for z in *.zip; do unzip $z; done
refer:
- https://www.cyberciti.biz/faq/linux-unix-shell-unzipping-many-zip-files/
- https://askubuntu.com/questions/564607/unzip-multiple-files