最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
linux中tar压缩时排除某些目录或文件
时间:2022-11-14 22:07:55 编辑:袖梨 来源:一聚教程网
在对某个目录进行压缩的时候,有时候想排除掉某个目录,示例如下:
比如文件目录包含以下文件及目录
代码如下 | 复制代码 |
api api/addons api/connect api/connect/connect.php api/google api/remote api/remote/mod |
我们要压缩不包含google文件夹、connect/connect.php以及remote下mod文件夹
代码如下 | 复制代码 |
tar -zcvf mytest.tar.gz api --exclude=google --exclude=connect/connect.php --exclude=remote/mod |
【注意:1、--exclude=file1 而不是 --exclude file1 2、要排除一个目录是--exclude=dir1而不是--exclude=dir1/】
相关文章
- 《魔兽世界》缴械行动任务完成方法 04-27
- 《重装岚影》特色内容介绍 04-27
- 《崩坏星穹铁道》新手0氛开服必养角色推荐 04-27
- 《魔兽世界》吃鸡模式最厉害技能介绍 04-27
- 《百英雄传》莫罗乌斯位置介绍 04-27
- 《csgo》玉麒麟个人简介介绍 04-27