shell 在使用tar压缩时删除目录

aemubtdh  于 6个月前  发布在  Shell
关注(0)|答案(2)|浏览(81)

我有一个名为“A”的目录,其中包含许多名为“A”、“B”和“C”的目录。
我想在tar中不包含“C”,这样DIR. tar. gz就不包含目录“C”。
shell命令是什么?
谢谢,LinuxPenseur

6mw9ycah

6mw9ycah1#

根据您的命令行,类似于这样的内容:

tar -cf archive.tar --exclude C DIR

字符串
另外,为了挑剔你的问题,tar不执行压缩。

ioekq8ef

ioekq8ef2#

试试这个

tar --exclude="C" -czvf D.tar.gz DIR

字符串

相关问题