1ZIPINFO(1L)                                                        ZIPINFO(1L)
2
3
4

NAME

6       zipinfo - list detailed information about a ZIP archive
7

SYNOPSIS

9       zipinfo [-12CsmlvhMtTz] file[.zip] [file(s) ...] [-x xfile(s) ...]
10
11       unzip -Z [-12CsmlvhMtTz] file[.zip] [file(s) ...] [-x xfile(s) ...]
12

DESCRIPTION

14       zipinfo  lists technical information about files in a ZIP archive, most
15       commonly found on  MS-DOS  systems.   Such  information  includes  file
16       access permissions, encryption status, type of compression, version and
17       operating system or file system of compressing program, and  the  like.
18       The  default  behavior (with no options) is to list single-line entries
19       for each file in the archive, with header and trailer  lines  providing
20       summary  information  for  the  entire  archive.  The format is a cross
21       between Unix ``ls -l'' and ``unzip -v'' output.  See DETAILED  DESCRIP‐
22       TION  below.   Note  that  zipinfo  is the same program as unzip (under
23       Unix, a link to it); on some systems, however, zipinfo support may have
24       been omitted when unzip was compiled.
25

ARGUMENTS

27       file[.zip]
28              Path  of  the  ZIP  archive(s).   If the file specification is a
29              wildcard, each matching file is processed in an order determined
30              by the operating system (or file system).  Only the filename can
31              be a wildcard; the path itself cannot.  Wildcard expressions are
32              similar to Unix egrep(1) (regular) expressions and may contain:
33
34              *      matches a sequence of 0 or more characters
35
36              ?      matches exactly 1 character
37
38              [...]  matches  any  single character found inside the brackets;
39                     ranges are specified by a beginning character, a  hyphen,
40                     and  an  ending  character.  If an exclamation point or a
41                     caret (`!' or `^') follows the  left  bracket,  then  the
42                     range  of  characters within the brackets is complemented
43                     (that is,  anything  except  the  characters  inside  the
44                     brackets  is  considered a match).  To specify a verbatim
45                     left bracket, the three-character sequence ``[[]'' has to
46                     be used.
47
48              (Be  sure  to quote any character that might otherwise be inter‐
49              preted or modified by the operating system,  particularly  under
50              Unix  and  VMS.)   If no matches are found, the specification is
51              assumed to be a literal filename; and if that  also  fails,  the
52              suffix  .zip  is  appended.  Note that self-extracting ZIP files
53              are supported, as with any other ZIP archive; just  specify  the
54              .exe suffix (if any) explicitly.
55
56       [file(s)]
57              An  optional  list of archive members to be processed, separated
58              by spaces.  (VMS versions  compiled  with  VMSCLI  defined  must
59              delimit  files with commas instead.)  Regular expressions (wild‐
60              cards) may be used to match multiple members; see above.  Again,
61              be sure to quote expressions that would otherwise be expanded or
62              modified by the operating system.
63
64       [-x xfile(s)]
65              An optional list of archive members to be excluded from process‐
66              ing.
67

OPTIONS

69       -1     list  filenames  only,  one  per line.  This option excludes all
70              others;  headers,  trailers  and  zipfile  comments  are   never
71              printed.  It is intended for use in Unix shell scripts.
72
73       -2     list  filenames  only,  one  per  line,  but allow headers (-h),
74              trailers (-t) and zipfile comments (-z), as well.   This  option
75              may  be  useful in cases where the stored filenames are particu‐
76              larly long.
77
78       -C     use case-insensitive  matching  for  the  selection  of  archive
79              entries  from  the  command-line  list of extract selection pat‐
80              terns.
81
82       -s     list zipfile info in short Unix ``ls -l'' format.  This  is  the
83              default behavior; see below.
84
85       -m     list zipfile info in medium Unix ``ls -l'' format.  Identical to
86              the -s output, except that the compression factor, expressed  as
87              a percentage, is also listed.
88
89       -l     list  zipfile  info  in  long Unix ``ls -l'' format.  As with -m
90              except that the compressed size (in bytes) is printed instead of
91              the compression ratio.
92
93       -v     list zipfile information in verbose, multi-page format.
94
95       -h     list  header line.  The archive name, actual size (in bytes) and
96              total number of files is printed.
97
98       -M     pipe all output through an internal pager similar  to  the  Unix
99              more(1)  command.   At the end of a screenful of output, zipinfo
100              pauses with a ``--More--'' prompt; the  next  screenful  may  be
101              viewed  by  pressing  the  Enter  (Return) key or the space bar.
102              zipinfo can be terminated by pressing the ``q'' key and, on some
103              systems, the Enter/Return key.  Unlike Unix more(1), there is no
104              forward-searching or editing capability.  Also, zipinfo  doesn't
105              notice if long lines wrap at the edge of the screen, effectively
106              resulting in the printing of two or more lines and  the  likeli‐
107              hood that some text will scroll off the top of the screen before
108              being viewed.  On some systems the number of available lines  on
109              the  screen  is  not detected, in which case zipinfo assumes the
110              height is 24 lines.
111
112       -t     list totals for files listed or for all files.   The  number  of
113              files  listed,  their  uncompressed and compressed total sizes ,
114              and their overall compression factor is printed; or, if only the
115              totals  line is being printed, the values for the entire archive
116              are given.  The compressed total size does not  include  the  12
117              additional  header  bytes of each encrypted entry. Note that the
118              total compressed (data) size will never match the actual zipfile
119              size,  since  the  latter  includes  all of the internal zipfile
120              headers in addition to the compressed data.
121
122       -T     print the file dates and times  in  a  sortable  decimal  format
123              (yymmdd.hhmmss).   The  default  date format is a more standard,
124              human-readable version with abbreviated month names  (see  exam‐
125              ples below).
126
127       -U     [UNICODE_SUPPORT  only]  modify or disable UTF-8 handling.  When
128              UNICODE_SUPPORT is available, the  option  -U  forces  unzip  to
129              escape  all  non-ASCII  characters from UTF-8 coded filenames as
130              ``#Uxxxx''.  This option is mainly provided for  debugging  pur‐
131              pose when the fairly new UTF-8 support is suspected to mangle up
132              extracted filenames.
133
134              The option -UU allows to entirely  disable  the  recognition  of
135              UTF-8  encoded  filenames.   The  handling  of  filename codings
136              within unzip falls back to the behaviour of previous versions.
137
138       -z     include the archive comment (if any) in the listing.
139

DETAILED DESCRIPTION

141       zipinfo has a number of modes, and its behavior can be rather difficult
142       to  fathom  if  one isn't familiar with Unix ls(1) (or even if one is).
143       The default behavior is to list files in the following format:
144
145  -rw-rws---  1.9 unx    2802 t- defX 11-Aug-91 13:48 perms.2660
146
147       The last three fields are the modification date and time of  the  file,
148       and  its  name.  The case of the filename is respected; thus files that
149       come from MS-DOS PKZIP are always capitalized.  If the file was  zipped
150       with  a  stored  directory  name, that is also displayed as part of the
151       filename.
152
153       The second and third fields indicate that the  file  was  zipped  under
154       Unix  with version 1.9 of zip.  Since it comes from Unix, the file per‐
155       missions at the beginning of the line are printed in Unix format.   The
156       uncompressed file-size (2802 in this example) is the fourth field.
157
158       The fifth field consists of two characters, either of which may take on
159       several values.  The first character may be either `t' or `b', indicat‐
160       ing  that zip believes the file to be text or binary, respectively; but
161       if the file is encrypted, zipinfo notes this fact by  capitalizing  the
162       character  (`T'  or  `B').   The second character may also take on four
163       values, depending on whether there is an extended local  header  and/or
164       an  ``extra  field''  associated  with  the  file  (fully  explained in
165       PKWare's APPNOTE.TXT,  but  basically  analogous  to  pragmas  in  ANSI
166       C--i.e.,  they  provide a standard way to include non-standard informa‐
167       tion in the archive).  If neither  exists,  the  character  will  be  a
168       hyphen  (`-'); if there is an extended local header but no extra field,
169       `l'; if the reverse, `x'; and if both exist, `X'.   Thus  the  file  in
170       this  example is (probably) a text file, is not encrypted, and has nei‐
171       ther an extra field nor an extended local header  associated  with  it.
172       The  example below, on the other hand, is an encrypted binary file with
173       an extra field:
174
175  RWD,R,R     0.9 vms     168 Bx shrk  9-Aug-91 19:15 perms.0644
176
177       Extra fields are used for various purposes (see discussion  of  the  -v
178       option  below)  including  the storage of VMS file attributes, which is
179       presumably the case here.  Note that the file attributes are listed  in
180       VMS  format.   Some  other  possibilities for the host operating system
181       (which is actually  a  misnomer--host  file  system  is  more  correct)
182       include  OS/2  or  NT with High Performance File System (HPFS), MS-DOS,
183       OS/2 or NT with File Allocation Table (FAT) file system, and Macintosh.
184       These are denoted as follows:
185
186  -rw-a--     1.0 hpf    5358 Tl i4:3  4-Dec-91 11:33 longfilename.hpfs
187  -r--ahs     1.1 fat    4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF
188  --w-------  1.0 mac   17357 bx i8:2  4-May-92 04:02 unzip.macr
189
190       File  attributes  in  the  first two cases are indicated in a Unix-like
191       format, where the seven subfields indicate whether the file:  (1) is  a
192       directory,  (2) is readable (always true), (3) is writable, (4) is exe‐
193       cutable (guessed on the basis of the extension--.exe, .com, .bat,  .cmd
194       and  .btm files are assumed to be so), (5) has its archive bit set, (6)
195       is hidden, and (7) is a system file.  Interpretation of Macintosh  file
196       attributes  is  unreliable because some Macintosh archivers don't store
197       any attributes in the archive.
198
199       Finally, the sixth field indicates the compression method and  possible
200       sub-method  used.  There are six methods known at present:  storing (no
201       compression), reducing, shrinking, imploding,  tokenizing  (never  pub‐
202       licly  released), and deflating.  In addition, there are four levels of
203       reducing (1 through 4); four types of imploding (4K or 8K sliding  dic‐
204       tionary,  and  2 or 3 Shannon-Fano trees); and four levels of deflating
205       (superfast, fast, normal,  maximum  compression).   zipinfo  represents
206       these  methods  and  their  sub-methods  as follows:  stor; re:1, re:2,
207       etc.; shrk; i4:2, i8:3, etc.; tokn; and defS, defF, defN, and defX.
208
209       The medium and long listings are almost identical to the  short  format
210       except that they add information on the file's compression.  The medium
211       format lists the file's compression factor as a  percentage  indicating
212       the amount of space that has been ``removed'':
213
214  -rw-rws---  1.5 unx    2802 t- 81% defX 11-Aug-91 13:48 perms.2660
215
216       In  this example, the file has been compressed by more than a factor of
217       five; the compressed data are only 19% of the original size.  The  long
218       format gives the compressed file's size in bytes, instead:
219
220  -rw-rws---  1.5 unx    2802 t-     538 defX 11-Aug-91 13:48 perms.2660
221
222       In  contrast to the unzip listings, the compressed size figures in this
223       listing format denote the complete size of compressed  data,  including
224       the 12 extra header bytes in case of encrypted entries.
225
226       Adding the -T option changes the file date and time to decimal format:
227
228  -rw-rws---  1.5 unx    2802 t-     538 defX 910811.134804 perms.2660
229
230       Note  that  because  of  limitations in the MS-DOS format used to store
231       file times, the seconds field is always rounded  to  the  nearest  even
232       second.   For  Unix  files this is expected to change in the next major
233       releases of zip(1L) and unzip.
234
235       In addition to individual file information, a default  zipfile  listing
236       also includes header and trailer lines:
237
238  Archive:  OS2.zip   5453 bytes   5 files
239  ,,rw,       1.0 hpf     730 b- i4:3 26-Jun-92 23:40 Contents
240  ,,rw,       1.0 hpf    3710 b- i4:3 26-Jun-92 23:33 makefile.os2
241  ,,rw,       1.0 hpf    8753 b- i8:3 26-Jun-92 15:29 os2unzip.c
242  ,,rw,       1.0 hpf      98 b- stor 21-Aug-91 15:34 unzip.def
243  ,,rw,       1.0 hpf      95 b- stor 21-Aug-91 17:51 zipinfo.def
244  5 files, 13386 bytes uncompressed, 4951 bytes compressed:  63.0%
245
246       The  header line gives the name of the archive, its total size, and the
247       total number of files; the trailer gives the number  of  files  listed,
248       their  total  uncompressed  size,  and their total compressed size (not
249       including any of zip's internal overhead).  If, however,  one  or  more
250       file(s)  are  provided,  the  header  and trailer lines are not listed.
251       This behavior is also similar to that of Unix's ``ls -l'';  it  may  be
252       overridden  by  specifying the -h and -t options explicitly.  In such a
253       case the listing format must also be specified explicitly, since -h  or
254       -t  (or  both)  in  the  absence of other options implies that ONLY the
255       header or trailer line (or both) is listed.  See the  EXAMPLES  section
256       below for a semi-intelligible translation of this nonsense.
257
258       The  verbose  listing  is  mostly self-explanatory.  It also lists file
259       comments and the zipfile comment, if any, and the type  and  number  of
260       bytes  in  any  stored  extra  fields.   Currently known types of extra
261       fields include PKWARE's authentication  (``AV'')  info;  OS/2  extended
262       attributes;  VMS  filesystem  info,  both PKWARE and Info-ZIP versions;
263       Macintosh resource forks; Acorn/Archimedes SparkFS  info;  and  so  on.
264       (Note  that  in  the case of OS/2 extended attributes--perhaps the most
265       common use of zipfile extra fields--the  size  of  the  stored  EAs  as
266       reported  by  zipinfo may not match the number given by OS/2's dir com‐
267       mand: OS/2 always reports the number of bytes required in  16-bit  for‐
268       mat, whereas zipinfo always reports the 32-bit storage.)
269
270       Again,  the  compressed  size figures of the individual entries include
271       the 12 extra header bytes for encrypted entries.  In contrast, the  ar‐
272       chive  total compressed size and the average compression ratio shown in
273       the summary bottom line are calculated  without  the  extra  12  header
274       bytes of encrypted entries.
275

ENVIRONMENT OPTIONS

277       Modifying  zipinfo's default behavior via options placed in an environ‐
278       ment variable can be a bit complicated to  explain,  due  to  zipinfo's
279       attempts  to  handle  various  defaults in an intuitive, yet Unix-like,
280       manner.  (Try not to laugh.)  Nevertheless, there  is  some  underlying
281       logic.   In brief, there are three ``priority levels'' of options:  the
282       default options; environment options, which can override or add to  the
283       defaults; and explicit options given by the user, which can override or
284       add to either of the above.
285
286       The default listing format, as noted above, corresponds roughly to  the
287       "zipinfo  -hst"  command  (except  when  individual zipfile members are
288       specified).  A user who prefers the long-listing format (-l)  can  make
289       use of the zipinfo's environment variable to change this default:
290
291       Unix Bourne shell:
292              ZIPINFO=-l; export ZIPINFO
293
294       Unix C shell:
295              setenv ZIPINFO -l
296
297       OS/2 or MS-DOS:
298              set ZIPINFO=-l
299
300       VMS (quotes for lowercase):
301              define ZIPINFO_OPTS "-l"
302
303       If,  in addition, the user dislikes the trailer line, zipinfo's concept
304       of ``negative options'' may be used to override the  default  inclusion
305       of  the  line.   This is accomplished by preceding the undesired option
306       with one or more minuses:  e.g., ``-l-t'' or ``--tl'', in this example.
307       The  first  hyphen  is the regular switch character, but the one before
308       the `t' is a minus sign.  The dual use of hyphens  may  seem  a  little
309       awkward,  but it's reasonably intuitive nonetheless:  simply ignore the
310       first hyphen and go from there.  It is also consistent with the  behav‐
311       ior of the Unix command nice(1).
312
313       As suggested above, the default variable names are ZIPINFO_OPTS for VMS
314       (where the symbol used to install zipinfo as a  foreign  command  would
315       otherwise  be  confused with the environment variable), and ZIPINFO for
316       all other operating systems.  For compatibility  with  zip(1L),  ZIPIN‐
317       FOOPT is also accepted (don't ask).  If both ZIPINFO and ZIPINFOOPT are
318       defined, however, ZIPINFO takes precedence.  unzip's diagnostic  option
319       (-v  with  no zipfile name) can be used to check the values of all four
320       possible unzip and zipinfo environment variables.
321

EXAMPLES

323       To get a basic, short-format listing of the complete contents of a  ZIP
324       archive  storage.zip,  with  both header and totals lines, use only the
325       archive name as an argument to zipinfo:
326
327       zipinfo storage
328
329       To produce a basic, long-format listing (not verbose), including header
330       and totals lines, use -l:
331
332       zipinfo -l storage
333
334       To  list the complete contents of the archive without header and totals
335       lines, either negate the -h and -t options or else specify the contents
336       explicitly:
337
338       zipinfo --h-t storage
339       zipinfo storage \*
340
341       (where  the  backslash  is  required  only if the shell would otherwise
342       expand the `*' wildcard, as in Unix when globbing is turned  on--double
343       quotes around the asterisk would have worked as well).  To turn off the
344       totals line by default,  use  the  environment  variable  (C  shell  is
345       assumed here):
346
347       setenv ZIPINFO --t
348       zipinfo storage
349
350       To get the full, short-format listing of the first example again, given
351       that the environment variable is set as in the previous example, it  is
352       necessary  to  specify the -s option explicitly, since the -t option by
353       itself implies that ONLY the footer line is to be printed:
354
355       setenv ZIPINFO --t
356       zipinfo -t storage            [only totals line]
357       zipinfo -st storage           [full listing]
358
359       The -s option, like -m and -l, includes headers and footers by default,
360       unless  otherwise  specified.  Since the environment variable specified
361       no footers and that has a higher precedence than the  default  behavior
362       of -s, an explicit -t option was necessary to produce the full listing.
363       Nothing was indicated about the header, however, so the -s  option  was
364       sufficient.   Note  that both the -h and -t options, when used by them‐
365       selves or with each other,  override  any  default  listing  of  member
366       files;  only  the  header  and/or footer are printed.  This behavior is
367       useful when zipinfo is used with a wildcard zipfile specification;  the
368       contents of all zipfiles are then summarized with a single command.
369
370       To list information on a single file within the archive, in medium for‐
371       mat, specify the filename explicitly:
372
373       zipinfo -m storage unshrink.c
374
375       The specification of any member file, as in this example, will override
376       the  default  header and totals lines; only the single line of informa‐
377       tion about the requested file will be  printed.   This  is  intuitively
378       what  one would expect when requesting information about a single file.
379       For multiple files, it is often useful to know the total compressed and
380       uncompressed size; in such cases -t may be specified explicitly:
381
382       zipinfo -mt storage "*.[ch]" Mak\*
383
384       To  get  maximal  information  about  the  ZIP archive, use the verbose
385       option.  It is usually wise to pipe the output into a  filter  such  as
386       Unix more(1) if the operating system allows it:
387
388       zipinfo -v storage | more
389
390       Finally,  to  see  the most recently modified files in the archive, use
391       the -T option in conjunction with an external sorting utility  such  as
392       Unix sort(1) (and sed(1) as well, in this example):
393
394       zipinfo -T storage | sort -nr -k 7 | sed 15q
395
396       The -nr option to sort(1) tells it to sort numerically in reverse order
397       rather than in textual order, and the -k 7 option tells it to  sort  on
398       the  seventh  field.  This assumes the default short-listing format; if
399       -m or -l is used, the proper sort(1) option would be -k 8.  Older  ver‐
400       sions of sort(1) do not support the -k option, but you can use the tra‐
401       ditional + option instead, e.g., +6 instead of -k 7.  The  sed(1)  com‐
402       mand  filters  out  all  but the first 15 lines of the listing.  Future
403       releases of zipinfo may incorporate date/time and filename  sorting  as
404       built-in options.
405

TIPS

407       The  author  finds  it  convenient to define an alias ii for zipinfo on
408       systems that allow aliases (or, on other systems, copy/rename the  exe‐
409       cutable, create a link or create a command file with the name ii).  The
410       ii usage parallels the common ll alias for long listings in  Unix,  and
411       the similarity between the outputs of the two commands was intentional.
412

BUGS

414       As  with  unzip, zipinfo's -M (``more'') option is overly simplistic in
415       its handling of screen output; as noted above, it fails to  detect  the
416       wrapping  of  long  lines and may thereby cause lines at the top of the
417       screen to be scrolled off before being read.  zipinfo should detect and
418       treat  each  occurrence  of  line-wrap  as one additional line printed.
419       This requires knowledge of the screen's width as well  as  its  height.
420       In addition, zipinfo should detect the true screen geometry on all sys‐
421       tems.
422
423       zipinfo's listing-format behavior is unnecessarily complex  and  should
424       be simplified.  (This is not to say that it will be.)
425

SEE ALSO

427       ls(1), funzip(1L), unzip(1L), unzipsfx(1L), zip(1L), zipcloak(1L), zip‐
428       note(1L), zipsplit(1L)
429

URL

431       The Info-ZIP home page is currently at
432       http://www.info-zip.org/pub/infozip/
433       or
434       ftp://ftp.info-zip.org/pub/infozip/ .
435

AUTHOR

437       Greg ``Cave Newt'' Roelofs.  ZipInfo contains pattern-matching code  by
438       Mark  Adler and fixes/improvements by many others.  Please refer to the
439       CONTRIBS file in the UnZip source  distribution  for  a  more  complete
440       list.
441
442
443
444Info-ZIP                     20 April 2009 (v3.0)                  ZIPINFO(1L)
Impressum