Linux系统下压缩文件时过滤指定的文件 |Linux系统压缩指定文件代码

来源:互联网 发布:知乎女神王诺诺照片 编辑:程序博客网 时间:2024/04/27 13:42

进入要压缩的目录:
[root@iZ25c748tjqZ wechat]# cd /alidata1/htdocs/wechat/

查看目录:
[root@iZ25c748tjqZ wechat]# ll
total 24
drwxr-xr-x 2 root root 4096 Feb 23  2016 cert
drwxr-xr-x 2 root root 4096 Feb 23  2016 doc
drwxr-xr-x 3 root root 4096 Feb 23  2016 example
-rw-r--r-- 1 root root 2727 Nov 13  2015 index.php
drwxr-xr-x 3 root root 4096 Dec  7 09:20 lib
drwxr-xr-x 2 root root 4096 Feb 23  2016 logs
[root@iZ25c748tjqZ wechat]#

压缩并过滤文件:
[root@iZ25c748tjqZ wechat]# tar -zcvf ./wechat.tar.gz ./* --exclude=lib/data --exclude=doc


原文地址:http://www.whosmall.com

0 0
原创粉丝点击