home *** CD-ROM | disk | FTP | other *** search
/ Internet File Formats / InternetFileFormatsCD.bin / compress / zip / windows / win95 / unzip.doc < prev    next >
Encoding:
Text File  |  1994-08-25  |  33.3 KB  |  706 lines

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