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
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.
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.
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 .)
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With