Thanks! I just wanted to get rid of the ~/foobar folder not to be included into the archive, whereas the -C option does not make sense here. - Understood.
Have a good day, Sir On 11/10/2012 09:52 PM, Sergey Poznyakoff wrote: > Alex Antener <l...@lix.cc> 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
signature.asc
Description: OpenPGP digital signature