Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 08-12-2006, 08:13 AM   #1
LQ Newbie
Registered: Feb 2006
Posts: 10

Rep: Reputation: 0
Help with tar of *.tgz

I need to untar a file called cst-022404.tgz

What is the best option to use here with the tar command?

Old 08-12-2006, 09:01 AM   #2
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390Reputation: 2390

tar -zxf cst-022404.tgz

The z switch is for unzipping before untarring (x).

Hope this helps.
Old 08-12-2006, 09:11 AM   #3
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 31
Well, the extract option is -x, and since it's gzipped, you'll need -z, so

tar -zxf cst-0220404.tgz
should suffice.

A lot of people always use -v (verbose) which IMO is stupid. Writing to the terminal is a couple of orders of magnitude slower than writing to a hard drive, so all -v does is slow the process down substantially. If you want to see what's in the file, then look at it with less, assuming you have a working, if not, then use the -t option:

tar -ztf cst-0220404.tgz | less
All this, and a lot more, is documented in the man page, which should generally be your first point of call for questions like this, though some man pages are better than others. GNU tar, like most gnu programs, also has an info manual, which is more complete than the man page.
Old 08-12-2006, 10:06 AM   #4
Senior Member
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
Just as an aside, .tgz files are _usually_ (this is to say not always) precompiled Slackware binaries which don't require untarring: a simple (as root) installpkg <tgz_filename_here> command would install it. But, like I said, usually, not always


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to INSTALL softwares with *.tar.gz or *.tar.tgz extension On SLACKWARE 10.2 DdOs Linux - Software 4 03-20-2006 02:54 AM
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 - General

All times are GMT -5. The time now is 06:11 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration