gzip problem

Hi All,

I am zipping a file using
gzip -cq XYZ.txt > XYZ.txt.gz command.

file got created with name XYZ.txt.gz

but when i execute the following command i am getting errors,

$ gzip -t XYZ.txt.gz
gzip: XYZ.txt.gz: invalid compressed data--crc error
gzip: XYZ.txt.gz: invalid compressed data--length error

What could be problem, where i am doing wrong. Please help me out.

Regards,
Ravi Kumar Garlapati

-q option of gzip supresses all warnings. You may have missed some important message there. Try running the command without -q option.

i did not get any warnings,

i tried this by gzip -c XYZ.txt > XYZ.txt.gz command aswell.

still the same errors are encountered.

i am unable to unzip the file.

Can i know reason of getting these errors.

$ gzip -t XYZ.txt.gz
gzip: XYZ.txt.gz: invalid compressed data--crc error
gzip: XYZ.txt.gz: invalid compressed data--length error

These errors mean that your gz file is corrupt. There could have been an error while writing the file while running gzip -cq. As Yogesh has said before, try running the gzip -c command again without the -q option.

gzip automatically stores the zipped file in XYZ.txt.gz, you do not need to do a redirect. What you are doing with the redirect is storing any gzip messages in XYZ.txt.gz, instead of the actual zipped data.

Just try "gzip XYZ.txt"

Sorry, but that's plain wrong. The OP is using 'gzip -c'. Check the gzip man page to see what the '-c' switch does. What he is doing is fine, just removing the -q could let him see if any error is being thrown.