mahmood
mahmood

Reputation: 24795

excluding some folders in tar command not work

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?

Upvotes: 3

Views: 1524

Answers (1)

Farhan
Farhan

Reputation: 684

The correct command would be:

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

Upvotes: 4

Related Questions