Jason Koo

      Stay hungry, Stay foolish!

导航

Tar Extract To Destination Folder

Posted on 2014-04-04 10:00  Jason Koo  阅读(753)  评论(0编辑  收藏  举报

Tar can redirect extracted files to a different folder. This can be handy if you want to unpack a tar archive stored on a cd or other read-only media and want to eliminate the step of first copying the archive, extracting it, then deleting the extra tar.  All you have to do is add a ‘-C ’ to the tar command.   So here’s an example using the VMware Tools tarball:

# tar -C /root -zxvf /media/cdrom0/VMwareTools-8.3.2-257589.tar.gz

or
# tar -zxvf /media/cdrom0/VMwareTools-8.3.2-257589.tar.gz  -C /root

This will redirect the extracted files into the /root folder. simple