zcat won't unzip files properly
Asked Answered
O

5

51

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.

Onieonion answered 17/11, 2008 at 20:6 Comment(1)
I wouldn't try to unzip the passwd file if I were you :-)Mythopoeic
E
97

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.

Engagement answered 17/11, 2008 at 20:8 Comment(2)
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.Onieonion
Also works fine on mac with homebrew.Tympany
S
7

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

gzip -dc /file/address/file.tar.gz
Spice answered 22/11, 2008 at 21:52 Comment(1)
... or gunzip -c /file/address/file.tar.gz. This approach is portable between OS-X and Linux.Luncheon
B
1

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 .

Bolingbroke answered 10/11, 2017 at 21:28 Comment(0)
B
0

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

Bamboo answered 17/11, 2008 at 21:13 Comment(0)
P
0
zcat archive.tgz | tar -x --wildcards apri/fls/filename
Productive answered 28/10, 2009 at 13:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.