How to untar .tar.gz when you don't have "-z" option?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > How to untar .tar.gz when you don't have "-z" option?




Pages (5): [1] 2 3 4 5 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to untar .tar.gz when you don't have "-z" option?  
phillip.s.powell@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 08:49 PM

I have TAR files compressed with gzip option "-z" that I must
uncompress on a different remote system that does not have the gzip
option with "tar -xvf".  How do I uncompress without "-z"? I am not
given the luxury of reconfiguring the remote system to do anything
about this (it's a FreeBSD Unix platform).

Thanx
Phil






[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
Willem


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 08:49 PM

phillip.s.powell@gmail.com wrote:
) I have TAR files compressed with gzip option "-z" that I must
) uncompress on a different remote system that does not have the gzip
) option with "tar -xvf".  How do I uncompress without "-z"? I am not
) given the luxury of reconfiguring the remote system to do anything
) about this (it's a FreeBSD Unix platform).

gunzip -c <file.tar.gz> | tar -xvf -

If you don't have gunzip (or gzip -d) installed, you're basically screwed.

HTH, HAND.


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT





[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
Dave Hinz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 08:49 PM

On 24 Oct 2005 13:25:59 -0700, phillip.s.powell@gmail.com <phillip.s.powell@gmail.com> wrote
:
> I have TAR files compressed with gzip option "-z" that I must
> uncompress on a different remote system that does not have the gzip
> option with "tar -xvf".  How do I uncompress without "-z"? I am not
> given the luxury of reconfiguring the remote system to do anything
> about this (it's a FreeBSD Unix platform).

A FreeBSD system without gzip?  Are you sure it's not there?  Could it
just not be in your path?

But, if it's really not there, then your only choice is to unzip it on a
system that does have gzip.

Dave Hinz






[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
Doug Freyburger


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 10:48 PM

Willem wrote:
> phillip.s.powell@gmail.com wrote:
>
> ) I have TAR files compressed with gzip option "-z" that I must
> ) uncompress on a different remote system that does not have the gzip
> ) option with "tar -xvf".  How do I uncompress without "-z"? I am not
> ) given the luxury of reconfiguring the remote system to do anything
> ) about this (it's a FreeBSD Unix platform).
>
>    gunzip -c <file.tar.gz> | tar -xvf -
>
> If you don't have gunzip (or gzip -d) installed, you're basically screwed.

Nah, the file had to be transferred from the source host
to the target host somehow.  If the target host lacks
gunzip, the source host had a -z option in tar and will
therefore had gzip and/or gunzip available.

ftp/scp/whatever file.tar.gz
zcat file.tar.gz | tar -xvf -

or

gzip -u file.tar.gz
ftp/scp/whatever file.tar
tar -xvf file.tar






[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
Keith Thompson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 10:48 PM

phillip.s.powell@gmail.com writes:
> I have TAR files compressed with gzip option "-z" that I must
> uncompress on a different remote system that does not have the gzip
> option with "tar -xvf".  How do I uncompress without "-z"? I am not
> given the luxury of reconfiguring the remote system to do anything
> about this (it's a FreeBSD Unix platform).

It almost sounds like you're talking about a "-z" option to the gzip
program, but I'm sure you're referring to tar's "-z" option that
causes it to invoke gzip.

As long as you have tar and gzip commands, it's easy enough to invoke
them yourself, eg., "gzip -d < foo.tar.gz | tar xvf -".

Or you can install GNU tar.  The latest version recognizes gzipped
tarballs automatically, so you don't even need to use the 'z' option
explicitly.  This doesn't require reconfiguring the remote system; you
can just build and install it somwehere under your home directory.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.





[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
jpd


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-24-05 10:48 PM

Begin  <lnbr1ebojs.fsf@nuthaus.mib.org>
On 2005-10-24, Keith Thompson <kst-u@mib.org> wrote:
> phillip.s.powell@gmail.com writes: 
^^^^^^^
[vbcol=seagreen]
> As long as you have tar and gzip commands, it's easy enough to invoke
> them yourself, eg., "gzip -d < foo.tar.gz | tar xvf -".

FreeBSD comes with both g(un)zip and tar in the base system.


> Or you can install GNU tar.

FreeBSD has gnu tar available in the base system as tar (4.*) or gtar
(5.*). The bsdtar that is `tar' on FreeBSD 5.* ignores -z on extraction
or test because it automatically recognizes compression anyway.


The only reason I can think of right now why OP would not be able to use
tar is because he's in a jail(8) and tar didn't get installed. In which
case it is probably a good idea to talk to the admin and ask for tar to
be copied as well.


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .





[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
Michal Jaegermann


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-05 10:54 PM

In comp.compression Willem <willem@stack.nl> wrote:
> phillip.s.powell@gmail.com wrote:
> ) I have TAR files compressed with gzip option "-z" that I must
> ) uncompress on a different remote system that does not have the gzip
> ) option with "tar -xvf".  How do I uncompress without "-z"? I am not
> ) given the luxury of reconfiguring the remote system to do anything
> ) about this
>
>   gunzip -c <file.tar.gz> | tar -xvf -
>
> If you don't have gunzip (or gzip -d) installed, you're basically screwed.

Well, not necessary.

gunzip < file.tar.gz | ssh remote.system "cd $target_dir && tar x"

> (it's a FreeBSD Unix platform).

Sounds extremely unlikely that you are really missing required tools.

M.





[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
phillip.s.powell@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-05 11:02 PM

Sorry, not an option in this case.  It has to be packaged up and sent
to a system that doesn't have "tar -z" option (although it does have
gzip/gunzip though)

Phil






[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
phillip.s.powell@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-05 11:02 PM

I can't do that, this is a remote hosting platform and the admin will
not install anything on the base system for any of his clients.

Phil






[ Post a follow-up to this message ]



    Re: How to untar .tar.gz when you don't have "-z" option?  
phillip.s.powell@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-05 11:02 PM

Basically I have to set it up so that the source and destination may,
or may not, have "g[un]zip" capabilities since this is a portable web
application and thus, the packager has to be equally portable (note
that it's a UNIX-only packager for now, will have to create a Windows
version whenever I feel like it).

An engineering co-worker helped stumble me onto this option:

blah=`which gunzip | grep -E 'no gunzip'`
# LOOK FOR STRING CONTENT IN $blah - IF IT HAS CONTENT, NO GUNZIP,
ELSE, GUNZIP

Phil






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:08 PM.      Post New Thread    Post A Reply      
Pages (5): [1] 2 3 4 5 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register