Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 77 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




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

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


       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.   See  DETAILED  DESCRIPTION  below.
       Note  that  zipinfo  is  the  same program as unzip (under
       Unix, a link to it); on  some  systems,  however,  zipinfo
       support may have been omitted when unzip was compiled.


              Path of the ZIP archive(s).  If the file specifica­
              tion 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.  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  specified  by  a
                     beginning character, a hyphen, and an ending
                     character.  If an  exclamation  point  or  a
                     caret (`!' or `^') follows the left bracket,
                     then the  range  of  characters  within  the
                     brackets  is complemented (that is, anything
                     except the characters inside the brackets is
                     considered a match).

              (Be  sure  to quote any character that might other­
              wise be interpreted or modified  by  the  operating
              system,  particularly  under  Unix and VMS.)  If no
              matches are found, the specification is assumed  to
              be  a literal filename; and if that also fails, the
              suffix .zip is appended.  Note that self-extracting


       -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  head­
              ers  (-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 com­
              pression factor, expressed as a percentage, is also

       -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

       -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(1), 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 com­
              pressed total sizes, and their overall  compression
              factor  is  printed; or, if only the totals line is
              being printed, the values for  the  entire  archive

       zipinfo  has  a  number  of modes, and its behavior can be
       rather difficult to fathom if one isn't familiar with Unix
       ls(1)  (or  even  if  one is).  The default behavior is to
       list files in the following format:

  -rw-rws---  1.9 unx    2802 t- defX 11-Aug-91 13:48 perms.2660

       The last three fields are the modification date  and  time
       of  the  file,  and its name.  The case of the filename is
       respected; thus files that  come  from  MS-DOS  PKZIP  are
       always  capitalized.  If the file was zipped with a stored
       directory name, that is also  displayed  as  part  of  the

       The  second  and  third  fields indicate that the file was
       zipped under Unix with version 1.9 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  (fully explained in PKWare's APPNOTE.TXT,
       but basically analogous to pragmas in ANSI  C--i.e.,  they
       provide a standard way to include non-standard information
       in the archive).  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.
       The example below, on the  other  hand,  is  an  encrypted
       binary file with an extra field:

  RWD,R,R     0.9 vms     168 Bx shrk  9-Aug-91 19:15 perms.0644

       Extra fields are used for various purposes (see discussion
       of the -v option below) including the storage of VMS  file
       attributes,  which is presumably the case here.  Note that
       the file attributes are listed in VMS format.  Some  other
       possibilities  for  the  host  operating  system (which is
       actually a misnomer--host file  system  is  more  correct)
       include  OS/2  or  NT  with  High  Performance File System
       (HPFS), MS-DOS, OS/2 or  NT  with  File  Allocation  Table
       (FAT)  file  system,  and Macintosh.  These are denoted as

       Finally,  the sixth field indicates the compression method
       and possible sub-method used.  There are six methods known
       at  present:   storing (no compression), reducing, shrink­
       ing, imploding, tokenizing (never publicly released),  and
       deflating.  In addition, there are four levels of reducing
       (1 through 4); four types of imploding (4K or  8K  sliding
       dictionary,  and 2 or 3 Shannon-Fano trees); and four lev­
       els of deflating (superfast, fast,  normal,  maximum  com­
       pression).   zipinfo  represents  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 except  that  they  add  information  on  the
       file's  compression.   The  medium format lists the file's
       compression factor as a percentage indicating  the  amount
       of space that has been ``removed'':

  -rw-rws---  1.5 unx    2802 t- 81% defX 11-Aug-91 13:48 perms.2660

       In this example, the file has been compressed by more than
       a factor of five; the compressed data are only 19% of  the
       original  size.   The  long  format  gives  the compressed
       file's size in bytes, instead:

  -rw-rws---  1.5 unx    2802 t-     538 defX 11-Aug-91 13:48 perms.2660

       Adding the -T option changes the file  date  and  time  to
       decimal format:

  -rw-rws---  1.5 unx    2802 t-     538 defX 910811.134804 perms.2660

       Note that because of limitations in the MS-DOS format used
       to store file times, the seconds field is  always  rounded
       to  the  nearest  even  second.   For  Unix  files this is
       expected to change in the next major releases  of  zip(1L)
       and unzip.

       In addition to individual file information, a default zip­
       file listing also includes header and trailer lines:

  Archive:  OS2.zip   5453 bytes   5 files
  ,,rw,       1.0 hpf     730 b- i4:3 26-Jun-92 23:40 Contents
  ,,rw,       1.0 hpf    3710 b- i4:3 26-Jun-92 23:33 makefile.os2
  ,,rw,       1.0 hpf    8753 b- i8:3 26-Jun-92 15:29 os2unzip.c
  ,,rw,       1.0 hpf      98 b- stor 21-Aug-91 15:34 unzip.def
  ,,rw,       1.0 hpf      95 b- stor 21-Aug-91 17:51 zipinfo.def
  5 files, 13386 bytes uncompressed, 4951 bytes compressed:  63.0%

       The header line gives the name of the archive,  its  total
       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.
       Currently known types of  extra  fields  include  PKWARE's
       authentication  (``AV'')  info;  OS/2 extended attributes;
       VMS filesystem info, both PKWARE  and  Info-ZIP  versions;
       Macintosh  resource  forks; Acorn/Archimedes SparkFS info;
       and so on.  (Note  that  in  the  case  of  OS/2  extended
       attributes--perhaps  the  most common use of zipfile extra
       fields--the size of the stored EAs as reported by  zipinfo
       may not match the number given by OS/2's dir command: OS/2
       always reports the number of bytes required in 16-bit for­
       mat, whereas zipinfo always reports the 32-bit storage.)


       Modifying zipinfo's default behavior via options placed in
       an 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 some underlying logic.
       In brief, there are three ``priority levels'' of  options:
       the  default options; environment options, which can over­
       ride or add to the defaults; and explicit options given by
       the  user,  which  can  override  or  add to either of the

       The default listing format, as  noted  above,  corresponds
       roughly  to  the "zipinfo -hst" command (except when indi­
       vidual zipfile members are specified).  A user who prefers
       the long-listing format (-l) can make use of the zipinfo's
       environment variable to change this default:

       Unix Bourne shell:
              ZIPINFO=-l; export ZIPINFO

       Unix C shell:
              setenv ZIPINFO -l

       OS/2 or MS-DOS:
              set ZIPINFO=-l

       VMS (quotes for lowercase):
              define ZIPINFO_OPTS "-l"

       If, in addition, the user dislikes the trailer line,  zip­
       info's  concept  of  ``negative  options''  may be used to
       override the default  inclusion  of  the  line.   This  is
       accomplished by preceding the undesired option with one or
       more minuses:  e.g., ``-l-t'' or ``--tl'', in  this  exam­
       ple.   The  first  hyphen is the regular switch character,
       but the one before the `t' is a minus sign.  The dual  use
       of  hyphens may seem a little awkward, but it's reasonably


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

           zipinfo storage

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

           zipinfo -l storage

       To  list  the  complete  contents  of  the archive without
       header and totals lines,  either  negate  the  -h  and  -t
       options or else specify the contents explicitly:

           zipinfo --h-t storage
           zipinfo storage \*

       (where  the  backslash is required only if the shell would
       otherwise expand the `*' wildcard, as in Unix  when  glob­
       bing is turned on--double quotes around the asterisk would
       have worked as well).  To turn  off  the  totals  line  by
       default,  use the environment variable (C shell is assumed

           setenv ZIPINFO --t
           zipinfo storage

       To get the full, short-format listing of the first example
       again,  given  that  the environment variable is set as in
       the previous example, it is necessary to  specify  the  -s
       option  explicitly,  since the -t option by itself implies
       that ONLY the footer line is to be printed:

           setenv ZIPINFO --t
           zipinfo -t storage            [only totals line]
           zipinfo -st storage           [full listing]

       The -s option, like -m and -l, includes headers and  foot­
       ers  by  default,  unless  otherwise specified.  Since the
       environment variable specified no footers and that  has  a
       higher  precedence  than  the  default  behavior of -s, an
       explicit -t option was necessary to produce the full list­
       ing.   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 with each other,
       override any default listing of  member  files;  only  the
       header and/or footer are printed.  This behavior is useful
       when zipinfo is used with a  wildcard  zipfile  specifica­
       compressed  and uncompressed size; in such cases -t may be
       specified explicitly:

           zipinfo -mt storage "*.[ch]" Mak\*

       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 Unix more(1) if the operating system
       allows it:

           zipinfo -v storage | more

       Finally,  to  see  the most recently modified files in the
       archive, use the -T option in conjunction with an external
       sorting utility such as Unix sort(1) (and tail(1) as well,
       in this example):

           zipinfo -T storage | sort -n +6 | tail -15

       The -n option to sort(1)  tells  it  to  sort  numerically
       rather  than in ASCII order, and the +6 option tells it to
       sort on the sixth field after the  first  one  (i.e.,  the
       seventh  field).   This  assumes the default short-listing
       format; if -m or -l is used,  the  proper  sort(1)  option
       would  be +7.  The tail(1) command filters out all but the
       last 15 lines of the listing.  Future releases of  zipinfo
       may incorporate date/time and filename sorting as built-in


       The author finds it convenient to define an alias  ii  for
       zipinfo  on  systems that allow aliases (or, on other sys­
       tems, copy/rename the executable, create a link or  create
       a  command file with the name ii).  The ii usage parallels
       the common ll alias for long listings  in  Unix,  and  the
       similarity  between  the  outputs  of the two commands was


       As with unzip, zipinfo's -M (``more'')  option  is  overly
       simplistic  in  its  handling  of  screen output; as noted
       above, it fails to detect the wrapping of long  lines  and
       may  thereby  cause  lines  at the top of the screen to be
       scrolled off before being read.  zipinfo should detect and
       treat  each occurrence of line-wrap as one additional line
       printed.  This requires knowledge 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  should  be  simplified.   (This is not to say that it
       will be.)
       matching code by Mark Adler and fixes/improvements by many
       others.   Please  refer  to the CONTRIBS file in the UnZip
       source distribution for a more complete list.

Info-ZIP             17 February 2002 (v2.4)          ZIPINFO(1L)



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
You can help in many different ways.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.11 Seconds