Extract a gzip compressed tar archive in Linux
The version of tar in most Linux distributions supports gzip compression. This means that a gzipped tar file can be extracted in one simple command.
To extract the archive filename.tar.gz into the current directory:
tar xzf filename.tar.gz
If this fails, the version of tar may not support gzip compression. In this case, you can use the traditional two-stage command:
gzip -dc filename.tar.gz | tar xf -











santhosh said on June 4, 2009
i got the following error when i extracted.
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors.
Plz suggest any way to extract in linux?
Anonymous said on September 2, 2009
santhosh are you sure its not a bzip not gzip
Anonymous said on November 27, 2009
Sorry Bozzzzzzzz! it won’t worked for me
sikat ang pinoy said on January 13, 2010
It won’t work for me I think gunzip is another option to unzip gzip file.
Bubu said on August 18, 2010
good stuff
Rahul B said on January 7, 2011
gunzip file.tar.gz
it will give file.tar
then type command tar -xvf
Rahulbiliye said on January 7, 2011
gunzip file.tar.gz
u get file.tar
tar -xvf file.tar
Thiyagarajan Veluchamy said on January 27, 2011
Thanks
S_raparty said on May 16, 2011
Good thanx RahulÂ
Pete said on August 31, 2011
one liner
tar -zxvf file.tar.gz
extracts all to current dir