centos zip压缩,排除某个目录命令:
ZIP使用进行压缩时,部分资源文件需要排除一下,命令为:
注意:"“这个是关键,没有加”",将不起作用。
1.普通压缩
➜ /Users/imac/rrd>zip -r report_job.zip report_job➜ /Users/imac/rrd> ll -h report_job.zip-rw-r--r-- 1 imac staff 298M Sep 1 17:24 report_job.zip2发现.git文件占用大量空间
➜ /Users/imac/rrd/report_job> git:(master) ✗ du -h -d 1 42M ./report_framework279M ./.git 56K ./.idea322M .3排除.git目录
zip -r report_job.zip report_job -x "