Linux and Unix zipinfo command

Quick links

About zipinfo
Syntax
Examples
Related commands
Linux and Unix main page

About zipinfo

Lists technical information about files in a ZIP archive, most commonly found on MS-DOS systems. 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 Unix "ls -l" and "unzip -v" output.

Syntax

zipinfo [-12smlvhMtTz] file[.zip] [file(s) ...] [-x xfile(s) ...]

unzip -Z [-12smlvhMtTz] file[.zip] [file(s) ...] [-x xfile(s) ...]

-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 Unix "ls -l" format. This is the default behavior; see below.
-m list zipfile info in medium Unix "ls -l" format. Identical to the -s output, except that the compression factor, expressed as a percentage, is also listed.
-l list zipfile info in long Unix "ls -l" 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 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 the Enter (Return) key or the space bar. zipinfo can be terminated by pressing the "q" key and, on some systems, the Enter/Return key. Unlike Unix more, there is no forward-searching or editing capability. Also, zipinfo doesn't notice if long lines wrap at the edge of the screen, effectively resulting in the printing of two or more lines and the likelihood that some text will scroll off the top of the screen before being viewed. On some systems the number of available lines on the screen is not detected, 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 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 (yymmdd.hhmmss). The default date format is a more standard, human-readable version with abbreviated month
names (see examples below).
  -z include the archive comment (if any) in the listing.

Examples

zipinfo hope

Display information about the hope.zip archive. Below is an example of the type of output this command generates. As can be seen in the below examples you can see the total file count, sizes as well as the compressed ratio.

Archive: hope.zip 9628445 bytes 25 files
-rw-r--r-- 2.3 unx 282667 tx defN 18-Jul-11 14:17 badips.txt
-rw-r--r-- 2.3 unx 46177980 tx defN 18-Jul-11 04:45 hijacklogs.txt
-rw-r--r-- 2.3 unx 231984 tx defN 18-Jul-11 13:01 isitup.txt
.
.
.
25 files, 60757943 bytes uncompressed, 9625041 bytes compressed: 84.2%

Related commands

unzip
zip