LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Help with tar of *.tgz (https://www.linuxquestions.org/questions/linux-general-1/help-with-tar-of-%2A-tgz-473221/)

humayun 08-12-2006 07:13 AM

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.

druuna 08-12-2006 08:01 AM

Hi,

tar -zxf cst-022404.tgz

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

Hope this helps.

ioerror 08-12-2006 08:11 AM

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.

pwc101 08-12-2006 09:06 AM

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 :)


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