According to man unzip
:
NAME
unzip - list, test and extract compressed files in a ZIP ar‐
chive
SYNOPSIS
unzip [-Z] [-cflptTuvz[abjnoqsCDKLMUVWX$/:^]] file[.zip]
[file(s) ...] [-x xfile(s) ...] [-d exdir]
[file(s)]
An optional list of archive members to be processed,
separated by spaces. (VMS versions compiled with
VMSCLI defined must delimit files with commas instead.
See -v in OPTIONS below.) Regular expressions (wild‐
cards) may be used to match multiple members; see
above. Again, be sure to quote expressions that would
otherwise be expanded or modified by the operating sys‐
tem.
In other words, arguments given after the archive name are taken to be the list of files you want extracted:
$ unzip A.zip B.zip C.zip
If you want to compare the contents of two zip files, you could just list the files in each archive and compare the lists. The options -lqq
will cause unzip
to list the files in an archive:
$ unzip -lqq A.zip
424 2013-03-24 04:39 B.zip
424 2013-03-24 04:39 C.zip
424 2013-03-24 04:39 d.txt
So, to compare two archives, list the files in each, save into a text file and compare the text files:
$ unzip -lqq A.zip | sort > A_files.txt
$ unzip -lqq D.zip | sort > D_files.txt
$ diff A_files.txt D_files.txt | grep '<\|>'
< 0 2013-03-24 04:57 only_in_A.txt
> 0 2013-03-24 04:57 only_in_D.txt