Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How can I know the raw original timestamp of a file foo compressed with gzip without having to decompress foo.gz?
gzip --verbose --list foo.gz and file foo.gz will print formatted date and time.
gzip --verbose --list foo.gz
Extract the timestamp manually. Assuming that the compressed file has a single member (this is normally the case with gzip):
<foo.gz dd bs=4 skip=1 count=1 | od -t d4
This prints the raw timestamp, i.e. the number of seconds since 1970-01-01 00:00 UTC, in decimal.
Required, but never shown