gzip: unexpected end of file with - how to read file anyway

Apart from the very end of the file, you will be able to see the uncompressed data with zcat (or gzip -dc, or gunzip -c):

zcat log.gz | tail

or

zcat log.gz | less

or

zless log.gz

gzip will do buffering for obvious reasons (it needs to compress the data in chunks), so even though the program may have outputted some data, that data may not yet be in the log.gz file.

You may also store the uncompressed log with

zcat log.gz > log

... but that would be silly since there's obviously a reason why you compress the output in the first place.

Tags:

Gzip