Linux下tar命令exclude选项排除指定文件或目录

打包所有

tar -zcf test.tar.gz test

排除后缀

tar -zcf test.tar.gz test --exclude *.jpg

排除jpg后缀的文件,包括子目录!

排除多个后缀

tar -zcf test.tar.gz test --exclude *.txt --exclude *.jpg

排除指定文件

tar -zcf test.tar.gz test --exclude a.txt

排除指定目录

tar -zcf test.tar.gz test --exclude subdir

组合排除

tar -zcf test.tar.gz test --exclude subdir --exclude a.log --exclude *.jpg
上一篇 shell脚本报错:/bin/bash^M bad interpreter No such file or directory
下一篇 yum No package xxx available
目录
文章列表
1 Spring Cloud Zuul 路由自动刷新原理
Spring Cloud Zuul 路由自动刷新原理
2
Win64安装MySQL-python
Win64安装MySQL-python
3
React Native学习之WebView组件
React Native学习之WebView组件
4
url参数和map之间的转换
url参数和map之间的转换
5
MyBatis 报错 No bean named org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry
MyBatis 报错 No bean named org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。