使用 tar 压缩时排除目录
我有一个目录“DIR”,其中包含很多目录“A”、“B”和“C”,
我想 tar DIR 而不包含“C”,这样 DIR.tar.gz 就不包含目录“ C”。
执行此操作的 shell 命令是什么?
谢谢, Linux彭瑟尔
I have a directory say "DIR" which contains so many directories say "A", "B" and "C"
I want to tar DIR without including "C" in it so that DIR.tar.gz does not contain the directory "C".
What is the shell command for this?
Thanks,
LinuxPenseur
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您的命令行,如下所示:
另外,为了挑剔您的问题,tar 不执行压缩。
Depending on your command line, something like this:
Also, to nitpick your question, tar does not perform compression.
试试这个
Try this