Is there any way to perform diff operetion on two files in two zips without extracting them? If not - any other workaround to compare them without extracting?
Thanks.
Combining the responses so far, the following bash function will compare the file listings from the zip files. The listings include verbose output (unzip -v
), so checksums can be compared. Output is sorted by filename (sort -k8
) to allow side by side comparison and the diff output expanded (W200
) so the filenames are visible int he side by side view.
function zipdiff() { diff -W200 -y <(unzip -vql $1 | sort -k8) <(unzip -vql $2 | sort -k8); }
This can be added to your ~/.bashrc
file to be used from any console. It can be used with zipdiff a.zip b.zip
. Piping the output to less or redirecting to a file is helpful for large zip files.