Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-13-2002, 12:35 PM   #1
Registered: Dec 2002
Location: Tallahassee, Florida
Posts: 30

Rep: Reputation: 15
tar archives of type tgz

I have downloaded a file, and the instructions on using the material say to "unpack it in the usual way using tar". The file has an extension of .tgz and when I do "tar -xf file.tgz" it fails with messages "tar: this does not look like a tar archive" etc. What am I doing wrong?

Newbie John
Old 12-13-2002, 12:39 PM   #2
Senior Member
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 78
The file needs to be gunzipped first. try this:
tar -zxf your-file.tgz
The "z" flag uncompresses gzipped files. You would do the same to unzip/tar your-file.tar.gz

Like wise with:
tar -jxf your-file.tar.bz2
you can uncompress bzip2'd files.
Old 12-13-2002, 01:39 PM   #3
LQ Guru
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 68
To find out what any given file type is, and then determine your needs (for uncompressing in this situation) to work with the file, use the command 'file'. So:
file filename

And if 'filename' is a tar.gz file with the extensions removed, file will tell you exactly what it is, or appears to be.

Old 12-13-2002, 10:54 PM   #4
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Rep: Reputation: 30
A .tgz file is the same as a .tar.gz, the extension is just different.
You can unpack it by using tar -zxf filename, or if you want to see what it's doing use tar -zxvf filename.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I password tar.gz archives? Cyberian Linux - Security 11 10-20-2010 07:11 PM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 04:15 AM
tgz vs tar.bz2 Micro420 Mandriva 4 10-22-2003 11:19 PM
.rpms, .tar.gz, .tgz, .src.rpm, & .tar.bz2 whoots Mandriva 10 10-18-2003 01:08 PM
.tgz or .tar.gz c0c0deuz Linux - General 9 12-14-2001 11:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration