一、打包压缩
例子:把文件夹打包压缩xx.zip文件,并指定放到/www/wwwroot//中
zip -r /www/wwwroot//xx.zip /www/wwwroot/
1.打包压缩文件夹
2.打包压缩成为xx.zip文件
3.打包的文件放到/www/wwwroot//下
1.1 打包文件路径
二、压缩
例子:把xx.zip文件解压到/www/wwwroot//100/中
unzip /www/wwwroot//xx.zip -d /www/wwwroot//100/
1.解压到/www/wwwroot//100/中
2.指定解压xx.zip文件
例子1:
打包压缩zip -r /www/wwwroot//xx.zip /
解压unzip /www/wwwroot//xx.zip -d /www/wwwroot//100/
例子2:(推荐)
1.先进根目录/www/wwwroot/
cd /www/wwwroot/
2.打包根目录/www/wwwroot/下文件夹,然后把打包文件xx.zip放到根目录/www/wwwroot/下
zip -r /www/wwwroot/xx.zip /
3.解压到根目录/www/wwwroot/下
unzip /www/wwwroot/xx.zip -d /www/wwwroot/