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

Re: extracting tarball to a location other than ./



Bruno Hertz wrote:
Michael Marsh <michael.a.marsh@gmail.com> writes:


On Tue, 29 Mar 2005 07:20:52 -0500, Matt Price <matt.price@utoronto.ca> wrote:

ok, I give up -- how do I tell tar to extract a tarball to a location
other than ./ ?  I 've been through the info pages but didn't notie
the solution in any of the obvious places.

I usually cd to the destination directory and worry about the path to
the tarfile:
$ cd src
$ tar xvf ../downloads/tarfile.tgz


Another variation:
cat tarfile.tgz | (cd destdir; tar zxvf -)



The above method will not function as intended, if the destdir is not present. So I would go with

cat tarfile.tgz | (cd destdir && tar xzvf -)

raju



Reply to: