Monday, June 21, 2010

How to specify destination for tar extraction

Specify a destination to extract a tar archive
It is very simple, say:
/root/file.tar.gz - gzipped tar archive file
/usr/local/tmp - destination location where above file needs to be extracted to.

command:
tar -xzf /root/file.tar.gz -C /usr/local/tmp

You might have already noticed '-C' option. This can be used to explicitly specify destination location if it is other than PWD.


No comments:

Post a Comment