If you want to diff two files (as you see in the difference), you must extract them - even if only in memory!
To see the diff of two files in two ZIP files, you can do something like this (without error checking or not at all):
# define a little bash function function zipdiff () { diff -u <(unzip -p $1 $2) <(unzip -p $3 $4); }
Note: unzip -p extracts files in p ipe (stdout).
If you want to know if the files are different, you can check their checksums using
unzip -v -l zipfile [file_to_inspect]
Note: -v means verbose and -l list contents)
unzip -v -l a.zip Archive: a.zip Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 6 Stored 6 0% 2016-02-23 18:23 363a3020 file.txt -------- ------- --- ------- 6 6 0% 1 file unzip -v -l b.zip Archive: b.zip Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 6 Stored 6 0% 2016-02-23 18:23 dd3861a8 file.txt -------- ------- --- ------- 6 6 0% 1 file
In the above example, you can see that the checksums (CRC-32) are different.
You may also be interested in this project: https://github.com/nhnb/zipdiff
source share