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

  • 59 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

Can I use my domain name or must I use my IP address as the hostname for FTP?

Using your IP address (192.168.22.22  is an example IP address) is the preferred entry for...

Can you transfer my sites from my current host to my new VPS?

Yes. We will transfer all of your sites free* of charge and will assure that you experience no or...

Do you allow MP3 files? Do you allow streaming of videos?

Yes we do with our special plans at http://hostripples.in/avs-hosting.php

Do you support Cold Fusion?

We do not support or Cold Fusion on our shared hosting servers, however you are more than welcome...