-   Linux - Newbie (
-   -   problems decompressing *.tar.gz (

itpurt 11-01-2007 10:39 PM

problems decompressing *.tar.gz
I am having a problem decompressing a .tar.gz file

at the commandline I enter:

tar -xvvzf programs.tar.gz --> I got this command from multiple sites
in response i get:

Usage: tar {txruc@}[vfbFXhiBDEelmopwnq[0-7]] [-k size] [tapefile] [blocksize] [exclude-file] [-I include-file] files ...

what does thi mean? I am very confused. can someone tell me what is going on or tell me what i am doing wrong?


bigrigdriver 11-01-2007 10:57 PM

It may be the order of the parameters that's causing the problem.

Try tar -zxvvf programs.tar.gz.

itpurt 11-01-2007 11:00 PM


thanks for your response. I tried the command you suggested; unfortunately, it did not work. I got the following error:

tar: z: unknown option
Usage: tar {txruc@}[vfbFXhiBDEelmopwnq[0-7]] [-k size] [tapefile] [blocksize] [exclude-file] [-I include-file] files ...

bigrigdriver 11-01-2007 11:18 PM

I can't guess what version of tar you could be using that it doesn't recognize the -z option. So, try another variation:
tar --ungzip xvvf programs.tar.gz

itpurt 11-01-2007 11:24 PM

no, that does not work either.

bigrigdriver 11-01-2007 11:31 PM

Last thing I can think of to try: drop one of the v's.

tar --ungzip xvf programs.tar.gz

Many commands support the use of double v (vv). Maybe tar does; maybe tar does not.

jljohnsonx 11-06-2007 02:01 PM

When you want to extract the contents of a gzipped tar file, you have several choices. The first is to use gunzip followed by tar, like this:

gunzip programs.tar.gz
tar xvf programs.tar

Or you could do it all in one command, like this:

gunzip -c programs.tar.gz | tar xvf -

The -c flag tells gunzip to decompress the file, but instead of creating a something.tar file, it pipes the decompressed data directly to the tar command. The tar command on the right side of the pipeline looks a little strange, too--instead of a file name after the xvf, there's just a dash. The dash tells tar that the input is not an actual file on disk, but rather a stream of data from the pipeline. (Note that the gunzip input file is not deleted when you use the -c flag.)

Here's a third method of extracting the contents of a compressed tar file that's even easier. Remember the z flag with the tar command? You can use it to decompress and unbundle a tar file, like this:

tar xvzf programs.tar.gz

The end result is exactly the same (the files that were in the compressed tar file are now in your current directory), but this is much easier than issuing multiple commands or writing a messy-looking gunzip-tar pipeline.


All times are GMT -5. The time now is 03:29 AM.