Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using a Sun Sparc System, aka Solaris. I have a .tar.gz file, and I can't figure out how to untar it. The command I usually use doesn't work:

tar -xzvf file.tar.gz

Anybody know how to do this? I can't be an answer anywhere!

share|improve this question
1  
Btw you should take note that "Solaris tar is sometimes broken (i.e. can't deal with long directory names etc.)". For more details see bytes.com/topic/python/answers/… and python.org/download/releases/2.4.2/bugs –  Cristian Ciupitu Sep 29 '09 at 15:50

2 Answers 2

up vote 11 down vote accepted

You have to gunzip then untar on Solaris. It should come with GNU tar:

gtar xzvf somefile.tar.gz

if that doesn't work:

gunzip -c somefile.tar.gz |tar xvf -
share|improve this answer
    
Doesn't the z option enable gzip anyway? –  grawity Sep 29 '09 at 13:20
1  
it should gunzip and untar in one. –  John T Sep 29 '09 at 13:47
    
It does with GNU tar, but the tar that comes with Solaris is not GNU tar and doesn't support that option. –  wfaulk Sep 29 '09 at 18:38
    
GNU tar comes with the freeware packages to install on Solaris –  John T Sep 29 '09 at 20:42
    
You kids - you've been spoilt with those new-fangled GNU commands! (I tend to do "gzip -dc filename | tar tf -" as an automatic thing, whatever platform, even when it does have a gnu-tar available. After all, even if your tar understands gzip, it might not understand bzip2, 7za, etc...) –  jrg Oct 7 '09 at 16:51

For .bzip2 files I used the following procedure:

bunzip2 filename.tar.bz2

This will remove the bz2 extension.

Then

tar -xvf filename.tar

-v only for verbose mode.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.