Answered by the Webhosting Experts

How to use tar command on linux server?

“Untar” a file
If you are working with example.tar file, you can extract the files from it using:

 

tar xvf example.tar

 

If you are working with gzipped(example.tar.gz), you can extract the files from it using:

 

tar xvfz example.tar.gz

 

If you have example.tgz, you can extract the files from it using:

 

tar xzvf example.tgz

If the tarball has been compressed with bzip2(example.tar.bz2), then you will need to

have bzip2 installed. (If all is well and bzip2 is installed, you can extract the files from it

using:
tar yxf example.tar.bz2

Sometimes you only want to extract certain directories from the tarball.

An example of doing so would be:

tar xvzf example.tar.gz */DIRECTORY_YOU_WANT_REPLACES_THIS_TEXT/*

 

If you would like to see what is inside a tarball, you can use the command:

tar tvf example.tar

 

If you would like to see what is inside a gzip’d tarball, you can use the command:

tar tzf example.tar.gz

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: support@hivelocity.net. We are also available to you through our phone and live chat system 24/7/365.