Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a safe way to run a diff on two zip compressed files?

Seems this would not be a deterministic thing, or is there a way to do this reliably?

like image 736
ApplePieIsGood Avatar asked Feb 25 '09 19:02

ApplePieIsGood


People also ask

How do I compare two GZ files?

Zcmp and zdiff are used to invoke the cmp or the diff program on files compressed via gzip. All options specified are passed directly to cmp or diff. If only 1 file is specified, then the files compared are file1 and an uncompressed file1. gz.

Can beyond compare compare zip files?

Beyond Compare has the ability to create ZIP files from files and folders in a Folder Compare session.

What happens if you double zip a file?

Zipping zips is fine. If there is a problem, that would be a bug in the compression software :). You will probably not get any further compression for those files though unless you're using a higher level of compression.


2 Answers

If you're using gzip, you can do something like this:

# diff <(zcat file1.gz) <(zcat file2.gz)
like image 173
eduffy Avatar answered Jan 03 '23 04:01

eduffy


Reliable: unzip both, diff.

I have no idea if that answer's good enough for your use, but it works.

like image 29
Devin Jeanpierre Avatar answered Jan 03 '23 02:01

Devin Jeanpierre