linux tar打包压缩排除某个目录或文件

论坛 期权论坛 脚本     
匿名技术用户   2020-12-22 05:19   60   0

命令格式如下:

tar -zcvf hello.tar.gz 要打包的目录 --exclude=dir1 --exclude=file1 ......

tar -zcvf hello.tar.gz ./hello --exclude=file1 --exclude=dir1

注意:

1、--exclude=file1 而不是 --exclude file1

2、要排除一个目录是 --exclude=dir1,而不是 --exclude=dir1/

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP