CentOS7可以通过yum命令安装支持zip的工具unzip,下面是安装和使用的方法。
安装unzip工具
- yum install -y unzip zip
使用unzip命令解压zip文件
- #解压到当前目录下
- unzip test.zip
-
- #使用 -d 参数解压到指定目录下
- unzip -d /files test.zip
如果目标文件夹已经存在同名的文件,可以加上 -o 参数选择覆盖
- unzip -o test.zip -d /tmp/
如果目标文件夹已经存在同名的文件,可以加上 -n 参数选择不覆盖
- unzip -n test.zip
- unzip -n -d /files test.zip
查看压缩包内容,但是不解压
- unzip -v test.zip
检查zip文件是否损坏
- unzip -t test.zip