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