1ZIPINFO(1L) ZIPINFO(1L)
2
3
4
6 zipinfo - list detailed information about a ZIP archive
7
9 zipinfo [-12smlvhMtTz] file[.zip] [file(s) ...] [-x xfile(s) ...]
10
11 unzip -Z [-12smlvhMtTz] file[.zip] [file(s) ...] [-x xfile(s) ...]
12
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
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
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 -s list zipfile info in short Unix ``ls -l'' format. This is the
79 default behavior; see below.
80
81 -m list zipfile info in medium Unix ``ls -l'' format. Identical to
82 the -s output, except that the compression factor, expressed as
83 a percentage, is also listed.
84
85 -l list zipfile info in long Unix ``ls -l'' format. As with -m
86 except that the compressed size (in bytes) is printed instead of
87 the compression ratio.
88
89 -v list zipfile information in verbose, multi-page format.
90
91 -h list header line. The archive name, actual size (in bytes) and
92 total number of files is printed.
93
94 -M pipe all output through an internal pager similar to the Unix
95 more(1) command. At the end of a screenful of output, zipinfo
96 pauses with a ``--More--'' prompt; the next screenful may be
97 viewed by pressing the Enter (Return) key or the space bar.
98 zipinfo can be terminated by pressing the ``q'' key and, on some
99 systems, the Enter/Return key. Unlike Unix more(1), there is no
100 forward-searching or editing capability. Also, zipinfo doesn't
101 notice if long lines wrap at the edge of the screen, effectively
102 resulting in the printing of two or more lines and the likeli‐
103 hood that some text will scroll off the top of the screen before
104 being viewed. On some systems the number of available lines on
105 the screen is not detected, in which case zipinfo assumes the
106 height is 24 lines.
107
108 -t list totals for files listed or for all files. The number of
109 files listed, their uncompressed and compressed total sizes ,
110 and their overall compression factor is printed; or, if only the
111 totals line is being printed, the values for the entire archive
112 are given. The compressed total size does not include the 12
113 additional header bytes of each encrypted entry. Note that the
114 total compressed (data) size will never match the actual zipfile
115 size, since the latter includes all of the internal zipfile
116 headers in addition to the compressed data.
117
118 -T print the file dates and times in a sortable decimal format
119 (yymmdd.hhmmss). The default date format is a more standard,
120 human-readable version with abbreviated month names (see exam‐
121 ples below).
122
123 -z include the archive comment (if any) in the listing.
124
126 zipinfo has a number of modes, and its behavior can be rather difficult
127 to fathom if one isn't familiar with Unix ls(1) (or even if one is).
128 The default behavior is to list files in the following format:
129
130 -rw-rws--- 1.9 unx 2802 t- defX 11-Aug-91 13:48 perms.2660
131
132 The last three fields are the modification date and time of the file,
133 and its name. The case of the filename is respected; thus files that
134 come from MS-DOS PKZIP are always capitalized. If the file was zipped
135 with a stored directory name, that is also displayed as part of the
136 filename.
137
138 The second and third fields indicate that the file was zipped under
139 Unix with version 1.9 of zip. Since it comes from Unix, the file per‐
140 missions at the beginning of the line are printed in Unix format. The
141 uncompressed file-size (2802 in this example) is the fourth field.
142
143 The fifth field consists of two characters, either of which may take on
144 several values. The first character may be either `t' or `b', indicat‐
145 ing that zip believes the file to be text or binary, respectively; but
146 if the file is encrypted, zipinfo notes this fact by capitalizing the
147 character (`T' or `B'). The second character may also take on four
148 values, depending on whether there is an extended local header and/or
149 an ``extra field'' associated with the file (fully explained in
150 PKWare's APPNOTE.TXT, but basically analogous to pragmas in ANSI
151 C--i.e., they provide a standard way to include non-standard informa‐
152 tion in the archive). If neither exists, the character will be a
153 hyphen (`-'); if there is an extended local header but no extra field,
154 `l'; if the reverse, `x'; and if both exist, `X'. Thus the file in
155 this example is (probably) a text file, is not encrypted, and has nei‐
156 ther an extra field nor an extended local header associated with it.
157 The example below, on the other hand, is an encrypted binary file with
158 an extra field:
159
160 RWD,R,R 0.9 vms 168 Bx shrk 9-Aug-91 19:15 perms.0644
161
162 Extra fields are used for various purposes (see discussion of the -v
163 option below) including the storage of VMS file attributes, which is
164 presumably the case here. Note that the file attributes are listed in
165 VMS format. Some other possibilities for the host operating system
166 (which is actually a misnomer--host file system is more correct)
167 include OS/2 or NT with High Performance File System (HPFS), MS-DOS,
168 OS/2 or NT with File Allocation Table (FAT) file system, and Macintosh.
169 These are denoted as follows:
170
171 -rw-a-- 1.0 hpf 5358 Tl i4:3 4-Dec-91 11:33 longfilename.hpfs
172 -r--ahs 1.1 fat 4096 b- i4:2 14-Jul-91 12:58 EA DATA. SF
173 --w------- 1.0 mac 17357 bx i8:2 4-May-92 04:02 unzip.macr
174
175 File attributes in the first two cases are indicated in a Unix-like
176 format, where the seven subfields indicate whether the file: (1) is a
177 directory, (2) is readable (always true), (3) is writable, (4) is exe‐
178 cutable (guessed on the basis of the extension--.exe, .com, .bat, .cmd
179 and .btm files are assumed to be so), (5) has its archive bit set, (6)
180 is hidden, and (7) is a system file. Interpretation of Macintosh file
181 attributes is unreliable because some Macintosh archivers don't store
182 any attributes in the archive.
183
184 Finally, the sixth field indicates the compression method and possible
185 sub-method used. There are six methods known at present: storing (no
186 compression), reducing, shrinking, imploding, tokenizing (never pub‐
187 licly released), and deflating. In addition, there are four levels of
188 reducing (1 through 4); four types of imploding (4K or 8K sliding dic‐
189 tionary, and 2 or 3 Shannon-Fano trees); and four levels of deflating
190 (superfast, fast, normal, maximum compression). zipinfo represents
191 these methods and their sub-methods as follows: stor; re:1, re:2,
192 etc.; shrk; i4:2, i8:3, etc.; tokn; and defS, defF, defN, and defX.
193
194 The medium and long listings are almost identical to the short format
195 except that they add information on the file's compression. The medium
196 format lists the file's compression factor as a percentage indicating
197 the amount of space that has been ``removed'':
198
199 -rw-rws--- 1.5 unx 2802 t- 81% defX 11-Aug-91 13:48 perms.2660
200
201 In this example, the file has been compressed by more than a factor of
202 five; the compressed data are only 19% of the original size. The long
203 format gives the compressed file's size in bytes, instead:
204
205 -rw-rws--- 1.5 unx 2802 t- 538 defX 11-Aug-91 13:48 perms.2660
206
207 In contrast to the unzip listings, the compressed size figures in this
208 listing format denote the complete size of compressed data, including
209 the 12 extra header bytes in case of encrypted entries.
210
211 Adding the -T option changes the file date and time to decimal format:
212
213 -rw-rws--- 1.5 unx 2802 t- 538 defX 910811.134804 perms.2660
214
215 Note that because of limitations in the MS-DOS format used to store
216 file times, the seconds field is always rounded to the nearest even
217 second. For Unix files this is expected to change in the next major
218 releases of zip(1L) and unzip.
219
220 In addition to individual file information, a default zipfile listing
221 also includes header and trailer lines:
222
223 Archive: OS2.zip 5453 bytes 5 files
224 ,,rw, 1.0 hpf 730 b- i4:3 26-Jun-92 23:40 Contents
225 ,,rw, 1.0 hpf 3710 b- i4:3 26-Jun-92 23:33 makefile.os2
226 ,,rw, 1.0 hpf 8753 b- i8:3 26-Jun-92 15:29 os2unzip.c
227 ,,rw, 1.0 hpf 98 b- stor 21-Aug-91 15:34 unzip.def
228 ,,rw, 1.0 hpf 95 b- stor 21-Aug-91 17:51 zipinfo.def
229 5 files, 13386 bytes uncompressed, 4951 bytes compressed: 63.0%
230
231 The header line gives the name of the archive, its total size, and the
232 total number of files; the trailer gives the number of files listed,
233 their total uncompressed size, and their total compressed size (not
234 including any of zip's internal overhead). If, however, one or more
235 file(s) are provided, the header and trailer lines are not listed.
236 This behavior is also similar to that of Unix's ``ls -l''; it may be
237 overridden by specifying the -h and -t options explicitly. In such a
238 case the listing format must also be specified explicitly, since -h or
239 -t (or both) in the absence of other options implies that ONLY the
240 header or trailer line (or both) is listed. See the EXAMPLES section
241 below for a semi-intelligible translation of this nonsense.
242
243 The verbose listing is mostly self-explanatory. It also lists file
244 comments and the zipfile comment, if any, and the type and number of
245 bytes in any stored extra fields. Currently known types of extra
246 fields include PKWARE's authentication (``AV'') info; OS/2 extended
247 attributes; VMS filesystem info, both PKWARE and Info-ZIP versions;
248 Macintosh resource forks; Acorn/Archimedes SparkFS info; and so on.
249 (Note that in the case of OS/2 extended attributes--perhaps the most
250 common use of zipfile extra fields--the size of the stored EAs as
251 reported by zipinfo may not match the number given by OS/2's dir com‐
252 mand: OS/2 always reports the number of bytes required in 16-bit for‐
253 mat, whereas zipinfo always reports the 32-bit storage.)
254
255 Again, the compressed size figures of the individual entries include
256 the 12 extra header bytes for encrypted entries. In contrast, the ar‐
257 chive total compressed size and the average compression ratio shown in
258 the summary bottom line are calculated without the extra 12 header
259 bytes of encrypted entries.
260
262 Modifying zipinfo's default behavior via options placed in an environ‐
263 ment variable can be a bit complicated to explain, due to zipinfo's
264 attempts to handle various defaults in an intuitive, yet Unix-like,
265 manner. (Try not to laugh.) Nevertheless, there is some underlying
266 logic. In brief, there are three ``priority levels'' of options: the
267 default options; environment options, which can override or add to the
268 defaults; and explicit options given by the user, which can override or
269 add to either of the above.
270
271 The default listing format, as noted above, corresponds roughly to the
272 "zipinfo -hst" command (except when individual zipfile members are
273 specified). A user who prefers the long-listing format (-l) can make
274 use of the zipinfo's environment variable to change this default:
275
276 Unix Bourne shell:
277 ZIPINFO=-l; export ZIPINFO
278
279 Unix C shell:
280 setenv ZIPINFO -l
281
282 OS/2 or MS-DOS:
283 set ZIPINFO=-l
284
285 VMS (quotes for lowercase):
286 define ZIPINFO_OPTS "-l"
287
288 If, in addition, the user dislikes the trailer line, zipinfo's concept
289 of ``negative options'' may be used to override the default inclusion
290 of the line. This is accomplished by preceding the undesired option
291 with one or more minuses: e.g., ``-l-t'' or ``--tl'', in this example.
292 The first hyphen is the regular switch character, but the one before
293 the `t' is a minus sign. The dual use of hyphens may seem a little
294 awkward, but it's reasonably intuitive nonetheless: simply ignore the
295 first hyphen and go from there. It is also consistent with the behav‐
296 ior of the Unix command nice(1).
297
298 As suggested above, the default variable names are ZIPINFO_OPTS for VMS
299 (where the symbol used to install zipinfo as a foreign command would
300 otherwise be confused with the environment variable), and ZIPINFO for
301 all other operating systems. For compatibility with zip(1L), ZIPIN‐
302 FOOPT is also accepted (don't ask). If both ZIPINFO and ZIPINFOOPT are
303 defined, however, ZIPINFO takes precedence. unzip's diagnostic option
304 (-v with no zipfile name) can be used to check the values of all four
305 possible unzip and zipinfo environment variables.
306
308 To get a basic, short-format listing of the complete contents of a ZIP
309 archive storage.zip, with both header and totals lines, use only the
310 archive name as an argument to zipinfo:
311
312 zipinfo storage
313
314 To produce a basic, long-format listing (not verbose), including header
315 and totals lines, use -l:
316
317 zipinfo -l storage
318
319 To list the complete contents of the archive without header and totals
320 lines, either negate the -h and -t options or else specify the contents
321 explicitly:
322
323 zipinfo --h-t storage
324 zipinfo storage \*
325
326 (where the backslash is required only if the shell would otherwise
327 expand the `*' wildcard, as in Unix when globbing is turned on--double
328 quotes around the asterisk would have worked as well). To turn off the
329 totals line by default, use the environment variable (C shell is
330 assumed here):
331
332 setenv ZIPINFO --t
333 zipinfo storage
334
335 To get the full, short-format listing of the first example again, given
336 that the environment variable is set as in the previous example, it is
337 necessary to specify the -s option explicitly, since the -t option by
338 itself implies that ONLY the footer line is to be printed:
339
340 setenv ZIPINFO --t
341 zipinfo -t storage [only totals line]
342 zipinfo -st storage [full listing]
343
344 The -s option, like -m and -l, includes headers and footers by default,
345 unless otherwise specified. Since the environment variable specified
346 no footers and that has a higher precedence than the default behavior
347 of -s, an explicit -t option was necessary to produce the full listing.
348 Nothing was indicated about the header, however, so the -s option was
349 sufficient. Note that both the -h and -t options, when used by them‐
350 selves or with each other, override any default listing of member
351 files; only the header and/or footer are printed. This behavior is
352 useful when zipinfo is used with a wildcard zipfile specification; the
353 contents of all zipfiles are then summarized with a single command.
354
355 To list information on a single file within the archive, in medium for‐
356 mat, specify the filename explicitly:
357
358 zipinfo -m storage unshrink.c
359
360 The specification of any member file, as in this example, will override
361 the default header and totals lines; only the single line of informa‐
362 tion about the requested file will be printed. This is intuitively
363 what one would expect when requesting information about a single file.
364 For multiple files, it is often useful to know the total compressed and
365 uncompressed size; in such cases -t may be specified explicitly:
366
367 zipinfo -mt storage "*.[ch]" Mak\*
368
369 To get maximal information about the ZIP archive, use the verbose
370 option. It is usually wise to pipe the output into a filter such as
371 Unix more(1) if the operating system allows it:
372
373 zipinfo -v storage | more
374
375 Finally, to see the most recently modified files in the archive, use
376 the -T option in conjunction with an external sorting utility such as
377 Unix sort(1) (and sed(1) as well, in this example):
378
379 zipinfo -T storage | sort -nr -k 7 | sed 15q
380
381 The -nr option to sort(1) tells it to sort numerically in reverse order
382 rather than in textual order, and the -k 7 option tells it to sort on
383 the seventh field. This assumes the default short-listing format; if
384 -m or -l is used, the proper sort(1) option would be -k 8. Older ver‐
385 sions of sort(1) do not support the -k option, but you can use the tra‐
386 ditional + option instead, e.g., +6 instead of -k 7. The sed(1) com‐
387 mand filters out all but the first 15 lines of the listing. Future
388 releases of zipinfo may incorporate date/time and filename sorting as
389 built-in options.
390
392 The author finds it convenient to define an alias ii for zipinfo on
393 systems that allow aliases (or, on other systems, copy/rename the exe‐
394 cutable, create a link or create a command file with the name ii). The
395 ii usage parallels the common ll alias for long listings in Unix, and
396 the similarity between the outputs of the two commands was intentional.
397
399 As with unzip, zipinfo's -M (``more'') option is overly simplistic in
400 its handling of screen output; as noted above, it fails to detect the
401 wrapping of long lines and may thereby cause lines at the top of the
402 screen to be scrolled off before being read. zipinfo should detect and
403 treat each occurrence of line-wrap as one additional line printed.
404 This requires knowledge of the screen's width as well as its height.
405 In addition, zipinfo should detect the true screen geometry on all sys‐
406 tems.
407
408 zipinfo's listing-format behavior is unnecessarily complex and should
409 be simplified. (This is not to say that it will be.)
410
412 ls(1), funzip(1L), unzip(1L), unzipsfx(1L), zip(1L), zipcloak(1L), zip‐
413 note(1L), zipsplit(1L)
414
416 The Info-ZIP home page is currently at
417 http://www.info-zip.org/pub/infozip/
418 or
419 ftp://ftp.info-zip.org/pub/infozip/ .
420
422 Greg ``Cave Newt'' Roelofs. ZipInfo contains pattern-matching code by
423 Mark Adler and fixes/improvements by many others. Please refer to the
424 CONTRIBS file in the UnZip source distribution for a more complete
425 list.
426
427
428
429Info-ZIP 28 February 2005 (v2.42) ZIPINFO(1L)