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.

We need to compare the contents in each of 2 .zip files we have. Each .zip file has of different file extensions. Each .zip file also contains another .zip file and a couple of subdirectories.

We dont have the luxury to use zipcomp utility. How do we compare all the files in the 2 zip files and display the identical files to matching.txt output file and non-identical files to non-matching.txt output file ?

The whole idea is to find out which files in 1 zip file, produced by a build, has changed/modified in another later build run.

Advance thanks all.

share|improve this question

1 Answer 1

Command unzip -lv file.zip prints contents of the file.zip, including CRC32 of every file in the archive (get unzip for Windows at http://info-zip.org or Sourceforge).

Having this, you can simply use

unzip -lv file1.zip > list1.txt
unzip -lv file2.zip > list2.txt

and compare contents of list1.txt vs list2.txt using utility like diff or diffuse. If you want more automated approach, you can write simple Perl or Python script to compare these listing files (hint - use Perl hash or Python dictionary on every file CRC32 that was printed by unzip -lv.

share|improve this answer
    
Hi mvp thanks for responding; its a linux platform we are using –  chz Apr 6 '13 at 17:52

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.