Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have four files that I created using an svndump


now when I run this

md5sum test2.svn test.svn test.svn.gz test2.svn.gz

Here is the output

89fc1d097345b0255825286d9b4d64c3  test2.svn
89fc1d097345b0255825286d9b4d64c3  test.svn
8284ebb8b4f860fbb3e03e63168b9c9e  test.svn.gz
ab9411efcb74a466ea8e6faea5c0af9d  test2.svn.gz

So I can't understand why gzip is compressing files differently is it putting a timestamp somewhere before compressing? I had a similar issue with mysqldump as it was using the date field on top

share|improve this question
Dammit I just figured it out, but il let some one rack the points. Of you go answer :D – whoami Feb 6 '12 at 11:22
up vote 26 down vote accepted

gzip stores some of the original file's metadata in record header, including the file modification time and filename, if available. See GZIP file format specification.

So it's expected that your two gzip files aren't identical. You can work around this by passing gzip the -n flag, which stops it from including the original filename and timestamp in the header.

share|improve this answer

Every .gz file has an header with a name of file... Try head test.svn.gz and head test2.svn.gz

share|improve this answer
That outputs a whole lot of garbage. i don't thing head would work well on test.svn.gz – whoami Feb 6 '12 at 12:01
In the begining you can see a name of file... – Jan Marek Feb 6 '12 at 12:11
> head test2.svn.gz �����F�u���;��@�� h��'N`�V�D�?Fo� – whoami Feb 6 '12 at 12:41
head test2.svn.gz|hexdump -C won't mess up your terminal – Mat Feb 6 '12 at 12:45
ohhh nice @Mat love learning new commands – whoami Feb 6 '12 at 12:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.