最新下载
热门教程
- 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/】
相关文章
- 《1号会员店》关闭自动续费方法 01-29
- 《排球少年:新的征程》社团每日福利领取方法 01-29
- 《椿之歌》新手风属性队伍推荐 01-29
- 《最终幻想14:水晶世界》小小阿托莫斯宠物获得方法 01-29
- 《燕云十六声》醉拳客打法攻略 01-29
- 《异人之下》全货币获取方法汇总 01-29