How can I tail a zipped file without reading its entire contents?

前端 未结 7 1367
温柔的废话
温柔的废话 2020-12-15 15:35

I want to emulate the functionality of gzcat | tail -n.

This would be helpful for times when there are huge files (of a few GB\'s or so). Can I tail the last few li

相关标签:
7条回答
  • 2020-12-15 16:11

    An example of a fully gzip-compatible pseudo-random access format is dictzip:

    For compression, the file is divided up into "chunks" of data, each chunk is less than 64kB. [...]

    To perform random access on the data, the offset and length of the data are provided to library routines. These routines determine the chunk in which the desired data begins, and decompresses that chunk. Consecutive chunks are decompressed as necessary."

    0 讨论(0)
提交回复
热议问题