Reputation: 41
hi i have a requirement like the following
|
|------bar/
|--file.pl
|---FILE1.FILE2.FILE3.TXT
|---FILE4.FILE5.FILE6.TXT
|
|---subdir1/
| |---file1_file2.log
| |---file2_file1.log
|
|---subdir2/
|---image1_image2.log
|---image2_image1.log
i am using the following command.
tar cvzf bar/ x.tar
and the output i am getting is as follows
|
|------bar/
|--file.pl
|---FILE1.FILE2.FILE3.TXT
|---FILE4.FILE5.FILE6.TXT
|
|---subdir1/
| |---file1_file2.log
| |---file2_file1.log
|
|---subdir2/
|---image1_image2.log
|---image2_image1.log
but i want the output like the following.i want to exclude .pl and i want only x.x.x.TXT and .LOG to be tar.
|
|------bar/
|
|---FILE1.FILE2.FILE3.TXT
|---FILE4.FILE5.FILE6.TXT
|
|---subdir1/
| |---file1_file2.log
| |---file2_file1.log
|
|---subdir2/
|---image1_image2.log
|---image2_image1.log
thanks in advance.
Upvotes: 0
Views: 67
Reputation: 1577
$ tar cvzf x.tar bar/ --exclude=*.pl
From man page:
--exclude=PATTERN
exclude files, given as a PATTERN
Upvotes: 2