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开发者_如何学C.gz does not contain the directory "C".
What is the shell command for this?
Thanks, LinuxPenseur
Depending on your command line, something like this:
tar -cf archive.tar --exclude C DIR
Also, to nitpick your question, tar does not perform compression.
Try this
tar --exclude="C" -czvf D.tar.gz DIR
精彩评论