LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 08-12-2006, 08:13 AM   #1
humayun
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?

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

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

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
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

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

Code:
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 lesspipe.sh, if not, then use the -t option:

Code:
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
pwc101
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
 
  


Reply


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


All times are GMT -5. The time now is 08:06 AM.

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