Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zcat won't unzip files properly

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

like image 820
Zain Rizvi Avatar asked Nov 17 '08 20:11

Zain Rizvi


People also ask

How do I unzip a compressed gzip file?

How to Unzip GZ Files. You can unzip GZ files in Linux by adding the -d flag to the Gzip/Gunzip command. All the same flags we used above can be applied. The GZ file will be removed by default after we uncompressed it unless we use the -k flag.

How do I unzip a .GZ file in XML?

Select all the files and folders inside the compressed file, or multi-select only the files or folders you want to open by holding the CTRL key and left-clicking on them. Click 1-click Unzip, and choose Unzip to PC or Cloud in the WinZip toolbar under the Unzip/Share tab.

How do I open a .GZ file without extracting it?

Just use zcat to see content without extraction. From the manual: zcat is identical to gunzip -c . (On some systems, zcat may be installed as gzcat to preserve the original link to compress .)

What is the zcat command used for?

The zcat command allows the user to expand and view a compressed file without uncompressing that file. The zcat command does not rename the expanded file or remove the . Z extension. The zcat command writes the expanded output to standard output.


1 Answers

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.

like image 128
Alnitak Avatar answered Oct 03 '22 22:10

Alnitak