[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Wildcard in combination of "-C" option
From: |
Sergey Poznyakoff |
Subject: |
Re: [Bug-tar] Wildcard in combination of "-C" option |
Date: |
Sat, 10 Nov 2012 22:52:31 +0200 |
Alex Antener <address@hidden> ha escrit:
> ... which means, that the command
>
> > tar -C ~/foobar -czf foobar.tar.gz ~/foobar/*.sql
>
> works.
Sure it works, but there's no real sense in the -C option in this case.
> Do I really have to
>
> > cd ~/foobar
Not necessarily. The usual recipe is either
(cd ~/foobar; find -name '*.sql' -maxdepth 1 | tar czfT - -) > foobar.tar.gz
or
find ~/foobar -name '*.sql' -maxdepth 1 -printf "%f\n" | \
tar CczfT ~/foobar foobar.tar.gz -
Regards,
Sergey