Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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… and – Cristian Ciupitu Sep 29 '09 at 15:50
up vote 12 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
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.


tar -xvf filename.tar

-v only for verbose mode.

share|improve this answer

Your Answer


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