Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I created these two zip files about 24 hours apart.

$ ls -l /tmp/*.zip
-rw-rw-r-- 1 scott scott 1401289 Mar 21 20:11 /tmp/inc1.zip
-rw-rw-r-- 1 scott scott 1401289 Mar 22 19:29 /tmp/inc2.zip

You can see they're the same size, because the directory being zipped hasn't changed.

However, when I run md5sum on them, I get different results.

$ md5sum /tmp/inc*
95b1c0b32cc24a5554769797e032ec6e  /tmp/inc1.zip
80765ac3fc7f488243bdc1c06902e33c  /tmp/inc2.zip

Why is this?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Probably something simple like the mtime/atime on file(s) inside the .zip changed since the first one was created .

zdiff and bzdiff exist to diff-compare gzip and bzip2 compress files, respectively, however no such native utility exists for zip files AFAIK. You could try something like diffzips.pl

share|improve this answer
    
I'll bet you it's the atime. That's frustrating, since the files themselves are the same. –  Scott Wilson Mar 22 '12 at 23:48
1  
Both cmp and diff show them as different. I hadn't considered file attributes - I'll bet that's it. –  Scott Wilson Mar 22 '12 at 23:57

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.