Extract tar.gz File

by Vivek Gite on February 8, 2008 · 10 comments

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

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 10 comments… read them below or add one }

1 anish December 11, 2008

use the followinf command:
tar -xvf

Reply

2 Kartik April 11, 2011

Directory Checksum error.

Using on SunOS 2.6

Reply

3 Khupcom November 16, 2010

How to extract without screen output?

Reply

4 anon November 28, 2010

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

Reply

5 william post January 26, 2011

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

Reply

6 Andkon April 30, 2011

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

Reply

7 wupload June 27, 2011

great share thnx man

Reply

8 Parasuraman P June 30, 2011

its very useful for linux user….thanks

Reply

9 M. K. Goenka October 14, 2011

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

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

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 2 + 13 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.




Previous post:

Next post: