Extract tar.gz File

by on February 8, 2008 · 13 comments· last updated at December 8, 2008

Q. How do I extract tar.gz file under Linux / UNIX like operating systems?

A. tar.gz is nothing but compressed tar archive.

The tar program provides the ability to create tar archives, as well as various other kinds of manipulation. For example, you can use Tar on previously created archives to extract files, to store additional files, or to update or list files which were already stored.

Initially, tar archives were used to store files conveniently on magnetic tape. The name "Tar" comes from this use; it stands for tape archiver. Despite the utility's name, Tar can direct its output to available devices, files, or other programs (using pipes), it can even access remote devices or files (as archives).

Extract tr.gz. file

To extract one or more members from an archive, enter:
tar -zxvf {file.tar.gz}
If your tarball name is backup.tar.gz, enter the following at a shell prompt:
tar -zxvf backup.tar.gz

Extracting an Entire Archive

To extract an entire archive, specify the archive file name only, with no individual file names as arguments.
tar -zxvf backup.tar.gz



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 13 comments… read them below or add one }

1 anish December 11, 2008 at 10:10 am

use the followinf command:
tar -xvf

Reply

2 Kartik April 11, 2011 at 1:18 pm

Directory Checksum error.

Using on SunOS 2.6

Reply

3 Khupcom November 16, 2010 at 2:35 am

How to extract without screen output?

Reply

4 anon November 28, 2010 at 8:04 am

tar -zxf,
ie leave out ‘v’, it stands for verbose

Reply

5 william post January 26, 2011 at 3:54 pm

Cool!
I kept leaving the f (for file) out and tar would just sit there!

Reply

6 Andkon April 30, 2011 at 5:06 am

Great sharing. I really appreciate the idea you gave! Lots of thanks!

Reply

7 wupload June 27, 2011 at 12:01 pm

great share thnx man

Reply

8 Parasuraman P June 30, 2011 at 6:02 am

its very useful for linux user….thanks

Reply

9 M. K. Goenka October 14, 2011 at 5:05 am

when I am trying to tar a .tar.gz file using the all kind of command as ststed above it is showing that 1) tar: child returned status 1
2) tar: errors exit delayed from previous error
using centos 64 bit OS

Reply

10 Gangadhar January 20, 2012 at 12:53 pm

It is working in AIX if you give as tar -zxvf *.tar.gz (Actual Tar file)

Reply

11 ahmad March 21, 2012 at 8:00 pm

really a good post

Reply

12 iplixler October 25, 2012 at 11:12 am

I want to extract sysbench-0.4.12.5.tar.gz that i wget from SourceForge but got this error. Please help.

[root@cdn temp]# tar -zxvf sysbench-0.4.12.5.tar.gz
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

Reply

13 Surya Haris Senoaji January 14, 2013 at 4:01 pm

I have the same problem when trying to extract flashplayer 11 plugin, help please.. :’(

tar: install_flash_player_11_linux.x86_64.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Exiting with failure status due to previous errors

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , , ,

Previous Faq:

Next Faq: