home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip52.zip / unzip.doc < prev    next >
Text File  |  1996-04-29  |  36KB  |  749 lines

  1.  
  2. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  3.  
  4. NAME
  5.      unzip - list, test and extract compressed  files  in  a  ZIP
  6.      archive
  7.  
  8. SYNOPSIS
  9.      unzip     [-Z]     [-cflptuvz[abjnoqsCLMVX$]]     file[.zip]
  10.      [file(s) ...] [-x xfile(s) ...] [-d exdir]
  11.  
  12. DESCRIPTION
  13.      unzip will list, test, or extract files from a ZIP  archive,
  14.      commonly  found  on  MS-DOS  systems.   The default behavior
  15.      (with no options) is to extract into the  current  directory
  16.      (and  subdirectories  below it) all files from the specified
  17.      ZIP archive.  A  companion  program,  zip(1L),  creates  ZIP
  18.      archives; both programs are compatible with archives created
  19.      by PKWARE's PKZIP and PKUNZIP for MS-DOS, but in many  cases
  20.      the program options or default behaviors differ.
  21.  
  22. ARGUMENTS
  23.      file[.zip]
  24.           Path of the ZIP archive(s).  If the file  specification
  25.           is  a  wildcard,  each matching file is processed in an
  26.           order determined by the operating system (or file  sys-
  27.           tem).   Only  the  filename can be a wildcard; the path
  28.           itself cannot.  Wildcard  expressions  are  similar  to
  29.           Unix egrep(1) (regular) expressions and may contain:
  30.  
  31.           *    matches a sequence of 0 or more characters
  32.  
  33.           ?    matches exactly 1 character
  34.  
  35.           [...]
  36.                matches any  single  character  found  inside  the
  37.                brackets;  ranges  are  specified  by  a beginning
  38.                character, a hyphen, and an ending character.   If
  39.                an  exclamation point or a caret (`!' or `^') fol-
  40.                lows the left bracket, then the range  of  charac-
  41.                ters within the brackets is complemented (that is,
  42.                anything except the characters inside the brackets
  43.                is considered a match).
  44.  
  45.           (Be sure to quote any character that might otherwise be
  46.           interpreted  or  modified by the operating system, par-
  47.           ticularly under Unix  and  VMS.)   If  no  matches  are
  48.           found,  the  specification  is  assumed to be a literal
  49.           filename; and if that also fails, the  suffix  .zip  is
  50.           appended.  Note that self-extracting ZIP files are sup-
  51.           ported, as with any other ZIP archive; just specify the
  52.           .exe suffix (if any) explicitly.
  53.  
  54.      [file(s)]
  55.           An optional list of archive members  to  be  processed,
  56.  
  57. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 1
  58.  
  59. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  60.  
  61.           separated  by  spaces.   (VMS  versions  compiled  with
  62.           VMSCLI defined must delimit files with commas  instead.
  63.           See  -v  in  OPTIONS below.) Regular expressions (wild-
  64.           cards) may be  used  to  match  multiple  members;  see
  65.           above.   Again, be sure to quote expressions that would
  66.           otherwise be expanded or modified by the operating sys-
  67.           tem.
  68.  
  69.      [-x xfile(s)]
  70.           An optional list of archive members to be excluded from
  71.           processing.   Since wildcard characters match directory
  72.           separators (`/'), this option may be  used  to  exclude
  73.           any  files  that  are  in subdirectories.  For example,
  74.           ``unzip foo *.[ch] -x */*'' would extract all C  source
  75.           files  in the main directory, but none in any subdirec-
  76.           tories.  Without the -x option, all C source  files  in
  77.           all directories within the zipfile would be extracted.
  78.  
  79.      [-d exdir]
  80.           An optional directory to which to  extract  files.   By
  81.           default,  all files and subdirectories are recreated in
  82.           the current directory; the -d option allows  extraction
  83.           in an arbitrary directory (always assuming one has per-
  84.           mission to write to the directory).  This  option  need
  85.           not  appear  at the end of the command line; it is also
  86.           accepted before the  zipfile  specification  (with  the
  87.           normal options), immediately after the zipfile specifi-
  88.           cation, or between the file(s) and the -x option.   The
  89.           option  and  directory  may be concatenated without any
  90.           white space between them, but note that this may  cause
  91.           normal shell behavior to be suppressed.  In particular,
  92.           ``-d ~'' (tilde) is expanded by Unix C shells into  the
  93.           name  of  the  user's  home  directory,  but ``-d~'' is
  94.           treated as a literal subdirectory ``~'' of the  current
  95.           directory.
  96.  
  97. OPTIONS
  98.      Note that, in order to support obsolescent hardware, unzip's
  99.      usage  screen is limited to 22 or 23 lines and should there-
  100.      fore be considered only a reminder of the basic unzip syntax
  101.      rather than an exhaustive list of all possible flags.
  102.  
  103.      -Z   zipinfo(1L) mode.  If the first option on  the  command
  104.           line  is  -Z,  the  remaining  options  are taken to be
  105.           zipinfo(1L) options.  See the appropriate  manual  page
  106.           for a description of these options.
  107.  
  108.      -c   extract files to stdout/screen (``CRT'').  This  option
  109.           is  similar  to  the  -p option except that the name of
  110.           each file is printed as it is extracted, the -a  option
  111.           is  allowed,  and  ASCII-EBCDIC conversion is automati-
  112.           cally performed if appropriate.   This  option  is  not
  113.  
  114. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 2
  115.  
  116. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  117.  
  118.           listed in the unzip usage screen.
  119.  
  120.      -f   freshen existing files, i.e., extract only those  files
  121.           that  already exist on disk and that are newer than the
  122.           disk copies.  By default unzip queries before overwrit-
  123.           ing,  but  the  -o  option  may be used to suppress the
  124.           queries.  Note that under many operating  systems,  the
  125.           TZ   (timezone)   environment   variable  must  be  set
  126.           correctly in order for  -f  and  -u  to  work  properly
  127.           (under Unix the variable is usually set automatically).
  128.           The reasons for this are somewhat subtle but have to do
  129.           with  the  differences  between  DOS-format  file times
  130.           (always local time) and Unix-format  times  (always  in
  131.           GMT)  and  the necessity to compare the two.  A typical
  132.           TZ value is ``PST8PDT'' (US Pacific time with automatic
  133.           adjustment   for  Daylight  Savings  Time  or  ``summer
  134.           time'').
  135.  
  136.      -l   list  archive  files  (short   format).    The   names,
  137.           uncompressed  file  sizes  and  modification  dates and
  138.           times of the specified files are  printed,  along  with
  139.           totals  for all files specified.  If UnZip was compiled
  140.           with OS2_EAS defined, the -l option also lists  columns
  141.           for  the sizes of stored OS/2 extended attributes (EAs)
  142.           and OS/2 access control lists (ACLs).  In addition, the
  143.           zipfile  comment  and individual file comments (if any)
  144.           are displayed.  If a file was archived from  a  single-
  145.           case  file system (for example, the old MS-DOS FAT file
  146.           system) and the -L option was given,  the  filename  is
  147.           converted  to  lowercase  and  is prefixed with a caret
  148.           (^).
  149.  
  150.      -p   extract files to pipe (stdout).  Nothing but  the  file
  151.           data  is  sent  to  stdout,  and  the  files are always
  152.           extracted in binary format, just as they are stored (no
  153.           conversions).
  154.  
  155.      -t   test archive files.  This option extracts  each  speci-
  156.           fied file in memory and compares the CRC (cyclic redun-
  157.           dancy check, an enhanced checksum) of the expanded file
  158.           with the original file's stored CRC value.
  159.  
  160.      -u   update existing files and create new  ones  if  needed.
  161.           This  option  performs  the  same  function  as  the -f
  162.           option, extracting (with query) files  that  are  newer
  163.           than  those with the same name on disk, and in addition
  164.           it extracts those files that do not  already  exist  on
  165.           disk.   See  -f  above  for  information on setting the
  166.           timezone properly.
  167.  
  168.      -v   be verbose or  print  diagnostic  version  info.   This
  169.           option  has  evolved  and now behaves as both an option
  170.  
  171. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 3
  172.  
  173. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  174.  
  175.           and a modifier.  As an  option  it  has  two  purposes:
  176.           when  a  zipfile is specified with no other options, -v
  177.           lists archive files verbosely, adding to the  basic  -l
  178.           info  the compression method, compressed size, compres-
  179.           sion ratio and 32-bit CRC.  When no zipfile  is  speci-
  180.           fied  (that  is, the complete command is simply ``unzip
  181.           -v''), a diagnostic screen is printed.  In addition  to
  182.           the  normal header with release date and version, unzip
  183.           lists the home Info-ZIP ftp site and where  to  find  a
  184.           list of other ftp and non-ftp sites; the target operat-
  185.           ing system for which it was compiled, as well as  (pos-
  186.           sibly)  the hardware on which it was compiled, the com-
  187.           piler and version used, and the compilation  date;  any
  188.           special  compilation  options  that  might  affect  the
  189.           program's operation (see also  DECRYPTION  below);  and
  190.           any  options stored in environment variables that might
  191.           do the same (see  ENVIRONMENT  OPTIONS  below).   As  a
  192.           modifier  it  works  in  conjunction with other options
  193.           (e.g., -t) to produce more verbose or debugging output;
  194.           this is not yet fully implemented but will be in future
  195.           releases.
  196.  
  197.      -z   display only the archive comment.
  198.  
  199. MODIFIERS
  200.      -a   convert text files.  Ordinarily all files are extracted
  201.           exactly  as they are stored (as ``binary'' files).  The
  202.           -a option causes files identified by zip as text  files
  203.           (those  with  the `t' label in zipinfo listings, rather
  204.           than `b') to be automatically extracted as  such,  con-
  205.           verting  line  endings,  end-of-file characters and the
  206.           character set itself as necessary.  (For example,  Unix
  207.           files  use  line  feeds (LFs) for end-of-line (EOL) and
  208.           have no end-of-file (EOF) marker; Macintoshes use  car-
  209.           riage  returns  (CRs)  for  EOLs; and most PC operating
  210.           systems use CR+LF for EOLs and control-Z for  EOF.   In
  211.           addition, IBM mainframes and the Michigan Terminal Sys-
  212.           tem use EBCDIC rather than the more common ASCII  char-
  213.           acter  set,  and  NT supports Unicode.) Note that zip's
  214.           identification of text files is by  no  means  perfect;
  215.           some  ``text''  files  may  actually be binary and vice
  216.           versa.    unzip   therefore   prints   ``[text]''    or
  217.           ``[binary]''  as  a  visual  check  for  each  file  it
  218.           extracts when using the  -a  option.   The  -aa  option
  219.           forces all files to be extracted as text, regardless of
  220.           the supposed file type.
  221.  
  222.      -b   treat all files as binary (no text conversions).   This
  223.           is a shortcut for ---a.
  224.  
  225.      -C   match filenames case-insensitively.  unzip's philosophy
  226.           is   ``you  get  what  you  ask  for''  (this  is  also
  227.  
  228. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 4
  229.  
  230. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  231.  
  232.           responsible for the  -L/-U  change;  see  the  relevant
  233.           options  below).   Because  some file systems are fully
  234.           case-sensitive (notably those under the Unix  operating
  235.           system)  and because both ZIP archives and unzip itself
  236.           are portable across platforms, unzip's default behavior
  237.           is  to  match both wildcard and literal filenames case-
  238.           sensitively.  That is, specifying ``makefile''  on  the
  239.           command  line  will  only  match  ``makefile''  in  the
  240.           archive, not ``Makefile'' or  ``MAKEFILE''  (and  simi-
  241.           larly  for  wildcard  specifications).  Since this does
  242.           not  correspond  to  the   behavior   of   many   other
  243.           operating/file  systems  (for example, OS/2 HPFS, which
  244.           preserves mixed case but is not sensitive to  it),  the
  245.           -C  option may be used to force all filename matches to
  246.           be case-insensitive.  In the example above,  all  three
  247.           files  would  then match ``makefile'' (or ``make*'', or
  248.           similar).  The -C option affects files in both the nor-
  249.           mal file list and the excluded-file list (xlist).
  250.  
  251.      -j   junk paths.  The archive's directory structure  is  not
  252.           recreated;  all  files  are deposited in the extraction
  253.           directory (by default, the current one).
  254.  
  255.      -L   convert to lowercase any  filename  originating  on  an
  256.           uppercase-only  operating system or file system.  (This
  257.           was unzip's default behavior in releases prior to 5.11;
  258.           the  new  default  behavior  is  identical  to  the old
  259.           behavior with the -U option, which is now obsolete  and
  260.           will be removed in a future release.)  Depending on the
  261.           archiver, files archived under single-case file systems
  262.           (VMS,  old  MS-DOS  FAT,  etc.)  may  be stored as all-
  263.           uppercase names; this can be ugly or inconvenient  when
  264.           extracting  to  a  case-preserving  file system such as
  265.           OS/2 HPFS or a case-sensitive one such as  under  Unix.
  266.           By  default  unzip  lists  and  extracts such filenames
  267.           exactly  as  they're  stored   (excepting   truncation,
  268.           conversion   of  unsupported  characters,  etc.);  this
  269.           option causes the names of all files from certain  sys-
  270.           tems to be converted to lowercase.
  271.  
  272.      -M   pipe all output through an internal  pager  similar  to
  273.           the  Unixmore(1) command.  At the end of a screenful of
  274.           output, unzip pauses with a  ``--More--''  prompt;  the
  275.           next  screenful  may  be  viewed  by pressing the Enter
  276.           (Return) key or the space bar.  unzip can be terminated
  277.           by  pressing  the  ``q''  key and, on some systems, the
  278.           Enter/Return key.  Unlike Unix  more(1),  there  is  no
  279.           forward-searching  or  editing capability.  Also, unzip
  280.           doesn't notice if long lines wrap at the  edge  of  the
  281.           screen, effectively resulting in the printing of two or
  282.           more lines and  the  likelihood  that  some  text  will
  283.           scroll  off  the top of the screen before being viewed.
  284.  
  285. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 5
  286.  
  287. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  288.  
  289.           On some systems the number of available  lines  on  the
  290.           screen is not detected, in which case unzip assumes the
  291.           height is 24 lines.
  292.  
  293.      -n   never overwrite existing  files.   If  a  file  already
  294.           exists,  skip  the  extraction  of  that  file  without
  295.           prompting.  By default unzip queries before  extracting
  296.           any  file  that  already exists; the user may choose to
  297.           overwrite only the current file, overwrite  all  files,
  298.           skip extraction of the current file, skip extraction of
  299.           all existing files, or rename the current file.
  300.  
  301.      -o   overwrite existing files without prompting.  This is  a
  302.           dangerous  option,  so  use it with care.  (It is often
  303.           used with -f, however.)
  304.  
  305.      -q   perform operations quietly (-qq = even quieter).  Ordi-
  306.           narily  unzip  prints  the  names  of  the  files  it's
  307.           extracting or testing, the extraction methods, any file
  308.           or  zipfile comments that may be stored in the archive,
  309.           and possibly a summary when finished with each archive.
  310.           The  -q[q] options suppress the printing of some or all
  311.           of these messages.
  312.  
  313.      -s   [OS/2, NT,  MS-DOS]  convert  spaces  in  filenames  to
  314.           underscores.   Since  all  PC  operating  systems allow
  315.           spaces  in  filenames,  unzip   by   default   extracts
  316.           filenames  with  spaces intact (e.g., ``EA DATA. SF'').
  317.           This can be awkward, however, since MS-DOS in  particu-
  318.           lar  does  not  gracefully support spaces in filenames.
  319.           Conversion of spaces to underscores can  eliminate  the
  320.           awkwardness in some cases.
  321.  
  322.      -U   (obsolete; to be removed in  a  future  release)  leave
  323.           filenames  uppercase if created under MS-DOS, VMS, etc.
  324.           See -L above.
  325.  
  326.      -V   retain (VMS) file version numbers.  VMS  files  can  be
  327.           stored   with   a   version   number,   in  the  format
  328.           file.ext;##.  By default the  ``;##''  version  numbers
  329.           are  stripped,  but  this  option  allows  them  to  be
  330.           retained.  (On file systems  that  limit  filenames  to
  331.           particularly  short lengths, the version numbers may be
  332.           truncated or stripped regardless of this option.)
  333.  
  334.      -X   [VMS, Unix, OS/2] restore owner/protection info  (UICs)
  335.           under VMS, or user and group info (UID/GID) under Unix,
  336.           or access control lists (ACLs) under  certain  network-
  337.           enabled  versions  of  OS/2  (Warp  Server with IBM LAN
  338.           Server/Requester 3.0 to 5.0; Warp Connect with IBM Peer
  339.           1.0).   In  most cases this will require special system
  340.           privileges; but under Unix, for  example,  a  user  who
  341.  
  342. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 6
  343.  
  344. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  345.  
  346.           belongs  to  several  groups can restore files owned by
  347.           any of those groups, as long as the user IDs match  his
  348.           or  her  own.   Note  that ordinary file attributes are
  349.           always restored; this option applies only to  optional,
  350.           extra  ownership  info available on some operating sys-
  351.           tems.  [Note that NT's access control lists  are  prob-
  352.           ably  compatible  with  OS/2's.   A future release will
  353.           support  cross-platform  storage  and  restoration   of
  354.           ACLs.]
  355.  
  356.      -$   [MS-DOS, OS/2, NT] restore  the  volume  label  if  the
  357.           extraction  medium  is  removable  (e.g.,  a diskette).
  358.           Doubling the option  (-$$)  allows  fixed  media  (hard
  359.           disks)  to  be  labelled  as  well.  By default, volume
  360.           labels are ignored.
  361.  
  362. ENVIRONMENT OPTIONS
  363.      unzip's default behavior may be modified via options  placed
  364.      in  an  environment  variable.   This  can  be done with any
  365.      option, but it is probably most useful with the -a, -L,  -C,
  366.      -q, -o, or -n modifiers:  make unzip auto-convert text files
  367.      by default, make it convert filenames from uppercase systems
  368.      to  lowercase,  make it match names case-insensitively, make
  369.      it quieter, or make it always overwrite or  never  overwrite
  370.      files  as  it extracts them.  For example, to make unzip act
  371.      as quietly as possible, only reporting errors, one would use
  372.      one of the following commands:
  373.  
  374.          UNZIP=-qq; export UNZIP    Unix Bourne shell
  375.          setenv UNZIP -qq           Unix C shell
  376.          set UNZIP=-qq              OS/2 or MS-DOS
  377.          define UNZIP_OPTS "-qq"    VMS (quotes for lowercase)
  378.  
  379.      Environment options are, in effect, considered  to  be  just
  380.      like  any  other  command-line options, except that they are
  381.      effectively the first options on the command line.  To over-
  382.      ride  an  environment option, one may use the ``minus opera-
  383.      tor'' to remove it.  For instance, to override  one  of  the
  384.      quiet-flags in the example above, use the command
  385.  
  386.          unzip --q[other options] zipfile
  387.  
  388.      The first hyphen is the normal  switch  character,  and  the
  389.      second  is  a  minus sign, acting on the q option.  Thus the
  390.      effect here is to cancel one quantum of quietness.  To  can-
  391.      cel both quiet flags, two (or more) minuses may be used:
  392.  
  393.          unzip -t--q zipfile
  394.          unzip ---qt zipfile
  395.  
  396.      (the two are equivalent).  This may seem awkward or  confus-
  397.      ing,  but it is reasonably intuitive:  just ignore the first
  398.  
  399. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 7
  400.  
  401. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  402.  
  403.      hyphen and go from there.  It is also  consistent  with  the
  404.      behavior of Unix nice(1).
  405.  
  406.      As suggested by the examples  above,  the  default  variable
  407.      names  are  UNZIP_OPTS  for  VMS  (where  the symbol used to
  408.      install unzip as a foreign command would otherwise  be  con-
  409.      fused  with  the  environment  variable),  and UNZIP for all
  410.      other operating systems.  For  compatibility  with  zip(1L),
  411.      UNZIPOPT  is  also  accepted (don't ask).  If both UNZIP and
  412.      UNZIPOPT  are  defined,  however,  UNZIP  takes  precedence.
  413.      unzip's  diagnostic  option (-v with no zipfile name) can be
  414.      used to check the values of  all  four  possible  unzip  and
  415.      zipinfo environment variables.
  416.  
  417.      The timezone variable (TZ) should be set  according  to  the
  418.      local  timezone  in  order  for  the  -f  and  -u to operate
  419.      correctly.  See the description of  -f  above  for  details.
  420.      This  variable may also be necessary in order for timestamps
  421.      on extracted files to be set correctly.
  422.  
  423. DECRYPTION
  424.      Encrypted archives are fully supported by Info-ZIP software,
  425.      but due to United States export restrictions, the encryption
  426.      and decryption sources are not  packaged  with  the  regular
  427.      unzip  and  zip distributions.  Since the crypt sources were
  428.      written by Europeans, however, they are freely available  at
  429.      sites  throughout  the  world; see the file ``Where'' in any
  430.      Info-ZIP source or binary distribution  for  locations  both
  431.      inside and outside the US.
  432.  
  433.      Because of the separate distribution, not all compiled  ver-
  434.      sions  of  unzip support decryption.  To check a version for
  435.      crypt  support,  either  attempt  to  test  or  extract   an
  436.      encrypted  archive,  or else check unzip's diagnostic screen
  437.      (see the -v option above) for ``[decryption]'' as one of the
  438.      special compilation options.
  439.  
  440.      There are no runtime options for decryption;  if  a  zipfile
  441.      member  is  encrypted,  unzip  will  prompt for the password
  442.      without echoing what is typed.  unzip continues to  use  the
  443.      same  password  as  long  as it appears to be valid; it does
  444.      this by testing a 12-byte header.  The correct password will
  445.      always check out against the header, but there is a 1-in-256
  446.      chance that an incorrect password will as well.  (This is  a
  447.      security  feature  of  the  PKWARE  zipfile format; it helps
  448.      prevent brute-force attacks  that  might  otherwise  gain  a
  449.      large  speed  advantage by testing only the header.)  In the
  450.      case that an incorrect password is given but it  passes  the
  451.      header  test  anyway,  either  an incorrect CRC will be gen-
  452.      erated for the extracted data or else unzip will fail during
  453.      the  extraction  because the ``decrypted'' bytes do not con-
  454.      stitute a valid compressed data stream.
  455.  
  456. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 8
  457.  
  458. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  459.  
  460.      If the first password fails the header check on  some  file,
  461.      unzip  will prompt for another password, and so on until all
  462.      files are extracted.  If a password is not known, entering a
  463.      null  password (that is, just a carriage return) is taken as
  464.      a signal to skip all further  prompting.   Only  unencrypted
  465.      files  in  the  archive(s)  will  thereafter  be  extracted.
  466.      (Actually that's not quite true; older versions  of  zip(1L)
  467.      and  zipcloak(1L)  allowed  null  passwords, so unzip checks
  468.      each encrypted file to see if the null password works.  This
  469.      may  result in ``false positives'' and extraction errors, as
  470.      noted above.)
  471.  
  472.      Note that there is presently no  way  to  avoid  interactive
  473.      decryption.   This  is  another security feature:  plaintext
  474.      passwords given on the command line or stored in files  con-
  475.      stitute  a  risk because they may be seen by others.  Future
  476.      releases may (under protest, with great disapproval) support
  477.      such shenanigans.
  478.  
  479. EXAMPLES
  480.      To  use  unzip  to  extract  all  members  of  the   archive
  481.      letters.zip  into  the  current directory and subdirectories
  482.      below it, creating any subdirectories as necessary:
  483.  
  484.          unzip letters
  485.  
  486.      To extract all  members  of  letters.zip  into  the  current
  487.      directory only:
  488.  
  489.          unzip -j letters
  490.  
  491.      To test letters.zip, printing only a summary  message  indi-
  492.      cating whether the archive is OK or not:
  493.  
  494.          unzip -tq letters
  495.  
  496.      To test all zipfiles in the current directory, printing only
  497.      the summaries:
  498.  
  499.          unzip -tq \*.zip
  500.  
  501.      (The backslash before the asterisk is only required  if  the
  502.      shell  expands  wildcards,  as  in Unix; double quotes could
  503.      have  been  used  instead,  as  in   the   source   examples
  504.      below.)  To  extract  to  standard  output  all  members  of
  505.      letters.zip whose names end in .tex, auto-converting to  the
  506.      local  end-of-line  convention  and  piping  the output into
  507.      more(1):
  508.  
  509.          unzip -ca letters \*.tex | more
  510.  
  511. Info-ZIP          Last change: 30 Apr 96 (v5.2)                 9
  512.  
  513. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  514.  
  515.      To extract the binary file paper1.dvi to standard output and
  516.      pipe it to a printing program:
  517.  
  518.          unzip -p articles paper1.dvi | dvips
  519.  
  520.      To extract all FORTRAN and C source  files--*.f,  *.c,  *.h,
  521.      and Makefile--into the /tmp directory:
  522.  
  523.          unzip source.zip "*.[fch]" Makefile -d /tmp
  524.  
  525.      (the double quotes are necessary only in Unix  and  only  if
  526.      globbing is turned on).  To extract all FORTRAN and C source
  527.      files, regardless of case (e.g., both *.c and *.C,  and  any
  528.      makefile, Makefile, MAKEFILE or similar):
  529.  
  530.          unzip -C source.zip "*.[fch]" makefile -d /tmp
  531.  
  532.      To extract any such files but convert any  uppercase  MS-DOS
  533.      or  VMS  names  to lowercase and convert the line-endings of
  534.      all of the files to the local standard (without  respect  to
  535.      any files that might be marked ``binary''):
  536.  
  537.          unzip -aaCL source.zip "*.[fch]" makefile -d /tmp
  538.  
  539.      To extract only newer versions of the files already  in  the
  540.      current  directory,  without  querying (NOTE:  be careful of
  541.      unzipping in one timezone a zipfile created in  another--ZIP
  542.      archives  to  date  contain  no  timezone information, and a
  543.      ``newer'' file from an eastern timezone  may,  in  fact,  be
  544.      older):
  545.  
  546.          unzip -fo sources
  547.  
  548.      To extract newer  versions  of  the  files  already  in  the
  549.      current  directory and to create any files not already there
  550.      (same caveat as previous example):
  551.  
  552.          unzip -uo sources
  553.  
  554.      To display a  diagnostic  screen  showing  which  unzip  and
  555.      zipinfo options are stored in environment variables, whether
  556.      decryption support was compiled in, the compiler with  which
  557.      unzip was compiled, etc.:
  558.  
  559.          unzip -v
  560.  
  561.      In the last five examples, assume that UNZIP  or  UNZIP_OPTS
  562.      is set to -q.  To do a singly quiet listing:
  563.  
  564.          unzip -l file.zip
  565.  
  566. Info-ZIP          Last change: 30 Apr 96 (v5.2)                10
  567.  
  568. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  569.  
  570.      To do a doubly quiet listing:
  571.  
  572.          unzip -ql file.zip
  573.  
  574.      (Note that the ``.zip'' is generally not necessary.)  To  do
  575.      a standard listing:
  576.  
  577.          unzip --ql file.zip
  578.      or
  579.          unzip -l-q file.zip
  580.      or
  581.          unzip -l--q file.zip       (extra minuses don't hurt)
  582.  
  583. TIPS
  584.      The current maintainer, being a lazy  sort,  finds  it  very
  585.      useful  to  define  a pair of aliases:  tt for ``unzip -tq''
  586.      and ii for ``unzip -Z'' (or ``zipinfo'').  One may then sim-
  587.      ply  type  ``tt zipfile'' to test an archive, something that
  588.      is worth making a habit of  doing.   With  luck  unzip  will
  589.      report   ``No   errors   detected   in  compressed  data  of
  590.      zipfile.zip,'' after which one may breathe a sigh of relief.
  591.  
  592.      The maintainer  also  finds  it  useful  to  set  the  UNZIP
  593.      environment variable to ``-aL'' and is tempted to add ``-C''
  594.      as well.  His ZIPINFO variable is set to ``-z''.
  595.  
  596. DIAGNOSTICS
  597.      The exit status (or error level) approximates the exit codes
  598.      defined  by PKWARE and takes on the following values, except
  599.      under VMS:
  600.  
  601.           0    normal; no errors or warnings detected.
  602.  
  603.           1    one or more warning errors were  encountered,  but
  604.                processing  completed  successfully  anyway.  This
  605.                includes zipfiles where  one  or  more  files  was
  606.                skipped  due  to unsupported compression method or
  607.                encryption with an unknown password.
  608.  
  609.           2    a  generic  error  in  the  zipfile   format   was
  610.                detected.   Processing may have completed success-
  611.                fully anyway;  some  broken  zipfiles  created  by
  612.                other archivers have simple work-arounds.
  613.  
  614.           3    a severe error in the zipfile format was detected.
  615.                Processing probably failed immediately.
  616.  
  617.           4-8  unzip was unable to allocate  memory  for  one  or
  618.                more buffers.
  619.  
  620.           9    the specified zipfiles were not found.
  621.  
  622. Info-ZIP          Last change: 30 Apr 96 (v5.2)                11
  623.  
  624. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  625.  
  626.           10   invalid options  were  specified  on  the  command
  627.                line.
  628.  
  629.           11   no matching files were found.
  630.  
  631.           50   the disk is (or was) full during extraction.
  632.  
  633.           51   the end of the ZIP archive was encountered  prema-
  634.                turely.
  635.  
  636.      VMS interprets standard Unix (or PC) return values as other,
  637.      scarier-looking  things,  so  unzip  instead  maps them into
  638.      VMS-style status codes.  The current mapping is as  follows:
  639.      1  (success) for normal exit, 0x7fff0001 for warning errors,
  640.      and (0x7fff000? + 16*normal_unzip_exit_status) for all other
  641.      errors,  where  the  `?' is 2 (error) for unzip values 2 and
  642.      9-11, and 4 (fatal error) for the remaining ones  (3-8,  50,
  643.      51).   In  addition, there is a compilation option to expand
  644.      upon this behavior:   defining  RETURN_CODES  results  in  a
  645.      human-readable explanation of what the error status means.
  646.  
  647. BUGS
  648.      Multi-part archives are not yet supported,  except  in  con-
  649.      junction with zip.  (All parts must be concatenated together
  650.      in order, and then ``zip -F'' must be performed on the  con-
  651.      catenated archive in order to ``fix'' it.)  This will defin-
  652.      itely be corrected in the next major release.
  653.  
  654.      Archives read from standard input  are  not  yet  supported,
  655.      except  with  funzip  (and then only the first member of the
  656.      archive can be extracted).
  657.  
  658.      unzip's -M (``more'') option is  overly  simplistic  in  its
  659.      handling  of  screen  output;  as  noted  above, it fails to
  660.      detect the wrapping of long  lines  and  may  thereby  cause
  661.      lines  at  the  top  of the screen to be scrolled off before
  662.      being read.  unzip should detect and treat  each  occurrence
  663.      of  line-wrap as one additional line printed.  This requires
  664.      knowledge of the screen's width as well as its  height.   In
  665.      addition,  unzip  should  detect the true screen geometry on
  666.      all systems.
  667.  
  668.      [MS-DOS] When extracting or testing files from an archive on
  669.      a  defective  floppy  diskette,  if  the  ``Fail'' option is
  670.      chosen from DOS's ``Abort, Retry, Fail?'' message, unzip may
  671.      hang   the  system,  requiring  a  reboot.   Instead,  press
  672.      control-C (or control-Break) to terminate unzip.
  673.  
  674.      Under DEC Ultrix, unzip will sometimes fail on long zipfiles
  675.      (bad  CRC, not always reproducible).  This is apparently due
  676.      either to a hardware bug (cache memory) or an operating sys-
  677.      tem bug (improper handling of page faults?).
  678.  
  679. Info-ZIP          Last change: 30 Apr 96 (v5.2)                12
  680.  
  681. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  682.  
  683.      Dates and times of stored directories are not restored.
  684.  
  685.      [OS/2] Extended  attributes  for  existing  directories  are
  686.      never  updated.   This is a limitation of the operating sys-
  687.      tem; unzip has no way to determine whether the stored attri-
  688.      butes are newer or older than the existing ones.
  689.  
  690.      [VMS] When extracting to another directory, only the  [.foo]
  691.      syntax  is  accepted  for the -d option; the simple Unix foo
  692.      syntax is silently  ignored  (as  is  the  less  common  VMS
  693.      foo.dir syntax).
  694.  
  695.      [VMS] When the file being extracted already exists,  unzip's
  696.      query  only  allows skipping, overwriting or renaming; there
  697.      should additionally be a choice for creating a  new  version
  698.      of  the file.  In fact, the ``overwrite'' choice does create
  699.      a new  version;  the  old  version  is  not  overwritten  or
  700.      deleted.
  701.  
  702. SEE ALSO
  703.      funzip(1L), zip(1L), zipcloak(1L), zipgrep(1L), zipinfo(1L),
  704.      zipnote(1L), zipsplit(1L)
  705.  
  706. AUTHORS
  707.      The primary Info-ZIP authors  (current  zip-bugs  workgroup)
  708.      are:   Greg ``Cave Newt'' Roelofs (UnZip); Onno van der Lin-
  709.      den  (Zip);  Jean-loup  Gailly  (compression);  Mark   Adler
  710.      (decompression,  fUnZip);  Christian  Spieler  (VMS, MS-DOS,
  711.      shared code, general Zip and UnZip integration); Mike  White
  712.      (Windows  GUI,  Windows  DLLs);  Kai Uwe Rommel (OS/2); Paul
  713.      Kienitz (Amiga, Windows 95); Karl Davis  and  Sergio  Monesi
  714.      (Acorn  RISC OS); George Petrov (MVS, VM/CMS); Harald Denker
  715.      (Atari, MVS);  John  Bush  (Amiga);  Hunter  Goatley  (VMS);
  716.      Antoine  Verheijen  (Macintosh); Chris Herborth (Atari, QNX,
  717.      BeBox); Johnny Lee (MS-DOS, NT, Windows 95); Steve Salisbury
  718.      (NT,  Windows  95);  and  Robert  Heath  (Windows GUI).  The
  719.      author of the original unzip code upon which Info-ZIP's  was
  720.      based  is  Samuel  H. Smith; Carl Mascott did the first Unix
  721.      port; and David P. Kirschbaum organized and led Info-ZIP  in
  722.      its  early days.  The full list of contributors to UnZip has
  723.      grown quite large; please refer to the CONTRIBS file in  the
  724.      UnZip source distribution for a relatively complete version.
  725.  
  726. VERSIONS
  727.      v1.2   15 Mar 89   Samuel H. Smith
  728.      v2.0    9 Sep 89   Samuel H. Smith
  729.      v2.x   fall 1989   many Usenet contributors
  730.      v3.0    1 May 90   Info-ZIP (DPK, consolidator)
  731.      v3.1   15 Aug 90   Info-ZIP (DPK, consolidator)
  732.      v4.0    1 Dec 90   Info-ZIP (GRR, maintainer)
  733.      v4.1   12 May 91   Info-ZIP
  734.      v4.2   20 Mar 92   Info-ZIP (zip-bugs subgroup, GRR)
  735.  
  736. Info-ZIP          Last change: 30 Apr 96 (v5.2)                13
  737.  
  738. UNZIP(1L)         MISC. REFERENCE MANUAL PAGES          UNZIP(1L)
  739.  
  740.      v5.0   21 Aug 92   Info-ZIP (zip-bugs subgroup, GRR)
  741.      v5.01  15 Jan 93   Info-ZIP (zip-bugs subgroup, GRR)
  742.      v5.1    7 Feb 94   Info-ZIP (zip-bugs subgroup, GRR)
  743.      v5.11   2 Aug 94   Info-ZIP (zip-bugs subgroup, GRR)
  744.      v5.12  28 Aug 94   Info-ZIP (zip-bugs subgroup, GRR)
  745.      v5.2   30 Apr 96   Info-ZIP (zip-bugs subgroup, GRR)
  746.  
  747. Info-ZIP          Last change: 30 Apr 96 (v5.2)                14
  748.  
  749.