Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

zipinfo - list detailed information about a ZIP archive

&pagelevel(4)&pagelevel

zipinfo lists technical information about files in a ZIP archive. Such information includes file access permissions, encryption status, type of compression, version and operating system or file system of compressing program, and the like. The default behavior (with no options) is to list single-line entries for each file in the archive, with header and trailer lines providing summary information for the entire archive. The format is a cross between "ls -l" and "unzip -v" output. See “Detailed description”.


Syntax


zipinfo [-12smlvhMtTz] file[.zip] [file ...] [-x xfile ...]
unzip -Z [-12smlvhMtTz] file[.zip] [file ...] [-x xfile ...]

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 operating system (or file system). Only the
filename can be a wildcard; the path itself cannot.

file

An optional list of archive members to be processed, separated by spaces. Regular
expressions (wildcards) may be used to match multiple members.

-x xfile

An optional list of archive members to be excluded from processing.

-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 in Unix shell scripts.

-2

list filenames only, one per line, but allow headers (-h), trailers (-t) and zipfile comments (-z), as well. This option may be useful in cases where the stored filenames are particularly long.

-s

list zipfile info in short format. This is the default behavior; see below.

-m

list zipfile info in medium format. Identical to the -s output, except that the compression factor, expressed as a percentage, is also listed.

-l

list zipfile info in long format. As with -m except that the compressed size (in bytes) is printed instead of the compression ratio.

-v

list zipfile information in verbose, multi-page format.

-h

list header line. The archive name, actual size (in bytes) and total number of files is printed.

-M

pipe all output through an internal pager similar to the more command.

-t

list totals for files listed or for all files. The number of files listed, their uncompressed and compressed total sizes , and their overall compression factor is printed; or, if only the totals line is being printed, the values for the entire archive are given. The compressed total size does not include the 12 additional header bytes of each encrypted entry. Note that the total compressed (data) size will never match the actual zipfile size, since the latter includes all of the internal zipfile headers in addition to the compressed data.

-T

print the file dates and times in a sortable decimal format (yyyymmdd.hhmmss).

-z

include the archive comment (if any) in the listing.

Detailed description

The default behavior is to list files in the following format:

-rw-rws--- 3.0 unx 2802 t- defX 11-Aug-16 13:48 perms.2660

The last three fields are the modification date and time of the file, and its name. If the file was zipped with a stored directory name, that is also displayed as part of the filename.

The second and third fields indicate that the file was zipped under Unix with version 3.0 of zip. Since it comes from Unix, the file permissions 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 take on several values. The first character may be either ’t’ or ’b’, indicating that zip believes the file to be text or binary, respectively; but if the file is encrypted, zipinfo notes this fact by capitalizing the character (’T’ or ’B’). The second character may also take on four values, depending on whether there is an extended local header and/or an "extra field" associated with the file. If neither exists, the character will be a hyphen (’-’); if there is an extended local header but no extra field, ’l’; if the reverse, ’x’; and if both exist, ’X’. Thus the file in this example is (probably) a text file, is not encrypted, and has neither an extra field nor an extended local header associated with it.

Finally, the sixth field indicates the compression method and possible sub-method used.

The header line gives the name of the archive, its total size, and the total number of files; the trailer gives the number of files listed, their total uncompressed size, and their total compressed size (not including any of zip’s internal overhead).

The verbose listing is mostly self-explanatory. It also lists file comments and the zipfile comment, if any, and the type and number of bytes in any stored extra fields.

Example

To get a basic, short-format listing of the complete contents of a ZIP archive storage.zip, with both header and totals lines, use only the archive name as an argument to zipinfo:

zipinfo storage

To produce a basic, long-format listing (not verbose), including header and totals lines, use -l:

zipinfo -l storage

To turn off the totals line by default, use the environment variable:

export ZIPINFO='--t'

zipinfo storage

To get maximal information about the ZIP archive, use the verbose option. It is usually wise to pipe the output into a filter such as more:

zipinfo -v storage | more

See also

ls, funzip, unzip, unzipsfx, zip, zipcloak, zipnote, zipsplit