bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Wildcard in combination of "-C" option


From: Live user
Subject: Re: [Bug-tar] Wildcard in combination of "-C" option
Date: Sat, 10 Nov 2012 19:11:03 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2

On 10/11/2012 18:09, Alex Antener wrote:

I thought the option -C is meant to be used to exclude the folder path in the 
archive.


The -C option is to change the working dir of tar, but not of the shell (that is done with cd). When extracting, the shell's working dir is not involved, but does when you compress because the files/folders to be compressed are provided externally.

Try this:
tar -C  ~/foobar -cvf archive.tar `ls ~/foobar | grep '.sql$'`


You can replace ~/foobar by a variable if you want.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]