Reminder: Extracting a TAR file to a different location

by Cacho on 2011.02.16

Here’s how to extract a TAR file to a different location:

$ tar -C /usr/local/apache2/htdocs/ -xvf /home/mytarfile.tar

Explanation:

-C is the option to specify where to extract your TAR file.

/usr/local/apache2/htdocs/ is the specified path where to extract your TAR file.

-xvf are the options used to extract the TAR file

/home/mytarfile.tar is the tar file itself.

Disclaimer: The options i use are based on how the file was TAR-ed. In this case, it was:

$ tar -cvf mytarfile.tar *

Leave a Comment

Previous post: