home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22x1.zip / MANUAL next >
Text File  |  1997-10-15  |  36KB  |  893 lines

  1.  
  2. ZIP(1L)                              ZIP(1L)
  3.  
  4. NAME
  5.        zip,  zipcloak,    zipnote,  zipsplit - package and compress
  6.        (archive) files
  7.  
  8. SYNOPSIS
  9.        zip [-AcdDeEfFghjklLmoqrRSTuvVwXyz@$]  [-b path]     [-n suf-
  10.        fixes]  [-t mmddyyyy]  [-tt mmddyyyy]  [     zipfile  [ file1
  11.        file2 ...]] [-xi list]
  12.  
  13.        zipcloak [-dhL] [-b path] zipfile
  14.  
  15.        zipnote [-hwL] [-b path] zipfile
  16.  
  17.        zipsplit [-hiLpst] [-n size] [-b path] zipfile
  18.  
  19. DESCRIPTION
  20.        zip is a compression and file packaging utility for  Unix,
  21.        VMS,  MSDOS, OS/2, Windows NT, Minix, Atari and Macintosh,
  22.        Amiga and Acorn RISC OS.
  23.  
  24.        It is analogous to a  combination  of  the  UNIX     commands
  25.        tar(1)  and compress(1) and is compatible with PKZIP (Phil
  26.        Katz's ZIP for MSDOS systems).
  27.  
  28.        A companion program  (unzip(1L)),  unpacks  zip    archives.
  29.        The zip and unzip(1L) programs can work with archives pro-
  30.        duced by PKZIP,    and  PKZIP  and     PKUNZIP  can  work  with
  31.        archives     produced  by zip.  zip version 2.2 is compatible
  32.        with PKZIP 2.04.     Note that PKUNZIP  1.10  cannot  extract
  33.        files  produced    by  PKZIP  2.04     or zip 2.2. You must use
  34.        PKUNZIP 2.04g  or  unzip     5.0p1    (or  later  versions)  to
  35.        extract them.
  36.  
  37.        For a brief help on zip and unzip, run each without speci-
  38.        fying any parameters on the command line.
  39.  
  40.        The program is useful for packaging a  set  of  files  for
  41.        distribution;  for  archiving  files;  and for saving disk
  42.        space by temporarily compressing unused files or     directo-
  43.        ries.
  44.  
  45.        The  zip     program puts one or more compressed files into a
  46.        single zip archive, along with information about the files
  47.        (name,  path, date, time of last modification, protection,
  48.        and check  information  to  verify  file     integrity).   An
  49.        entire  directory  structure  can  be  packed  into  a zip
  50.        archive with a single command.  Compression ratios of  2:1
  51.        to 3:1 are common for text files.  zip has one compression
  52.        method (deflation) and can also store files  without  com-
  53.        pression.  zip automatically chooses the better of the two
  54.        for each file to be compressed.
  55.  
  56.        When given the name of an existing zip archive,    zip  will
  57.        replace    identically  named  entries in the zip archive or
  58.  
  59. Info-ZIP           22 June 1997 (v2.2)            1
  60.  
  61. ZIP(1L)                              ZIP(1L)
  62.  
  63.        add entries for new names.  For example, if foo.zip exists
  64.        and  contains  foo/file1     and foo/file2, and the directory
  65.        foo contains the files foo/file1 and foo/file3, then:
  66.  
  67.           zip -r foo foo
  68.  
  69.        will replace foo/file1 in foo.zip  and  add  foo/file3  to
  70.        foo.zip.       After   this,   foo.zip   contains  foo/file1,
  71.        foo/file2, and foo/file3, with  foo/file2  unchanged  from
  72.        before.
  73.  
  74.        If the file list is specified as -@, zip takes the list of
  75.        input files from standard input.     Under UNIX, this  option
  76.        can  be    used  to  powerful effect in conjunction with the
  77.        find(1) command.     For example, to archive all the C source
  78.        files in the current directory and its subdirectories:
  79.  
  80.           find . -name "*.[ch]" -print | zip source -@
  81.  
  82.        (note  that  the     pattern must be quoted to keep the shell
  83.        from expanding it).  zip will also accept  a  single  dash
  84.        ("-")  as  the  zip file name, in which case it will write
  85.        the zip file to standard output, allowing the output to be
  86.        piped to another program. For example:
  87.  
  88.           zip -r - . | dd of=/dev/nrst0 obs=16k
  89.  
  90.        would  write  the  zip  output directly to a tape with the
  91.        specified block size for the purpose  of     backing  up  the
  92.        current directory.
  93.  
  94.        zip also accepts a single dash ("-") as the name of a file
  95.        to be compressed, in which case it will read the file from
  96.        standard     input,     allowing  zip to take input from another
  97.        program. For example:
  98.  
  99.           tar cf - . | zip backup -
  100.  
  101.        would compress the output of the tar command for the  pur-
  102.        pose  of     backing up the current directory. This generally
  103.        produces better    compression  than  the    previous  example
  104.        using  the  -r  option,    because zip can take advantage of
  105.        redundancy between files. The backup can be restored using
  106.        the command
  107.  
  108.           unzip -p backup | tar xf -
  109.  
  110.        When  no zip file name is given and stdout is not a termi-
  111.        nal, zip acts as a filter, compressing standard    input  to
  112.        standard output.     For example,
  113.  
  114.           tar cf - . | zip | dd of=/dev/nrst0 obs=16k
  115.  
  116.        is equivalent to
  117.  
  118. Info-ZIP           22 June 1997 (v2.2)            2
  119.  
  120. ZIP(1L)                              ZIP(1L)
  121.  
  122.           tar cf - . | zip - - | dd of=/dev/nrst0 obs=16k
  123.  
  124.        zip  archives created in this manner can be extracted with
  125.        the program funzip which is provided in the unzip package,
  126.        or  by  gunzip  which is provided in the gzip package. For
  127.        example:
  128.  
  129.        dd if=/dev/nrst0     ibs=16k | funzip | tar xvf -
  130.  
  131.        When changing an existing zip archive, zip  will     write    a
  132.        temporary file with the new contents, and only replace the
  133.        old one when the process of creating the new  version  has
  134.        been completed without error.
  135.  
  136.        If  the name of the zip archive does not contain an exten-
  137.        sion, the extension .zip is added.  If  the  name  already
  138.        contains     an extension other than .zip the existing exten-
  139.        sion is kept unchanged.
  140.  
  141. OPTIONS
  142.        -A     Adjust self-extracting executable archive.  A self-
  143.           extracting   executable    archive      is  created  by
  144.           prepending the SFX stub to an existing archive. The
  145.           -A  option  tells     zip  to adjust the entry offsets
  146.           stored in the archive to    take  into  account  this
  147.           "preamble" data.
  148.  
  149.        Note: self-extracting archives for the Amiga are a special
  150.        case.  At present, only the Amiga port of Zip  is  capable
  151.        of adjusting or updating these without corrupting them. -J
  152.        can be used to remove the SFX stub if other  updates  need
  153.        to be made.
  154.  
  155.        -b path
  156.           Use  the    specified  path     for  the  temporary  zip
  157.           archive. For example:
  158.  
  159.              zip -b /tmp stuff *
  160.  
  161.           will put the temporary zip archive in the directory
  162.           /tmp,  copying over stuff.zip to the current direc-
  163.           tory when done. This option  is  only  useful  when
  164.           updating    an  existing archive, and the file system
  165.           containing this old archive does    not  have  enough
  166.           space to hold both old and new archives at the same
  167.           time.
  168.  
  169.        -c     Add one-line comments for each file.   File  opera-
  170.           tions  (adding,  updating)  are done first, and the
  171.           user is then prompted for a  one-line  comment  for
  172.           each  file.   Enter the comment followed by return,
  173.           or just return for no comment.
  174.  
  175.        -d     Remove (delete) entries from a  zip  archive.   For
  176.  
  177. Info-ZIP           22 June 1997 (v2.2)            3
  178.  
  179. ZIP(1L)                              ZIP(1L)
  180.  
  181.           example:
  182.  
  183.              zip -d foo foo/tom/junk foo/harry/\* \*.o
  184.  
  185.           will  remove  the     entry    foo/tom/junk,  all of the
  186.           files that start with foo/harry/, and  all  of  the
  187.           files  that  end    with .o (in any path).    Note that
  188.           shell pathname expansion has  been  inhibited  with
  189.           backslashes,  so    that  zip  can see the asterisks,
  190.           enabling zip to match on the contents  of     the  zip
  191.           archive  instead    of  the     contents  of the current
  192.           directory.
  193.  
  194.           Under MSDOS, -d is case sensitive when  it  matches
  195.           names  in the zip archive.  This requires that file
  196.           names be entered in upper case if they were  zipped
  197.           by PKZIP on an MSDOS system.
  198.  
  199.        -D     Do not create entries in the zip archive for direc-
  200.           tories.  Directory entries are created  by  default
  201.           so  that    their  attributes can be saved in the zip
  202.           archive.    The environment variable  ZIPOPT  can  be
  203.           used  to    change    the  default options. For example
  204.           under Unix with sh:
  205.  
  206.              ZIPOPT="-D"; export ZIPOPT
  207.  
  208.           (The variable ZIPOPT can be  used     for  any  option
  209.           except  -i and -x and can include several options.)
  210.           The option -D is a shorthand for -x  "*/"     but  the
  211.           latter cannot be set as default in the ZIPOPT envi-
  212.           ronment variable.
  213.  
  214.        -e     Encrypt the contents of the  zip    archive     using    a
  215.           password    which  is  entered  on    the  terminal  in
  216.           response to a prompt (this will not be  echoed;  if
  217.           standard    error is not a tty, zip will exit with an
  218.           error).  The password prompt is  repeated     to  save
  219.           the user from typing errors.
  220.  
  221.        -f     Replace  (freshen)  an  existing    entry  in the zip
  222.           archive only if it has been modified more     recently
  223.           than the version already in the zip archive; unlike
  224.           the update option (-u) this will not add files that
  225.           are not already in the zip archive.  For example:
  226.  
  227.              zip -f foo
  228.  
  229.           This  command should be run from the same directory
  230.           from which the original zip command was run,  since
  231.           paths stored in zip archives are always relative.
  232.  
  233.           Note  that  the  timezone     environment  variable TZ
  234.           should be set according to the  local  timezone  in
  235.  
  236. Info-ZIP           22 June 1997 (v2.2)            4
  237.  
  238. ZIP(1L)                              ZIP(1L)
  239.  
  240.           order  for  the -f , -u and -o options to work cor-
  241.           rectly.
  242.  
  243.           The reasons behind this  are  somewhat  subtle  but
  244.           have  to    do with the differences between the Unix-
  245.           format file times (always in GMT) and most  of  the
  246.           other operating systems (always local time) and the
  247.           necessity to compare the two.  A typical    TZ  value
  248.           is  ``MET-1MEST''     (Middle European time with auto-
  249.           matic adjustment    for  ``summertime''  or     Daylight
  250.           Savings Time).
  251.  
  252.        -F     Fix  the    zip  archive.  This option can be used if
  253.           some portions of the archive are missing. It is not
  254.           guaranteed  to  work,  so you MUST make a backup of
  255.           the original archive first.
  256.  
  257.           When doubled as in -FF the compressed  sizes  given
  258.           inside  the damaged archive are not trusted and zip
  259.           scans for special signatures to identify the limits
  260.           between  the archive members. The single -F is more
  261.           reliable if the archive is not  too  much     damaged,
  262.           for  example  if it has only been truncated, so try
  263.           this option first.
  264.  
  265.           Neither option will recover archives that have been
  266.           incorrectly  transferred    in  ascii mode instead of
  267.           binary. After the repair, the -t    option    of  unzip
  268.           may show that some files have a bad CRC. Such files
  269.           cannot be recovered; you can remove them    from  the
  270.           archive using the -d option of zip.
  271.  
  272.        -g     Grow (append to) the specified zip archive, instead
  273.           of creating a new one. If this operation fails, zip
  274.           attempts    to  restore  the  archive to its original
  275.           state. If the restoration fails, the archive  might
  276.           become  corrupted.  This    option    is  ignored  when
  277.           there's no existing archive or when  at  least  one
  278.           archive member must be updated or deleted.
  279.  
  280.        -h     Display the zip help information (this also appears
  281.           if zip is run with no arguments).
  282.  
  283.        -i files
  284.           Include only the specified files, as in:
  285.  
  286.              zip -r foo . -i \*.c
  287.  
  288.           which will include only the files that end in .c in
  289.           the current directory and its subdirectories. (Note
  290.           for PKZIP users: the equivalent command is
  291.  
  292.              pkzip -rP foo *.c
  293.  
  294. Info-ZIP           22 June 1997 (v2.2)            5
  295.  
  296. ZIP(1L)                              ZIP(1L)
  297.  
  298.           PKZIP does not allow recursion in directories other
  299.           than  the     current  one.)     The backslash avoids the
  300.           shell  filename  substitution,  so  that    the  name
  301.           matching    is performed by zip at all directory lev-
  302.           els.
  303.  
  304.           Also possible:
  305.  
  306.              zip -r foo     . -i@include.lst
  307.  
  308.           which will only include the files     in  the  current
  309.           directory     and  its  subdirectories  that match the
  310.           patterns in the file include.lst.
  311.  
  312.        -I     Don't scan through  Image     files.     This  option  is
  313.           available     on  Acorn  RISC  OS only; when used, zip
  314.           will not consider Image files (eg.  DOS  partitions
  315.           or Spark archives when SparkFS is loaded) as direc-
  316.           tories but will store them as single files.
  317.  
  318.           For example, if you have SparkFS loaded, zipping    a
  319.           Spark archive will result in a zipfile containing a
  320.           directory (and its content)  while  using     the  'I'
  321.           option  will result in a zipfile containing a Spark
  322.           archive. Obviously this second case  will     also  be
  323.           obtained    (without the 'I' option) if SparkFS isn't
  324.           loaded.
  325.  
  326.        -j     Store just the name  of  a  saved     file  (junk  the
  327.           path),   and  do    not  store  directory  names.  By
  328.           default, zip will store the full path (relative  to
  329.           the current path).
  330.  
  331.        -J     Strip any prepended data (e.g. a SFX stub) from the
  332.           archive.
  333.  
  334.        -k     Attempt to convert the names and paths  to  conform
  335.           to  MSDOS, store only the MSDOS attribute (just the
  336.           user write attribute from UNIX), and mark the entry
  337.           as  made    under MSDOS (even though it was not); for
  338.           compatibility with PKUNZIP under MSDOS which cannot
  339.           handle certain names such as those with two dots.
  340.  
  341.        -l     Translate     the  Unix  end-of-line character LF into
  342.           the MSDOS convention CR LF. This option should  not
  343.           be  used    on binary files.  This option can be used
  344.           on Unix if the zip file  is  intended  for  PKUNZIP
  345.           under  MSDOS. If the input files already contain CR
  346.           LF, this option adds an extra CR. This ensure  that
  347.           unzip -a on Unix will get back an exact copy of the
  348.           original file, to undo the effect of zip -l.
  349.  
  350.        -ll    Translate the MSDOS end-of-line CR LF into Unix LF.
  351.           This  option  should  not     be used on binary files.
  352.  
  353. Info-ZIP           22 June 1997 (v2.2)            6
  354.  
  355. ZIP(1L)                              ZIP(1L)
  356.  
  357.           This option can be used on MSDOS if the zip file is
  358.           intended for unzip under Unix.
  359.  
  360.        -L     Display the zip license.
  361.  
  362.        -m     Move  the     specified  files  into     the zip archive;
  363.           actually, this deletes the target directories/files
  364.           after making the specified zip archive. If a direc-
  365.           tory becomes empty after removal of the files,  the
  366.           directory     is  also  removed. No deletions are done
  367.           until zip has created the     archive  without  error.
  368.           This  is    useful    for conserving disk space, but is
  369.           potentially dangerous so it is recommended  to  use
  370.           it  in  combination  with     -T  to     test the archive
  371.           before removing all input files.
  372.  
  373.        -n suffixes
  374.           Do not attempt to compress  files     named    with  the
  375.           given  suffixes.     Such files are simply stored (0%
  376.           compression) in the output zip file,  so    that  zip
  377.           doesn't  waste  its  time     trying to compress them.
  378.           The suffixes are    separated  by  either  colons  or
  379.           semicolons.  For example:
  380.  
  381.              zip -rn .Z:.zip:.tiff:.gif:.snd  foo foo
  382.  
  383.           will  copy  everything  from  foo into foo.zip, but
  384.           will store any files that end in .Z,  .zip,  .tiff,
  385.           .gif,  or     .snd  without    trying    to  compress them
  386.           (image and sound files often have     their    own  spe-
  387.           cialized    compression  methods).     By  default, zip
  388.           does not compress files with extensions in the list
  389.           .Z:.zip:.zoo:.arc:.lzh:.arj.  Such files are stored
  390.           directly in the output  archive.     The  environment
  391.           variable    ZIPOPT    can be used to change the default
  392.           options. For example under Unix with csh:
  393.  
  394.              setenv ZIPOPT "-n .gif:.zip"
  395.  
  396.           To attempt compression on all files, use:
  397.  
  398.              zip -n : foo
  399.  
  400.           The maximum compression  option  -9  also     attempts
  401.           compression on all files regardless of extension.
  402.  
  403.           On  Acorn RISC OS systems the suffixes are actually
  404.           filetypes (3 hex digit  format).    By  default,  zip
  405.           does  not compress files with filetypes in the list
  406.           DDC:D96:68E (i.e. Archives, CFS files  and  PackDir
  407.           files).
  408.  
  409.        -N     Save  Amiga filenotes as zipfile comments. They can
  410.           be restored by using the -N option of  unzip.  This
  411.  
  412. Info-ZIP           22 June 1997 (v2.2)            7
  413.  
  414. ZIP(1L)                              ZIP(1L)
  415.  
  416.           option  is  available  on     the Amiga only. If -c is
  417.           used also, you are prompted for comments    only  for
  418.           those files that do not have filenotes.
  419.  
  420.        -o     Set  the "last modified" time of the zip archive to
  421.           the latest  (oldest)  "last  modified"  time  found
  422.           among  the entries in the zip archive.  This can be
  423.           used without any other operations, if desired.  For
  424.           example:
  425.  
  426.           zip -o foo
  427.  
  428.           will  change  the     last modified time of foo.zip to
  429.           the latest time of the entries in foo.zip.
  430.  
  431.        -P password
  432.           use password to encrypt zipfile entries  (if  any).
  433.           THIS  IS    INSECURE!  Many multi-user operating sys-
  434.           tems provide ways for any user to see  the  current
  435.           command line of any other user; even on stand-alone
  436.           systems there is always  the  threat  of    over-the-
  437.           shoulder    peeking.   Storing the plaintext password
  438.           as part of a command line in an automated script is
  439.           even  worse.   Whenever possible, use the non-echo-
  440.           ing, interactive prompt to enter    passwords.   (And
  441.           where  security  is  truly  important,  use  strong
  442.           encryption such as Pretty Good Privacy  instead  of
  443.           the relatively weak encryption provided by standard
  444.           zipfile utilities.)
  445.  
  446.        -q     Quiet mode; eliminate  informational  messages  and
  447.           comment  prompts.      (Useful,  for example, in shell
  448.           scripts and background tasks).
  449.  
  450.        -r     Travel the  directory  structure    recursively;  for
  451.           example:
  452.  
  453.              zip -r foo foo
  454.  
  455.           In  this case, all the files and directories in foo
  456.           are saved in a zip archive named foo.zip, including
  457.           files  with  names  starting  with  ".",    since the
  458.           recursion does not use the shell's  file-name  sub-
  459.           stitution mechanism.  If you wish to include only a
  460.           specific subset of the files in directory     foo  and
  461.           its  subdirectories,  use     the -i option to specify
  462.           the pattern of files to be  included.   You  should
  463.           not  use    -r with the name ".*", since that matches
  464.           ".."  which will    attempt     to  zip  up  the  parent
  465.           directory (probably not what was intended).
  466.  
  467.        -R     Travel the directory structure recursively starting
  468.           at the current directory; for example:
  469.  
  470. Info-ZIP           22 June 1997 (v2.2)            8
  471.  
  472. ZIP(1L)                              ZIP(1L)
  473.  
  474.              zip -R foo *.c
  475.  
  476.           In this case, all the files  matching  *.c  in  the
  477.           tree  starting  at the current directory are stored
  478.           into a zip archive named foo.zip.     Note  for  PKZIP
  479.           users: the equivalent command is
  480.  
  481.              pkzip -rP foo *.c
  482.  
  483.        -S     Include  system  and  hidden  files. This option is
  484.           effective on some systems only; it  is  ignored  on
  485.           Unix.
  486.  
  487.        -t mmddyyyy
  488.           Do not operate on files modified prior to the spec-
  489.           ified date, where mm is the month (0-12), dd is the
  490.           day of the month (1-31), and yyyy is the year.  For
  491.           example:
  492.  
  493.              zip -rt 12071991 infamy foo
  494.  
  495.           will add all the files in foo and     its  subdirecto-
  496.           ries that were last modified on or after 7 December
  497.           1991, to the zip archive infamy.zip.
  498.  
  499.        -tt mmddyyyy
  500.           Do not operate on files modified after  or  at  the
  501.           specified date, where mm is the month (0-12), dd is
  502.           the day of the month (1-31), and yyyy is the  year.
  503.           For example:
  504.  
  505.              zip -rtt 11301995 infamy foo
  506.  
  507.           will  add     all the files in foo and its subdirecto-
  508.           ries that were last modified before the 30 November
  509.           1995, to the zip archive infamy.zip.
  510.  
  511.        -T     Test  the     integrity  of    the  new zip file. If the
  512.           check fails, the old  zip     file  is  unchanged  and
  513.           (with the -m option) no input files are removed.
  514.  
  515.        -u     Replace  (update)     an  existing  entry  in  the zip
  516.           archive only if it has been modified more     recently
  517.           than  the     version already in the zip archive.  For
  518.           example:
  519.  
  520.              zip -u stuff *
  521.  
  522.           will add any new files in     the  current  directory,
  523.           and update any files which have been modified since
  524.           the zip archive stuff.zip was last created/modified
  525.           (note  that zip will not try to pack stuff.zip into
  526.           itself when you do this).
  527.  
  528. Info-ZIP           22 June 1997 (v2.2)            9
  529.  
  530. ZIP(1L)                              ZIP(1L)
  531.  
  532.           Note that the -u option with no arguments acts like
  533.           the -f (freshen) option.
  534.  
  535.        -v     Verbose mode or print diagnostic version info.
  536.  
  537.           Normally,     when  applied    to  real operations, this
  538.           option enables the display of a progress    indicator
  539.           during  compression and requests verbose diagnostic
  540.           info about zipfile structure oddities.
  541.  
  542.           When -v is the only command line argument, and std-
  543.           out  is  not  redirected    to  a  file, a diagnostic
  544.           screen is printed. In addition to the  help  screen
  545.           header  with  program  name,  version,  and release
  546.           date, some pointers to the Info-ZIP home    and  dis-
  547.           tribution     sites are given. Then, it shows informa-
  548.           tion about the target  environment  (compiler  type
  549.           and  version,  OS version, compilation date and the
  550.           enabled optional features used to     create     the  zip
  551.           executable.
  552.  
  553.        -V     Save  VMS file attributes. This option is available
  554.           on VMS only; zip archives created with this  option
  555.           will generally not be usable on other systems.
  556.  
  557.        -w     Append the version number of the files to the name,
  558.           including multiple versions of files.   (VMS  only;
  559.           default:    use  only  the    most  recent version of a
  560.           specified file).
  561.  
  562.        -x files
  563.           Explicitly exclude the specified files, as in:
  564.  
  565.              zip -r foo foo -x \*.o
  566.  
  567.           which will include the contents of foo  in  foo.zip
  568.           while  excluding all the files that end in .o.  The
  569.           backslash avoids the shell  filename  substitution,
  570.           so  that    the  name matching is performed by zip at
  571.           all directory levels.
  572.  
  573.           Also possible:
  574.  
  575.              zip -r foo foo -x@exclude.lst
  576.  
  577.           which will include the contents of foo  in  foo.zip
  578.           while  excluding    all the files that match the pat-
  579.           terns in the file exclude.lst.
  580.  
  581.        -X     Do  not  save  extra  file   attributes    (Extended
  582.           Attributes  on  OS/2,  uid/gid  and  file     times on
  583.           Unix).
  584.  
  585.        -y     Store symbolic links as such in  the  zip     archive,
  586.  
  587. Info-ZIP           22 June 1997 (v2.2)               10
  588.  
  589. ZIP(1L)                              ZIP(1L)
  590.  
  591.           instead    of   compressing  and  storing    the  file
  592.           referred to by the link (UNIX only).
  593.  
  594.        -z     Prompt for a multi-line comment for the entire  zip
  595.           archive.    The comment is ended by a line containing
  596.           just a period, or an end of file condition  (^D  on
  597.           UNIX, ^Z on MSDOS, OS/2, and VAX/VMS).  The comment
  598.           can be taken from a file:
  599.  
  600.              zip -z foo < foowhat
  601.  
  602.        -#     Regulate the speed of compression using the  speci-
  603.           fied  digit  #,  where  -0 indicates no compression
  604.           (store all files), -1 indicates  the  fastest  com-
  605.           pression method (less compression) and -9 indicates
  606.           the slowest compression  method  (optimal     compres-
  607.           sion,  ignores  the  suffix list). The default com-
  608.           pression level is -6.
  609.  
  610.        -@     Take the list of input files from     standard  input.
  611.           Only one filename per line.
  612.  
  613.        -$     Include  the volume label for the the drive holding
  614.           the first file to be compressed.    If  you     want  to
  615.           include  only  the  volume label or to force a spe-
  616.           cific drive, use the drive name as first file name,
  617.           as in:
  618.  
  619.              zip -$ foo a: c:bar
  620.  
  621.           This  option  is    effective  on  some  systems only
  622.           (MSDOS and OS/2); it is ignored on Unix.
  623.  
  624. EXAMPLES
  625.        The simplest example:
  626.  
  627.           zip stuff *
  628.  
  629.        creates the archive stuff.zip (assuming it does not exist)
  630.        and  puts all the files in the current directory in it, in
  631.        compressed form (the .zip suffix is  added  automatically,
  632.        unless  that  archive  name  given contains a dot already;
  633.        this allows the explicit specification of other suffixes).
  634.  
  635.        Because    of  the way the shell does filename substitution,
  636.        files starting with "." are not included; to include these
  637.        as well:
  638.  
  639.           zip stuff .* *
  640.  
  641.        Even  this  will     not  include any subdirectories from the
  642.        current directory.
  643.  
  644.        To zip up an entire directory, the command:
  645.  
  646. Info-ZIP           22 June 1997 (v2.2)               11
  647.  
  648. ZIP(1L)                              ZIP(1L)
  649.  
  650.           zip -r foo foo
  651.  
  652.        creates the archive foo.zip, containing all the files  and
  653.        directories  in the directory foo that is contained within
  654.        the current directory.
  655.  
  656.        You may want to make a zip archive that contains the files
  657.        in  foo,     without  recording the directory name, foo.  You
  658.        can use the -j option to leave off the paths, as in:
  659.  
  660.           zip -j foo foo/*
  661.  
  662.        If you are short on disk space, you might not have  enough
  663.        room  to     hold  both the original directory and the corre-
  664.        sponding compressed zip archive.     In this  case,     you  can
  665.        create  the  archive in steps using the -m option.  If foo
  666.        contains the subdirectories tom, dick, and harry, you can:
  667.  
  668.           zip -rm foo foo/tom
  669.           zip -rm foo foo/dick
  670.           zip -rm foo foo/harry
  671.  
  672.        where  the first command creates foo.zip, and the next two
  673.        add to it.  At the completion of     each  zip  command,  the
  674.        last  created archive is deleted, making room for the next
  675.        zip command to function.
  676.  
  677. PATTERN MATCHING
  678.        This section applies only to UNIX.  Watch this  space  for
  679.        details on MSDOS and VMS operation.
  680.  
  681.        The  UNIX  shells (sh(1) and csh(1)) do filename substitu-
  682.        tion on command arguments.  The special characters are:
  683.  
  684.        ?      match any single character
  685.  
  686.        *      match any number of characters (including none)
  687.  
  688.        []     match any character in the range    indicated  within
  689.           the brackets (example: [a-f], [0-9]).
  690.  
  691.        When  these  characters    are  encountered  (without  being
  692.        escaped with a backslash or quotes), the shell  will  look
  693.        for files relative to the current path that match the pat-
  694.        tern, and replace the argument with a list  of  the  names
  695.        that matched.
  696.  
  697.        The zip program can do the same matching on names that are
  698.        in the zip archive being modified or, in the case  of  the
  699.        -x (exclude) or -i (include) options, on the list of files
  700.        to be operated on, by using backslashes or quotes to  tell
  701.        the  shell not to do the name expansion.     In general, when
  702.        zip encounters a name in the list of files to do, it first
  703.        looks for the name in the file system.  If it finds it, it
  704.  
  705. Info-ZIP           22 June 1997 (v2.2)               12
  706.  
  707. ZIP(1L)                              ZIP(1L)
  708.  
  709.        then adds it to the list of files to do.     If it    does  not
  710.        find  it,  it  looks for the name in the zip archive being
  711.        modified (if it exists), using the pattern matching  char-
  712.        acters  described  above,  if present.  For each match, it
  713.        will add that name to the list of files to  be  processed,
  714.        unless  this name matches one given with the -x option, or
  715.        does not match any name given with the -i option.
  716.  
  717.        The pattern matching includes the path,    and  so     patterns
  718.        like \*.o match names that end in ".o", no matter what the
  719.        path prefix is.    Note  that  the     backslash  must  precede
  720.        every  special  character (i.e. ?*[]), or the entire argu-
  721.        ment must be enclosed in double quotes ("").
  722.  
  723.        In general, use backslash  to  make  zip     do  the  pattern
  724.        matching     with  the  -f (freshen) and -d (delete) options,
  725.        and sometimes after the -x (exclude) option when used with
  726.        an appropriate operation (add, -u, -f, or -d).
  727.  
  728. SEE ALSO
  729.        compress(1), shar(1L), tar(1), unzip(1L), gzip(1L)
  730.  
  731. DIAGNOSTICS
  732.        The  exit  status  (or  error level) approximates the exit
  733.        codes defined by PKWARE and takes on the following values,
  734.        except under VMS:
  735.  
  736.           0         normal; no errors or warnings detected.
  737.  
  738.           2         unexpected end of zip file.
  739.  
  740.           3         a    generic     error    in the zipfile format was
  741.              detected.     Processing  may  have    completed
  742.              successfully  anyway;  some  broken zipfiles
  743.              created by other archivers have simple work-
  744.              arounds.
  745.  
  746.           4         zip was unable to allocate memory for one or
  747.              more buffers during program  initialization.
  748.  
  749.           5         a    severe    error  in  the zipfile format was
  750.              detected.    Processing probably failed  imme-
  751.              diately.
  752.  
  753.           6         entry too large to be split with zipsplit
  754.  
  755.           7         invalid comment format
  756.  
  757.           8         zip -T failed or out of memory
  758.  
  759.           9         the  user    aborted zip prematurely with con-
  760.              trol-C (or similar)
  761.  
  762.           10     zip encountered an error while using a  temp
  763.  
  764. Info-ZIP           22 June 1997 (v2.2)               13
  765.  
  766. ZIP(1L)                              ZIP(1L)
  767.  
  768.              file
  769.  
  770.           11     read or seek error
  771.  
  772.           12     zip has nothing to do
  773.  
  774.           13     missing or empty zip file
  775.  
  776.           14     error writing to a file
  777.  
  778.           15     zip was unable to create a file to write to
  779.  
  780.           16     bad command line parameters
  781.  
  782.           18     zip could not open a specified file to read
  783.  
  784.        VMS  interprets    standard  Unix    (or  PC) return values as
  785.        other, scarier-looking things, so zip  instead  maps  them
  786.        into  VMS-style    status    codes.    The current mapping is as
  787.        follows:      1 (success) for normal exit,
  788.     and  (0x7fff000?  +  16*normal_zip_exit_status)     for  all
  789.        errors,    where  the `?' is 0 (warning) for zip value 12, 2
  790.        (error) for the zip values 3, 6, 7, 9, 13, 16, 18,  and    4
  791.        (fatal error) for the remaining ones.
  792.  
  793. BUGS
  794.        zip  2.2     is not compatible with PKUNZIP 1.10. Use zip 1.1
  795.        to produce zip files which can  be  extracted  by  PKUNZIP
  796.        1.10.
  797.  
  798.        zip  files  produced by zip 2.2 must not be updated by zip
  799.        1.1 or PKZIP 1.10, if they contain encrypted members or if
  800.        they  have  been     produced  in a pipe or on a non-seekable
  801.        device. The old versions of zip or PKZIP would  create  an
  802.        archive    with  an  incorrect format.  The old versions can
  803.        list the contents of the zip file but  cannot  extract  it
  804.        anyway (because of the new compression algorithm).  If you
  805.        do not use encryption and use regular disk files,  you  do
  806.        not have to care about this problem.
  807.  
  808.        Under  VMS,  not     all  of the odd file formats are treated
  809.        properly.  Only stream-LF format zip files are expected to
  810.        work  with  zip.      Others  can  be  converted  using Rahul
  811.        Dhesi's BILF program.  This version of zip handles some of
  812.        the  conversion internally.  When using Kermit to transfer
  813.        zip files from Vax to MSDOS, type "set file type block" on
  814.        the  Vax.   When     transfering from MSDOS to Vax, type "set
  815.        file type fixed" on the Vax.  In     both  cases,  type  "set
  816.        file type binary" on MSDOS.
  817.  
  818.        Under VMS, zip hangs for file specification that uses DEC-
  819.        net syntax foo::*.*.
  820.  
  821.        On OS/2, zip  cannot  match  some  names,  such    as  those
  822.  
  823. Info-ZIP           22 June 1997 (v2.2)               14
  824.  
  825. ZIP(1L)                              ZIP(1L)
  826.  
  827.        including  an  exclamation mark or a hash sign.    This is a
  828.        bug in OS/2 itself:  the     32-bit     DosFindFirst/Next  don't
  829.        find  such names.  Other programs such as GNU tar are also
  830.        affected by this bug.
  831.  
  832.        Under OS/2, the amount of Extended Attributes displayed by
  833.        DIR  is    (for  compatibility)  the  amount returned by the
  834.        16-bit version of DosQueryPathInfo(). Otherwise    OS/2  1.3
  835.        and  2.0     would    report    different  EA sizes when DIRing a
  836.        file.  However,    the  structure    layout    returned  by  the
  837.        32-bit  DosQueryPathInfo()  is  a  bit  different, it uses
  838.        extra padding bytes and link pointers (it's a linked list)
  839.        to have all fields on 4-byte boundaries for portability to
  840.        future RISC OS/2 versions. Therefore the value reported by
  841.        zip  (which  uses this 32-bit-mode size) differs from that
  842.        reported by DIR.     zip stores the 32-bit format for  porta-
  843.        bility,    even  the 16-bit MS-C-compiled version running on
  844.        OS/2 1.3, so even this one shows the 32-bit-mode size.
  845.  
  846. AUTHORS
  847.        Copyright (C) 1990-1997    Mark  Adler,  Richard  B.  Wales,
  848.        Jean-loup  Gailly,  Onno     van  der Linden, Kai Uwe Rommel,
  849.        Igor Mandrichenko, John Bush and Paul Kienitz.  Permission
  850.        is  granted to any individual or institution to use, copy,
  851.        or redistribute this software so long as all of the origi-
  852.        nal  files  are    included, that it is not sold for profit,
  853.        and that this copyright notice is retained.
  854.  
  855.        LIKE ANYTHING ELSE THAT'S FREE,    ZIP  AND  ITS  ASSOCIATED
  856.        UTILITIES  ARE PROVIDED AS IS AND COME WITH NO WARRANTY OF
  857.        ANY KIND, EITHER EXPRESSED OR IMPLIED. IN  NO  EVENT  WILL
  858.        THE  COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES RESULTING
  859.        FROM THE USE OF THIS SOFTWARE.
  860.  
  861.        Please  send  bug  reports  and    comments  by  email   to:
  862.        zip-bugs@lists.wku.edu.     For  bug reports, please include
  863.        the version of zip (see zip-h ), the make options used  to
  864.        compile    it  see zip-v ), the machine and operating system
  865.        in use, and as much additional information as possible.
  866.  
  867. ACKNOWLEDGEMENTS
  868.        Thanks to R. P. Byrne for his  Shrink.Pas  program,  which
  869.        inspired this project, and from which the shrink algorithm
  870.        was stolen; to Phil Katz for placing in the public  domain
  871.        the zip file format, compression format, and .ZIP filename
  872.        extension, and for accepting minor  changes  to    the  file
  873.        format;    to  Steve  Burg for clarifications on the deflate
  874.        format; to Haruhiko Okumura and Leonid Broukhis    for  pro-
  875.        viding some useful ideas for the compression algorithm; to
  876.        Keith Petersen, Rich Wales, Hunter Goatley and Mark  Adler
  877.        for providing a mailing list and ftp site for the Info-ZIP
  878.        group to use; and most importantly, to the Info-ZIP  group
  879.        itself  (listed    in  the     file  infozip.who) without whose
  880.        tireless testing and bug-fixing    efforts     a  portable  zip
  881.  
  882. Info-ZIP           22 June 1997 (v2.2)               15
  883.  
  884. ZIP(1L)                              ZIP(1L)
  885.  
  886.        would  not  have     been  possible.  Finally we should thank
  887.        (blame) the first Info-ZIP  moderator,  David  Kirschbaum,
  888.        for  getting  us     into  this mess in the first place.  The
  889.        manual page was rewritten for UNIX by R. P. C. Rodgers.
  890.  
  891. Info-ZIP           22 June 1997 (v2.2)               16
  892.  
  893.