zcat won't unzip files properly
-
08-07-2019 - |
Question
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.
Any help will be greatly appreciated.
Thanks
Solution
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.
OTHER TIPS
I generally just use gzip directly when I want to gzip:
gzip -dc /file/address/file.tar.gz
gzip --decompress /file/address/file.tar.gz
zcat archive.tgz | tar -x --wildcards apri/fls/filename
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 .