excluding some folders in tar command not work

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 16:10:46

问题


I run this command to compress the content of current folder while excluding some directories:

mahmood@mpc:set3-HHLL$ l
file1.txt    a/     c/
file2.inp    b/     ...
mahmood@mpc:set3-HHLL$ tar cvjf ../set3.tar.bz2 * --exclude=a/ --exclude=b/ --exclude=c/

However in the output I see:

file1.txt
file2.inp
a/1.out
a/2.out
2/1.out
...

Why it ignores the command line options?


回答1:


The correct command would be:

tar cvjf ../set3.tar.bz2 * --exclude='a' --exclude='b' --exclude='c'


来源:https://stackoverflow.com/questions/8020690/excluding-some-folders-in-tar-command-not-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!