I have downloaded a warc file from Common Crawl in Ubuntu 18.04. After decompressing it with gzip, I've tried to get a segment of the file using head
. I first tried:
head -c 29 CC-MAIN-20210620114611-20210620144611-00436.warc
It produced the expected result, outputting the first 29 bytes of the file:
WARC/1.0
WARC-Type: warcinfo
But, if instead of 29, I use 30, it produces a result I was not expecting:
head -c 30 CC-MAIN-20210620114611-20210620144611-00436.warc
Output:
WARC/1.0
This is only the first 10 bytes of the file, not the first 30. If I use head -c 31
, the result is the expected back again. I have no idea if this is a bug or if there is a detail on how head works that I'm not aware of.
head -c 30 CC-MAIN-20210620114611-20210620144611-00436.warc | hexdump -Cv