MAN page from Old RedHat 7.X unzip-5.42-1.i386.rpm
ZIPINFO
Section: Misc. Reference Manual Pages (1L)
Updated: 14 January 2001 (v2.32)
Index NAME
zipinfo - list detailed information about a ZIP archive
SYNOPSIS
zipinfo [
-12smlvhMtTz]
file[
.zip][
file(s) ...] [
-x xfile(s) ...]
unzip -Z [-12smlvhMtTz] file[.zip][file(s) ...] [-x xfile(s) ...]
DESCRIPTION
zipinfo lists technical information about files in a ZIP archive, mostcommonly found on MS-DOS systems. Such information includes file accesspermissions, encryption status, type of compression, version and operatingsystem or file system of compressing program, and the like. The defaultbehavior (with no options) isto list single-line entries for each file in the archive, with header andtrailer lines providing summary information for the entire archive. Theformat is a cross between Unix ``ls -l'' and ``unzip -v''output. See
DETAILED DESCRIPTIONbelow. Note that
zipinfo is the same program as
unzip (underUnix, a link to it); on some systems, however,
zipinfo support mayhave been omitted when
unzip was compiled.
ARGUMENTS
- file[.zip]
- Path of the ZIP archive(s). If the file specification is a wildcard,each matching file is processed in an order determined by the operatingsystem (or file system). Only the filename can be a wildcard; the pathitself cannot. Wildcard expressions are similar to Unix egrep(1)(regular) expressions and may contain:
- *
- matches a sequence of 0 or more characters
- ?
- matches exactly 1 character
- [...]
- matches any single character found inside the brackets; ranges are specifiedby a beginning character, a hyphen, and an ending character. If an exclamationpoint or a caret (`!' or `^') follows the left bracket, then the range ofcharacters within the brackets is complemented (that is, anything exceptthe characters inside the brackets is considered a match).
- (Be sure to quote any character that might otherwise be interpreted ormodified by the operating system, particularly under Unix and VMS.) If nomatches are found, the specification is assumed to be a literal filename;and if that also fails, the suffix .zip is appended. Note thatself-extracting ZIP files are supported; just specify the .exe suffix(if any) explicitly.
- [file(s)]
- An optional list of archive members to be processed.Regular expressions (wildcards) may be used to match multiple members; seeabove. Again, be sure to quote expressions that would otherwise be expandedor modified by the operating system.
- [-x xfile(s)]
- An optional list of archive members to be excluded from processing.
OPTIONS
- -1
- list filenames only, one per line. This option excludes all others; headers,trailers and zipfile comments are never printed. It is intended for use inUnix shell scripts.
- -2
- list filenames only, one per line, but allow headers (-h), trailers(-t) and zipfile comments (-z), as well. This option may beuseful in cases where the stored filenames are particularly long.
- -s
- list zipfile info in short Unix ``ls -l'' format. This is the defaultbehavior; see below.
- -m
- list zipfile info in medium Unix ``ls -l'' format. Identical to the-s output, except that the compression factor, expressed as apercentage, is also listed.
- -l
- list zipfile info in long Unix ``ls -l'' format. As with -mexcept that the compressed size (in bytes) is printed instead of thecompression ratio.
- -v
- list zipfile information in verbose, multi-page format.
- -h
- list header line. The archive name, actual size (in bytes) and total numberof files is printed.
- -M
- pipe all output through an internal pager similar to the Unix more(1)command. At the end of a screenful of output, zipinfo pauses with a``--More--'' prompt; the next screenful may be viewed by pressing theEnter (Return) key or the space bar. zipinfo can be terminated bypressing the ``q'' key and, on some systems, the Enter/Return key. UnlikeUnix more(1), there is no forward-searching or editing capability.Also, zipinfo doesn't notice if long lines wrap at the edge of thescreen, effectively resulting in the printing of two or more lines and thelikelihood that some text will scroll off the top of the screen before beingviewed. On some systems the number of available lines on the screen is notdetected, in which case zipinfo assumes the height is 24 lines.
- -t
- list totals for files listed or for all files. The number of files listed,their uncompressed and compressed total sizes, and their overall compressionfactor is printed; or, if only the totals line is being printed, the valuesfor the entire archive are given. Note that the total compressed (data)size will never match the actual zipfile size, since the latter includes allof the internal zipfile headers in addition to the compressed data.
- -T
- print the file dates and times in a sortable decimal format (yymmdd.hhmmss).The default date format is a more standard, human-readable version withabbreviated month names (see examples below).
- -z
- include the archive comment (if any) in the listing.
DETAILED DESCRIPTION
zipinfohas a number of modes, and its behavior can be rather difficult to fathomif one isn't familiar with Unix
ls(1) (or even if one is). The defaultbehavior is to list files in the following format:
The last three fields are the modification date and time ofthe file, and its name. The case of the filename is respected; thusfiles that come from MS-DOS PKZIP are always capitalized. If the filewas zipped with a stored directory name, that is also displayed as partof the filename.
The second and third fields indicate that the file was zipped underUnix with version 1.9 of zip. Since it comes from Unix, the filepermissions at the beginning of the line are printed in Unix format.The uncompressed file-size (2802 in this example) is the fourth field.
The fifth field consists of two characters, either of which may takeon several values. The first character may be either `t' or `b', indicatingthat zip believes the file to be text or binary, respectively;but if the file is encrypted, zipinfonotes this fact by capitalizing the character (`T' or `B'). The secondcharacter may also take on four values, depending on whether there isan extended local header and/or an ``extra field'' associated with thefile (fully explained in PKWare's APPNOTE.TXT, but basically analogous topragmas in ANSI C--i.e., they provide a standard way to include non-standardinformation in the archive). If neither exists, the characterwill be a hyphen (`-'); if there is an extended local header but no extrafield, `l'; if the reverse, `x'; and if both exist, `X'. Thus thefile in this example is (probably) a text file, is not encrypted, andhas neither an extra field nor an extended local header associated with it.The example below, on the other hand, is an encrypted binary file with anextra field:
Extra fields are used for various purposes (see discussion of the -voption below) including the storage of VMS file attributes, which ispresumably the case here. Note that the file attributes are listed inVMS format. Some other possibilities for the host operating system (whichis actually a misnomer--host file system is more correct) includeOS/2 or NT with High Performance File System (HPFS), MS-DOS, OS/2 or NTwith File Allocation Table (FAT) file system, and Macintosh. These aredenoted as follows:
File attributes in the first two cases are indicated in a Unix-like format,where the seven subfields indicate whether the file: (1) is a directory,(2) is readable (always true), (3) is writable, (4) is executable (guessedon the basis of the extension--.exe, .com, .bat, .cmdand .btm files are assumed to be so), (5) has its archive bit set,(6) is hidden, and (7) is a system file. Interpretation of Macintosh fileattributes is unreliable because some Macintosh archivers don't store anyattributes in the archive.
Finally, the sixth field indicatesthe compression method and possible sub-method used. There are six methodsknown at present: storing (no compression), reducing, shrinking, imploding,tokenizing (never publicly released), and deflating. In addition, there arefour levels of reducing (1 through 4); four types of imploding (4K or 8Ksliding dictionary, and 2 or 3 Shannon-Fano trees); and four levels ofdeflating (superfast, fast, normal, maximum compression). zipinforepresents these methods and their sub-methods as follows: stor;re:1, re:2, etc.; shrk; i4:2, i8:3, etc.;tokn; and defS, defF, defN, and defX.
The medium and long listings are almost identical to the short format exceptthat they add information on the file's compression. The medium format liststhe file's compression factor as a percentage indicating the amount of spacethat has been ``removed'':
In this example, the file has been compressed by more than a factor offive; the compressed data are only 19% of the original size. The longformat gives the compressed file's size in bytes, instead:
Adding the -T option changes the file date and time to decimalformat:
Note that because of limitations in the MS-DOS format used to store filetimes, the seconds field is always rounded to the nearest even second.For Unix files this is expected to change in the next major releases ofzip(1L) and unzip.
In addition to individual file information, a default zipfile listingalso includes header and trailer lines:
The header line gives the name of the archive, its total size, and thetotal number of files; the trailer gives the number of files listed,their total uncompressed size, and their total compressed size (notincluding any of zip's internal overhead). If, however, one ormore file(s) are provided, the header and trailer lines arenot listed. This behavior is also similar to that of Unix's ``ls -l'';it may be overridden by specifying the -h and -t optionsexplicitly.In such a case the listing format must also be specified explicitly,since -h or -t (or both) in the absence of other options impliesthat ONLY the header or trailer line (or both) is listed. See theEXAMPLES section below for a semi-intelligible translation of thisnonsense.
The verbose listing is mostly self-explanatory. It also lists filecomments and the zipfile comment, if any, and the type and number of bytesin any stored extra fields. Currently known types of extra fields includePKWARE's authentication (``AV'') info; OS/2 extended attributes; VMSfilesystem info, both PKWARE and Info-ZIP versions; Macintosh resourceforks; Acorn/Archimedes SparkFS info; and so on. (Notethat in the case of OS/2 extended attributes--perhaps the most commonuse of zipfile extra fields--the size of the stored EAs as reported byzipinfo may not match the number given by OS/2's dir command:OS/2 always reports the number of bytes required in 16-bit format, whereaszipinfo always reports the 32-bit storage.)
ENVIRONMENT OPTIONS
Modifying
zipinfo's default behavior via options placed inan environment variable can be a bit complicated to explain, due to
zipinfo's attempts to handle various defaults in an intuitive,yet Unix-like, manner. (Try not to laugh.) Nevertheless, there is someunderlying logic. In brief,there are three ``priority levels'' of options: the default options;environment options, which can override or add to the defaults; andexplicit options given by the user, which can override or add toeither of the above.
The default listing format, as noted above, corresponds roughlyto the "zipinfo -hst" command (except when individual zipfile membersare specified).A user who prefers the long-listing format (-l) can make use of thezipinfo's environment variable to change this default:
If, in addition, the user dislikes the trailer line, zipinfo'sconcept of ``negative options'' may be used to override the defaultinclusion of the line. This is accomplished by preceding the undesiredoption with one or more minuses: e.g., ``-l-t'' or ``--tl'',in this example. The first hyphen is the regular switch character, but theone before the `t' is a minus sign. The dual use of hyphens may seem alittle awkward, but it's reasonably intuitive nonetheless: simply ignorethe first hyphen and go from there. It is also consistent with the behaviorof the Unix command nice(1).
As suggested above, the default variable names are ZIPINFO_OPTS for VMS(where the symbol used to install zipinfo as a foreign commandwould otherwise be confused with the environment variable), and ZIPINFOfor all other operating systems. For compatibility with zip(1L),ZIPINFOOPT is also accepted (don't ask). If both ZIPINFO and ZIPINFOOPTare defined, however, ZIPINFO takes precedence. unzip's diagnosticoption (-v with no zipfile name) can be used to check the valuesof all four possible unzip and zipinfo environment variables.
EXAMPLES
To get a basic, short-format listing of the complete contents of a ZIParchive
storage.zip, with both header and totals lines, use onlythe archive name as an argument to zipinfo:
To produce a basic, long-format listing (not verbose), including header andtotals lines, use -l:
To list the complete contents of the archive without header and totalslines, either negate the -h and -t options or else specify thecontents explicitly:
(where the backslash is required only if the shell would otherwise expandthe `*' wildcard, as in Unix when globbing is turned on--double quotes aroundthe asterisk would have worked as well). To turn off the totals line bydefault, use the environment variable (C shell is assumed here):
To get the full, short-format listing of the first example again, giventhat the environment variable is set as in the previous example, it isnecessary to specify the -s option explicitly, since the -toption by itself implies that ONLY the footer line is to be printed:
The -s option, like -m and -l, includes headers andfooters by default, unless otherwise specified. Since the environmentvariable specified no footers and that has a higher precedence than thedefault behavior of -s, an explicit -t option was necessaryto produce the full listing. Nothing was indicated about the header,however, so the -s option was sufficient. Note that both the-h and -t options, when used by themselves or witheach other, override any default listing of member files; only the headerand/or footer are printed. This behavior is useful when zipinfo isused with a wildcard zipfile specification; the contents of all zipfilesare then summarized with a single command.
To list information on a single file within the archive, in medium format,specify the filename explicitly:
The specification of any member file, as in this example, will overridethe default header and totals lines; only the single line of informationabout the requested file will be printed. This is intuitively what onewould expect when requesting information about a single file. For multiplefiles, it is often useful to know the total compressed and uncompressedsize; in such cases -t may be specified explicitly:
To get maximal information about the ZIP archive, use the verboseoption. It is usually wise to pipe the output into a filter such asUnix more(1) if the operating system allows it:
Finally, to see the most recently modified files in the archive, usethe -T option in conjunction with an external sorting utilitysuch as Unix sort(1) (and tail(1) as well, in this example):
The -n option to sort(1) tells it to sort numericallyrather than in ASCII order, and the +6 option tells it to sorton the sixth field after the first one (i.e., the seventh field). Thisassumes the default short-listing format; if -m or -l isused, the proper sort(1) option would be +7. The tail(1)command filters out all but the last 15 lines of the listing. Futurereleases of zipinfo may incorporate date/time and filename sortingas built-in options.
TIPS
The author finds it convenient to define an alias
ii for
zipinfoon systems that allow aliases (or, on other systems, copy/rename theexecutable, create a link or create a command file with the name
ii).The
ii usage parallels the common
ll alias for long listings inUnix, and the similarity between the outputs of the two commands wasintentional.
BUGS
As with
unzip,
zipinfo's
-M (``more'') option is overlysimplistic in its handling of screen output; as noted above, it fails to detectthe wrapping of long lines and may thereby cause lines at the top of the screento be scrolled off before being read.
zipinfo should detect and treateach occurrence of line-wrap as one additional line printed. This requiresknowledge of the screen's width as well as its height. In addition,
zipinfo should detect the true screen geometry on all systems.
zipinfo's listing-format behavior is unnecessarily complex and shouldbe simplified. (This is not to say that it will be.)
SEE ALSO
ls(1),
funzip(1L),
unzip(1L),
unzipsfx(1L),
zip(1L),
zipcloak(1L),
zipnote(1L),
zipsplit(1L)
URL
The Info-ZIP home page is currently at
http://www.info-zip.org/pub/infozip/or
ftp://ftp.info-zip.org/pub/infozip/ .
AUTHOR
Greg ``Cave Newt'' Roelofs. ZipInfo contains pattern-matching codeby Mark Adler and fixes/improvements by many others. Please refer to theCONTRIBS file in the UnZip source distribution for a more complete list.
Index
- NAME
- SYNOPSIS
- DESCRIPTION
- ARGUMENTS
- OPTIONS
- DETAILED DESCRIPTION
- ENVIRONMENT OPTIONS
- EXAMPLES
- TIPS
- BUGS
- SEE ALSO
- URL
- AUTHOR
This document was created byman2html,using the manual pages.