50

I need to unzip a compressed file on the fly in my program. It works when I try it on my own linux computer, but for some reason the school computers fail whenever I tell them to do it. To unzip I'm using the following command:

 zcat /file/address/file.tar.gz

and get the error:

 /file/address/file.tar.gz.Z: No such file or directory

I tried looking through the documentation but couldn't find a flag to turn off this odd behavior.

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Zain Rizvi
  • 23,586
  • 22
  • 91
  • 133

5 Answers5

90

Your school's system still has the old "compress" style utilities rather than the newer GNU "gzip" based ones.

You need to use gzcat rather than zcat, assuming that it's available.

Alnitak
  • 334,560
  • 70
  • 407
  • 495
  • 1
    That did the trick, thanks. Also, I just learned that I was running the command on the school's Sun computers. It's the linux pc's that my program needs to run on and they support zcat just fine. – Zain Rizvi Nov 17 '08 at 20:23
6

I generally just use gzip directly when I want to gzip:

gzip -dc /file/address/file.tar.gz
Dustin
  • 89,080
  • 21
  • 111
  • 133
0
zcat archive.tgz | tar -x --wildcards apri/fls/filename
Jason Plank
  • 2,336
  • 5
  • 31
  • 40
0

gzip --decompress /file/address/file.tar.gz

SumoRunner
  • 904
  • 5
  • 5
0

If you ad the .Z to the end of the filename like this :

zcat /file/address/file.tar.gz.Z

then it will find the file .

Szekelygobe
  • 2,309
  • 1
  • 19
  • 25