Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have four files that I created using an svndump

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

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
add comment

2 Answers

up vote 14 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
add comment

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
1  
> head test2.svn.gz �����F�u���;��@�� h��'N`�V�D�?Fo� –  whoami Feb 6 '12 at 12:41
9  
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
add comment

Your Answer

 
discard

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.