● zip命令
zip -r myfile.zip ./*
将当前目录下的所有文件和文件夹全部压缩成 myfile.zip
文件,-r
表示递归压缩子目录下所有文件
报错 : zip warning: name not matched
zip -r -y myfile.zip ./* # 加上 -y 参数
● unzip 命令
unzip -o -d /home/sunny myfile.zip
把 myfile.zip
文件解压到 /home/sunny/
-o
:不提示的情况下覆盖文件;-d
:-d /home/sunny
指明将文件解压缩到 /home/sunny
目录下;