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.
gziptimestamps
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.
Best Answer
Extract the timestamp manually. Assuming that the compressed file has a single member (this is normally the case with gzip):
This prints the raw timestamp, i.e. the number of seconds since 1970-01-01 00:00 UTC, in decimal.