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, these files have been viewed in the last 24 hours, so their access times have changed. For this reason, I can't compare the zips using diff or cmp.

What would a way to reliably compare their contents be? For example, I am considering comparing the output of

ls -l <file> | awk '{print $5}'

on the two files. Is there a better solution?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

zipcmp

zipcmp compares the zip archives zip1 and zip2 and checks if they contain the same files, comparing their names, uncompressed sizes, and CRCs. File order and compressed size differences are ignored.

share|improve this answer

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.