1ZIP(1L)                                                                ZIP(1L)
2
3
4

NAME

6       zip - package and compress (archive) files
7

SYNOPSIS

9       zip  [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [--longoption ...]  [-b path]
10       [-n suffixes] [-t date] [-tt date] [zipfile [file ...]]  [-xi list]
11
12       zipcloak (see separate man page)
13
14       zipnote (see separate man page)
15
16       zipsplit (see separate man page)
17
18       Note:  Command line processing in zip has been changed to support  long
19       options  and  handle all options and arguments more consistently.  Some
20       old command lines that depend on command line  inconsistencies  may  no
21       longer work.
22

DESCRIPTION

24       zip  is  a compression and file packaging utility for Unix, VMS, MSDOS,
25       OS/2, Windows 9x/NT/XP, Minix, Atari, Macintosh, Amiga, and Acorn  RISC
26       OS.   It  is analogous to a combination of the Unix commands tar(1) and
27       compress(1) and is compatible with PKZIP (Phil  Katz's  ZIP  for  MSDOS
28       systems).
29
30       A  companion  program  (unzip(1L))  unpacks  zip archives.  The zip and
31       unzip(1L) programs can work with archives produced by PKZIP (supporting
32       most PKZIP features up to PKZIP version 4.6), and PKZIP and PKUNZIP can
33       work with archives produced  by  zip  (with  some  exceptions,  notably
34       streamed  archives,  but  recent  changes  in the zip file standard may
35       facilitate better compatibility).  zip version 3.0 is  compatible  with
36       PKZIP  2.04  and  also supports the Zip64 extensions of PKZIP 4.5 which
37       allow archives as well as files to exceed the previous 2 GB limit (4 GB
38       in  some  cases).  zip also now supports bzip2 compression if the bzip2
39       library is included when zip is compiled.  Note that PKUNZIP 1.10  can‐
40       not extract files produced by PKZIP 2.04 or zip 3.0. You must use PKUN‐
41       ZIP 2.04g or unzip 5.0p1 (or later versions) to extract them.
42
43       See the EXAMPLES section at the bottom of this  page  for  examples  of
44       some typical uses of zip.
45
46       Large Archives and Zip64.   zip automatically uses the Zip64 extensions
47       when files larger than 4 GB are added to an archive,  an  archive  con‐
48       taining  Zip64 entries is updated (if the resulting archive still needs
49       Zip64), the size of the archive will exceed 4 GB, or when the number of
50       entries  in  the archive will exceed about 64K.  Zip64 is also used for
51       archives streamed from standard input as the size of such archives  are
52       not  known  in advance, but the option -fz- can be used to force zip to
53       create PKZIP 2 compatible archives (as long as Zip64 extensions are not
54       needed).   You must use a PKZIP 4.5 compatible unzip, such as unzip 6.0
55       or later, to extract files using the Zip64 extensions.
56
57       In addition, streamed archives, entries encrypted with standard encryp‐
58       tion,  or  split archives created with the pause option may not be com‐
59       patible with PKZIP as data descriptors are used and PKZIP at  the  time
60       of  this  writing does not support data descriptors (but recent changes
61       in the PKWare published zip standard now include some support  for  the
62       data descriptor format zip uses).
63
64
65       Mac  OS  X.   Though  previous Mac versions had their own zip port, zip
66       supports Mac OS X as part of the  Unix  port  and  most  Unix  features
67       apply.   References  to "MacOS" below generally refer to MacOS versions
68       older than OS X.  Support for some Mac OS features in the Unix Mac OS X
69       port, such as resource forks, is expected in the next zip release.
70
71
72       For  a  brief  help  on  zip and unzip, run each without specifying any
73       parameters on the command line.
74
75

USE

77       The program is useful for packaging a set of  files  for  distribution;
78       for archiving files; and for saving disk space by temporarily compress‐
79       ing unused files or directories.
80
81       The zip program puts one or more compressed files into a single zip ar‐
82       chive,  along  with information about the files (name, path, date, time
83       of last modification, protection, and check information to verify  file
84       integrity).  An entire directory structure can be packed into a zip ar‐
85       chive with a single command.  Compression ratios of 2:1 to 3:1 are com‐
86       mon for text files.  zip has one compression method (deflation) and can
87       also store files without compression.  (If bzip2 support is added,  zip
88       can  also  compress using bzip2 compression, but such entries require a
89       reasonably modern unzip  to  decompress.   When  bzip2  compression  is
90       selected,  it replaces deflation as the default method.)  zip automati‐
91       cally chooses the better of the two (deflation or store or, if bzip2 is
92       selected, bzip2 or store) for each file to be compressed.
93
94       Command format.  The basic command format is
95
96              zip options archive inpath inpath ...
97
98       where  archive  is a new or existing zip archive and inpath is a direc‐
99       tory or file path optionally including wildcards.  When given the  name
100       of  an existing zip archive, zip will replace identically named entries
101       in the zip archive (matching the relative names as stored  in  the  ar‐
102       chive)  or  add  entries for new names.  For example, if foo.zip exists
103       and contains foo/file1 and foo/file2, and the  directory  foo  contains
104       the files foo/file1 and foo/file3, then:
105
106              zip -r foo.zip foo
107
108       or more concisely
109
110              zip -r foo foo
111
112       will  replace foo/file1 in foo.zip and add foo/file3 to foo.zip.  After
113       this,  foo.zip  contains  foo/file1,  foo/file2,  and  foo/file3,  with
114       foo/file2 unchanged from before.
115
116       So if before the zip command is executed foo.zip has:
117
118               foo/file1 foo/file2
119
120       and directory foo has:
121
122               file1 file3
123
124       then foo.zip will have:
125
126               foo/file1 foo/file2 foo/file3
127
128       where foo/file1 is replaced and foo/file3 is new.
129
130       -@ file lists.   If  a file list is specified as -@ [Not on MacOS], zip
131       takes the list of input files from standard input instead of  from  the
132       command line.  For example,
133
134              zip -@ foo
135
136       will store the files listed one per line on stdin in foo.zip.
137
138       Under  Unix,  this option can be used to powerful effect in conjunction
139       with the find (1) command.  For example, to archive all  the  C  source
140       files in the current directory and its subdirectories:
141
142              find . -name "*.[ch]" -print | zip source -@
143
144       (note  that the pattern must be quoted to keep the shell from expanding
145       it).
146
147       Streaming input and output.  zip will also accept a single  dash  ("-")
148       as the zip file name, in which case it will write the zip file to stan‐
149       dard output, allowing the output to be piped to  another  program.  For
150       example:
151
152              zip -r - . | dd of=/dev/nrst0 obs=16k
153
154       would  write the zip output directly to a tape with the specified block
155       size for the purpose of backing up the current directory.
156
157       zip also accepts a single dash ("-") as the name of a file to  be  com‐
158       pressed,  in  which  case  it  will  read the file from standard input,
159       allowing zip to take input from another program. For example:
160
161              tar cf - . | zip backup -
162
163       would compress the output of the tar command for the purpose of backing
164       up  the  current  directory. This generally produces better compression
165       than the previous example using the -r  option  because  zip  can  take
166       advantage of redundancy between files. The backup can be restored using
167       the command
168
169              unzip -p backup | tar xf -
170
171       When no zip file name is given and stdout is not a terminal,  zip  acts
172       as  a filter, compressing standard input to standard output.  For exam‐
173       ple,
174
175              tar cf - . | zip | dd of=/dev/nrst0 obs=16k
176
177       is equivalent to
178
179              tar cf - . | zip - - | dd of=/dev/nrst0 obs=16k
180
181       zip archives created in this manner can be extracted with  the  program
182       funzip  which  is  provided in the unzip package, or by gunzip which is
183       provided in the gzip package (but some gunzip may not support  this  if
184       zip used the Zip64 extensions). For example:
185
186              dd if=/dev/nrst0  ibs=16k | funzip | tar xvf -
187
188       The stream can also be saved to a file and unzip used.
189
190       If  Zip64  support  for  large files and archives is enabled and zip is
191       used as a filter, zip creates a Zip64 archive that requires a PKZIP 4.5
192       or  later compatible unzip to read it.  This is to avoid amgibuities in
193       the zip file structure as defined in the current zip  standard  (PKWARE
194       AppNote)  where  the decision to use Zip64 needs to be made before data
195       is written for the entry, but for a stream the size of the data is  not
196       known at that point.  If the data is known to be smaller than 4 GB, the
197       option -fz- can be used to prevent use of Zip64, but zip will exit with
198       an  error if Zip64 was in fact needed.  zip 3 and unzip 6 and later can
199       read archives with Zip64 entries.  Also, zip removes the  Zip64  exten‐
200       sions  if  not  needed  when  archive  entries  are  copied (see the -U
201       (--copy) option).
202
203       When directing the output to another file, note that all options should
204       be before the redirection including -x.  For example:
205
206              zip archive "*.h" "*.c" -x donotinclude.h orthis.h > tofile
207
208       Zip files.   When  changing  an  existing zip archive, zip will write a
209       temporary file with the new contents, and only replace the old one when
210       the  process  of  creating  the  new version has been completed without
211       error.
212
213       If the name of the zip archive  does  not  contain  an  extension,  the
214       extension  .zip  is  added.  If  the name already contains an extension
215       other than .zip, the existing extension is  kept  unchanged.   However,
216       split  archives  (archives  split over multiple files) require the .zip
217       extension on the last split.
218
219       Scanning and reading files.  When zip starts, it  scans  for  files  to
220       process  (if  needed).  If this scan takes longer than about 5 seconds,
221       zip will display  a  "Scanning  files"  message  and  start  displaying
222       progress  dots  every  2  seconds  or  every so many entries processed,
223       whichever takes longer.  If there is more than 2 seconds  between  dots
224       it  could indicate that finding each file is taking time and could mean
225       a slow network connection for example.  (Actually the initial file scan
226       is  a  two-step  process where the directory scan is followed by a sort
227       and these two steps are separated with a space in the dots.  If  updat‐
228       ing an existing archive, a space also appears between the existing file
229       scan and the new file scan.)  The scanning  files  dots  are  not  con‐
230       trolled  by the -ds dot size option, but the dots are turned off by the
231       -q quiet option.  The -sf show files option can be  used  to  scan  for
232       files  and  get  the  list of files scanned without actually processing
233       them.
234
235       If zip is not able to read a file, it issues a warning  but  continues.
236       See  the -MM option below for more on how zip handles patterns that are
237       not matched and files that  are  not  readable.   If  some  files  were
238       skipped, a warning is issued at the end of the zip operation noting how
239       many files were read and how many skipped.
240
241       Command modes.  zip now supports two distinct types of  command  modes,
242       external  and  internal.  The external modes (add, update, and freshen)
243       read files from the file system (as well as from an  existing  archive)
244       while  the  internal  modes  (delete  and  copy) operate exclusively on
245       entries in an existing archive.
246
247       add
248              Update existing entries and add new files.  If the archive  does
249              not exist create it.  This is the default mode.
250
251       update (-u)
252              Update  existing entries if newer on the file system and add new
253              files.  If the archive does not exist issue warning then  create
254              a new archive.
255
256       freshen (-f)
257              Update  existing entries of an archive if newer on the file sys‐
258              tem.  Does not add new files to the archive.
259
260       delete (-d)
261              Select entries in an existing archive and delete them.
262
263       copy (-U)
264              Select entries in an existing archive and copy them to a new ar‐
265              chive.  This new mode is similar to update but command line pat‐
266              terns select entries in the existing archive rather  than  files
267              from  the  file system and it uses the --out option to write the
268              resulting archive to a new file rather than update the  existing
269              archive, leaving the original archive unchanged.
270
271       The new File Sync option (-FS) is also considered a new mode, though it
272       is similar to update.  This mode  synchronizes  the  archive  with  the
273       files  on  the OS, only replacing files in the archive if the file time
274       or size of the OS file is different, adding  new  files,  and  deleting
275       entries from the archive where there is no matching file.  As this mode
276       can delete entries from the archive, consider making a backup  copy  of
277       the archive.
278
279       Also see -DF for creating difference archives.
280
281       See  each option description below for details and the EXAMPLES section
282       below for examples.
283
284       Split archives.  zip version 3.0 and later can create  split  archives.
285       A  split  archive  is a standard zip archive split over multiple files.
286       (Note that split archives are not just archives split in to pieces,  as
287       the  offsets of entries are now based on the start of each split.  Con‐
288       catenating the pieces together will invalidate these offsets, but unzip
289       can  usually  deal  with it.  zip will usually refuse to process such a
290       spliced archive unless the -FF fix option is used to fix the offsets.)
291
292       One use of split archives is storing a large archive on multiple remov‐
293       able media.  For a split archive with 20 split files the files are typ‐
294       ically named (replace ARCHIVE  with  the  name  of  your  archive)  AR‐
295       CHIVE.z01,  ARCHIVE.z02,  ..., ARCHIVE.z19, ARCHIVE.zip.  Note that the
296       last file is the .zip file.  In  contrast,  spanned  archives  are  the
297       original  multi-disk archive generally requiring floppy disks and using
298       volume labels to store disk numbers.  zip supports split  archives  but
299       not  spanned  archives,  though a procedure exists for converting split
300       archives of the right size to spanned archives.  The  reverse  is  also
301       true,  where  each  file of a spanned archive can be copied in order to
302       files with the above names to create a split archive.
303
304       Use -s to set the split size and create a split archive.  The  size  is
305       given as a number followed optionally by one of k (kB), m (MB), g (GB),
306       or t (TB) (the default is m).  The -sp option can be used to pause  zip
307       between splits to allow changing removable media, for example, but read
308       the descriptions and warnings for both -s and -sp below.
309
310       Though zip does not update split archives, zip provides the new  option
311       -O  (--output-file  or --out) to allow split archives to be updated and
312       saved in a new archive.  For example,
313
314              zip inarchive.zip foo.c bar.c --out outarchive.zip
315
316       reads archive inarchive.zip, even if split, adds the  files  foo.c  and
317       bar.c,  and  writes  the resulting archive to outarchive.zip.  If inar‐
318       chive.zip is split then outarchive.zip defaults to the same split size.
319       Be  aware  that  if outarchive.zip and any split files that are created
320       with it already exist, these are always overwritten as  needed  without
321       warning.  This may be changed in the future.
322
323       Unicode.   Though the zip standard requires storing paths in an archive
324       using a specific character set, in practice zips have stored  paths  in
325       archives in whatever the local character set is.  This creates problems
326       when an archive is created or updated on a system using  one  character
327       set  and  then  extracted on another system using a different character
328       set.  When compiled with Unicode support enabled on platforms that sup‐
329       port wide characters, zip now stores, in addition to the standard local
330       path for backward compatibility, the UTF-8  translation  of  the  path.
331       This  provides  a common universal character set for storing paths that
332       allows these paths to be fully extracted on other systems that  support
333       Unicode and to match as close as possible on systems that don't.
334
335       On  Win32 systems where paths are internally stored as Unicode but rep‐
336       resented in the local character set, it's possible that some paths will
337       be  skipped during a local character set directory scan.  zip with Uni‐
338       code support now can read and store these paths.  Note that Win 9x sys‐
339       tems and FAT file systems don't fully support Unicode.
340
341       Be aware that console windows on Win32 and Unix, for example, sometimes
342       don't accurately show all characters due to how each  operating  system
343       switches  in character sets for display.  However, directory navigation
344       tools should show the correct paths if the needed fonts are loaded.
345
346       Command line format.  This version of zip has updated command line pro‐
347       cessing and support for long options.
348
349       Short options take the form
350
351              -s[-][s[-]...][value][=value][ value]
352
353       where  s  is  a one or two character short option.  A short option that
354       takes a value is last in an argument and anything after it is taken  as
355       the  value.   If  the option can be negated and "-" immediately follows
356       the option, the option is negated.  Short options can also be given  as
357       separate arguments
358
359              -s[-][value][=value][ value] -s[-][value][=value][ value] ...
360
361       Short  options  in general take values either as part of the same argu‐
362       ment or as the following argument.  An optional =  is  also  supported.
363       So
364
365              -ttmmddyyyy
366
367       and
368
369              -tt=mmddyyyy
370
371       and
372
373              -tt mmddyyyy
374
375       all  work.   The  -x  and  -i  options accept lists of values and use a
376       slightly different format described below.  See the -x and -i options.
377
378       Long options take the form
379
380              --longoption[-][=value][ value]
381
382       where the option starts with --, has a multicharacter name, can include
383       a  trailing  dash to negate the option (if the option supports it), and
384       can have a value (option argument) specified by preceeding  it  with  =
385       (no spaces).  Values can also follow the argument.  So
386
387              --before-date=mmddyyyy
388
389       and
390
391              --before-date mmddyyyy
392
393       both work.
394
395       Long option names can be shortened to the shortest unique abbreviation.
396       See the option descriptions below for which support long  options.   To
397       avoid confusion, avoid abbreviating a negatable option with an embedded
398       dash ("-") at the dash if you plan to negate it (the parser would  con‐
399       sider  a  trailing  dash,  such  as  for the option --some-option using
400       --some- as the option, as part of  the  name  rather  than  a  negating
401       dash).   This  may  be  changed to force the last dash in --some- to be
402       negating in the future.
403

OPTIONS

405       -a
406       --ascii
407              [Systems using EBCDIC] Translate file to ASCII format.
408
409
410       -A
411       --adjust-sfx
412              Adjust self-extracting executable  archive.   A  self-extracting
413              executable  archive  is created by prepending the SFX stub to an
414              existing archive. The -A option tells zip to  adjust  the  entry
415              offsets  stored in the archive to take into account this "pream‐
416              ble" data.
417
418       Note: self-extracting archives for the Amiga are a  special  case.   At
419       present, only the Amiga port of zip is capable of adjusting or updating
420       these without corrupting them. -J can be used to remove the SFX stub if
421       other updates need to be made.
422
423
424       -AC
425       --archive-clear
426              [WIN32]   Once  archive  is  created  (and tested if -T is used,
427              which is recommended), clear the  archive  bits  of  files  pro‐
428              cessed.   WARNING:  Once  the bits are cleared they are cleared.
429              You may want to use the -sf show files option to store the  list
430              of  files  processed  in  case  the  archive  operation  must be
431              repeated.  Also consider using the -MM must  match  option.   Be
432              sure to check out -DF as a possibly better way to do incremental
433              backups.
434
435
436       -AS
437       --archive-set
438              [WIN32]  Only include files  that  have  the  archive  bit  set.
439              Directories  are  not stored when -AS is used, though by default
440              the paths of entries, including directories, are stored as usual
441              and can be used by most unzips to recreate directories.
442
443              The  archive  bit  is set by the operating system when a file is
444              modified and, if used with -AC, -AS can provide  an  incremental
445              backup  capability.   However, other applications can modify the
446              archive bit and it may not be  a  reliable  indicator  of  which
447              files  have  changed since the last archive operation.  Alterna‐
448              tive ways to create incremental backups are using -t to use file
449              dates,  though  this won't catch old files copied to directories
450              being archived, and -DF to create a differential archive.
451
452
453       -B
454       --binary
455              [VM/CMS and MVS] force file to be read binary (default is text).
456
457
458       -Bn    [TANDEM] set Edit/Enscribe formatting options with n defined as
459              bit  0: Don't add delimiter (Edit/Enscribe)
460              bit  1: Use LF rather than CR/LF as delimiter (Edit/Enscribe)
461              bit  2: Space fill record to maximum record length (Enscribe)
462              bit  3: Trim trailing space (Enscribe)
463              bit  8: Force 30K (Expand) large read for unstructured files
464
465
466       -b path
467       --temp-path path
468              Use the specified path for the temporary zip archive. For  exam‐
469              ple:
470
471                     zip -b /tmp stuff *
472
473              will  put the temporary zip archive in the directory /tmp, copy‐
474              ing over stuff.zip to the  current  directory  when  done.  This
475              option  is useful when updating an existing archive and the file
476              system containing this old archive does not have enough space to
477              hold both old and new archives at the same time.  It may also be
478              useful when streaming in some cases to avoid the need  for  data
479              descriptors.   Note  that using this option may require zip take
480              additional time to copy the archive file when done to the desti‐
481              nation file system.
482
483
484       -c
485       --entry-comments
486              Add  one-line  comments for each file.  File operations (adding,
487              updating) are done first, and the user is then  prompted  for  a
488              one-line  comment  for each file.  Enter the comment followed by
489              return, or just return for no comment.
490
491
492       -C
493       --preserve-case
494              [VMS]  Preserve case all on VMS.   Negating  this  option  (-C-)
495              downcases.
496
497
498       -C2
499       --preserve-case-2
500              [VMS]   Preserve  case ODS2 on VMS.  Negating this option (-C2-)
501              downcases.
502
503
504       -C5
505       --preserve-case-5
506              [VMS]  Preserve case ODS5 on VMS.  Negating this  option  (-C5-)
507              downcases.
508
509
510       -d
511       --delete
512              Remove (delete) entries from a zip archive.  For example:
513
514                     zip -d foo foo/tom/junk foo/harry/\* \*.o
515
516              will  remove the entry foo/tom/junk, all of the files that start
517              with foo/harry/, and all of the files that end with .o  (in  any
518              path).   Note  that  shell pathname expansion has been inhibited
519              with backslashes, so that zip can see  the  asterisks,  enabling
520              zip  to  match on the contents of the zip archive instead of the
521              contents of the current directory.   (The  backslashes  are  not
522              used  on  MSDOS-based platforms.)  Can also use quotes to escape
523              the asterisks as in
524
525                     zip -d foo foo/tom/junk "foo/harry/*" "*.o"
526
527              Not escaping the asterisks on a system where the  shell  expands
528              wildcards  could  result  in  the asterisks being converted to a
529              list of files in the current directory and  that  list  used  to
530              delete entries from the archive.
531
532              Under  MSDOS,  -d is case sensitive when it matches names in the
533              zip archive.  This requires that file names be entered in  upper
534              case  if they were zipped by PKZIP on an MSDOS system.  (We con‐
535              sidered making this case insensitive on systems where paths were
536              case  insensitive,  but  it  is possible the archive came from a
537              system where case does matter and the archive could include both
538              Bar  and bar as separate files in the archive.)  But see the new
539              option -ic to ignore case in the archive.
540
541
542       -db
543       --display-bytes
544              Display running byte counts showing the  bytes  zipped  and  the
545              bytes to go.
546
547
548       -dc
549       --display-counts
550              Display running count of entries zipped and entries to go.
551
552
553       -dd
554       --display-dots
555              Display  dots  while  each entry is zipped (except on ports that
556              have their own progress indicator).  See -ds below  for  setting
557              dot  size.   The default is a dot every 10 MB of input file pro‐
558              cessed.  The -v option also displays dots (previously at a  much
559              higher  rate  than  this  but now -v also defaults to 10 MB) and
560              this rate is also controlled by -ds.
561
562
563       -df
564       --datafork
565              [MacOS] Include only data-fork of files zipped into the archive.
566              Good   for   exporting   files   to  foreign  operating-systems.
567              Resource-forks will be ignored at all.
568
569
570       -dg
571       --display-globaldots
572              Display progress dots for the archive instead of for each  file.
573              The command
574
575                         zip -qdgds 10m
576
577              will turn off most output except dots every 10 MB.
578
579
580       -ds size
581       --dot-size size
582              Set  amount of input file processed for each dot displayed.  See
583              -dd to enable displaying dots.  Setting this option implies -dd.
584              Size  is  in the format nm where n is a number and m is a multi‐
585              plier.  Currently m can be k (KB), m (MB), g (GB), or t (TB), so
586              if n is 100 and m is k, size would be 100k which is 100 KB.  The
587              default is 10 MB.
588
589              The -v option also displays dots and now defaults to 10 MB also.
590              This  rate is also controlled by this option.  A size of 0 turns
591              dots off.
592
593              This option does not control the dots from the "Scanning  files"
594              message  as zip scans for input files.  The dot size for that is
595              fixed at 2 seconds or a fixed number of  entries,  whichever  is
596              longer.
597
598
599       -du
600       --display-usize
601              Display the uncompressed size of each entry.
602
603
604       -dv
605       --display-volume
606              Display  the volume (disk) number each entry is being read from,
607              if reading an existing archive, and being written to.
608
609
610       -D
611       --no-dir-entries
612              Do not create  entries  in  the  zip  archive  for  directories.
613              Directory   entries   are  created  by  default  so  that  their
614              attributes can be saved in the  zip  archive.   The  environment
615              variable  ZIPOPT  can be used to change the default options. For
616              example under Unix with sh:
617
618                     ZIPOPT="-D"; export ZIPOPT
619
620              (The variable ZIPOPT can be used for any  option,  including  -i
621              and -x using a new option format detailed below, and can include
622              several options.) The option -D is a shorthand for -x  "*/"  but
623              the  latter previously could not be set as default in the ZIPOPT
624              environment variable as the contents  of  ZIPOPT  gets  inserted
625              near  the beginning of the command line and the file list had to
626              end at the end of the line.
627
628              This version of zip does allow -x and -i options  in  ZIPOPT  if
629              the form
630
631               -x file file ... @
632
633              is used, where the @ (an argument that is just @) terminates the
634              list.
635
636
637       -DF
638       --difference-archive
639              Create an archive that contains all new and changed files  since
640              the  original  archive was created.  For this to work, the input
641              file list and current directory must be the same as  during  the
642              original zip operation.
643
644              For example, if the existing archive was created using
645
646                     zip -r foofull .
647
648              from the bar directory, then the command
649
650                     zip -r foofull . -DF --out foonew
651
652              also from the bar directory creates the archive foonew with just
653              the files not in foofull and the files where the  size  or  file
654              time of the files do not match those in foofull.
655
656              Note  that  the  timezone  environment variable TZ should be set
657              according to the local timezone in order for this option to work
658              correctly.   A change in timezone since the original archive was
659              created could result in no times matching and  all  files  being
660              included.
661
662              A possible approach to backing up a directory might be to create
663              a normal archive of the contents of  the  directory  as  a  full
664              backup, then use this option to create incremental backups.
665
666
667       -e
668       --encrypt
669              Encrypt  the  contents of the zip archive using a password which
670              is entered on the terminal in response to a  prompt  (this  will
671              not  be  echoed;  if  standard error is not a tty, zip will exit
672              with an error).  The password prompt is  repeated  to  save  the
673              user from typing errors.
674
675
676       -E
677       --longnames
678              [OS/2]  Use the .LONGNAME Extended Attribute (if found) as file‐
679              name.
680
681
682       -f
683       --freshen
684              Replace (freshen) an existing entry in the zip archive  only  if
685              it  has  been modified more recently than the version already in
686              the zip archive; unlike the update option (-u) this will not add
687              files that are not already in the zip archive.  For example:
688
689                     zip -f foo
690
691              This  command  should  be run from the same directory from which
692              the original zip command was run, since paths stored in zip  ar‐
693              chives are always relative.
694
695              Note  that  the  timezone  environment variable TZ should be set
696              according to the local timezone in order for the -f, -u  and  -o
697              options to work correctly.
698
699              The  reasons behind this are somewhat subtle but have to do with
700              the differences between the Unix-format file  times  (always  in
701              GMT) and most of the other operating systems (always local time)
702              and the necessity to compare the two.  A  typical  TZ  value  is
703              ``MET-1MEST''  (Middle  European  time with automatic adjustment
704              for ``summertime'' or Daylight Savings Time).
705
706              The format is TTThhDDD, where TTT is the time zone such as  MET,
707              hh  is  the  difference  between  GMT  and local time such as -1
708              above, and DDD is the time zone when daylight savings time is in
709              effect.  Leave off the DDD if there is no daylight savings time.
710              For the US Eastern time zone EST5EDT.
711
712
713       -F
714       --fix
715       -FF
716       --fixfix
717              Fix the zip archive. The -F option can be used if some  portions
718              of  the  archive  are  missing, but requires a reasonably intact
719              central directory.  The input archive is scanned as  usual,  but
720              zip  will ignore some problems.  The resulting archive should be
721              valid, but any inconsistent entries will be left out.
722
723              When doubled as in -FF, the archive is scanned from  the  begin‐
724              ning and zip scans for special signatures to identify the limits
725              between the archive members. The single -F is more  reliable  if
726              the archive is not too much damaged, so try this option first.
727
728              If the archive is too damaged or the end has been truncated, you
729              must use -FF.  This is a change  from  zip 2.32,  where  the  -F
730              option  is  able to read a truncated archive.  The -F option now
731              more reliably fixes archives  with  minor  damage  and  the  -FF
732              option is needed to fix archives where -F might have been suffi‐
733              cient before.
734
735              Neither option will recover archives that have been  incorrectly
736              transferred  in  ascii mode instead of binary. After the repair,
737              the -t option of unzip may show that some files have a bad  CRC.
738              Such files cannot be recovered; you can remove them from the ar‐
739              chive using the -d option of zip.
740
741              Note that -FF may have trouble fixing archives that  include  an
742              embedded  zip  archive  that was stored (without compression) in
743              the archive and, depending  on  the  damage,  it  may  find  the
744              entries  in the embedded archive rather than the archive itself.
745              Try -F first as it does not have this problem.
746
747              The format of the fix commands have changed.   For  example,  to
748              fix the damaged archive foo.zip,
749
750                     zip -F foo --out foofix
751
752              tries  to read the entries normally, copying good entries to the
753              new archive foofix.zip.  If this doesn't work, as when  the  ar‐
754              chive  is  truncated, or if some entries you know are in the ar‐
755              chive are missed, then try
756
757                     zip -FF foo --out foofixfix
758
759              and compare the resulting archive to the archive created by  -F.
760              The -FF option may create an inconsistent archive.  Depending on
761              what is damaged, you can then use the -F option to fix that  ar‐
762              chive.
763
764              A  split  archive with missing split files can be fixed using -F
765              if you have the last split of the archive (the .zip  file).   If
766              this file is missing, you must use -FF to fix the archive, which
767              will prompt you for the splits you have.
768
769              Currently the fix options can't recover entries that have a  bad
770              checksum or are otherwise damaged.
771
772
773       -FI
774       --fifo [Unix]   Normally  zip  skips  reading  any  FIFOs (named pipes)
775              encountered, as zip can hang if the FIFO is not being fed.  This
776              option tells zip to read the contents of any FIFO it finds.
777
778
779       -FS
780       --filesync
781              Synchronize the contents of an archive with the files on the OS.
782              Normally when an archive is updated, new  files  are  added  and
783              changed  files are updated but files that no longer exist on the
784              OS are not deleted from the archive.  This option enables a  new
785              mode that checks entries in the archive against the file system.
786              If the file time and file size of the entry matches that of  the
787              OS  file,  the  entry  is copied from the old archive instead of
788              being read from the file system and compressed.  If the OS  file
789              has  changed, the entry is read and compressed as usual.  If the
790              entry in the archive does not match a file on the OS, the  entry
791              is  deleted.   Enabling  this option should create archives that
792              are the same as new archives, but  since  existing  entries  are
793              copied  instead of compressed, updating an existing archive with
794              -FS can be much faster than creating a new archive.   Also  con‐
795              sider using -u for updating an archive.
796
797              For  this option to work, the archive should be updated from the
798              same directory it was created in so the  relative  paths  match.
799              If  few  files  are being copied from the old archive, it may be
800              faster to create a new archive instead.
801
802              Note that the timezone environment variable  TZ  should  be  set
803              according to the local timezone in order for this option to work
804              correctly.  A change in timezone since the original archive  was
805              created  could  result in no times matching and recompression of
806              all files.
807
808              This option deletes files from the archive.  If you need to pre‐
809              serve  the original archive, make a copy of the archive first or
810              use the --out option to output the  updated  archive  to  a  new
811              file.  Even though it may be slower, creating a new archive with
812              a new archive name is safer, avoids mismatches  between  archive
813              and OS paths, and is preferred.
814
815
816       -g
817       --grow
818              Grow  (append to) the specified zip archive, instead of creating
819              a new one. If this operation fails, zip attempts to restore  the
820              archive to its original state. If the restoration fails, the ar‐
821              chive might  become  corrupted.  This  option  is  ignored  when
822              there's  no existing archive or when at least one archive member
823              must be updated or deleted.
824
825
826       -h
827       -?
828       --help
829              Display the zip help information (this also appears  if  zip  is
830              run with no arguments).
831
832
833       -h2
834       --more-help
835              Display  extended  help  including  more on command line format,
836              pattern matching, and more obscure options.
837
838
839       -i files
840       --include files
841              Include only the specified files, as in:
842
843                     zip -r foo . -i \*.c
844
845              which will include only the files that end in .c in the  current
846              directory  and  its  subdirectories.  (Note for PKZIP users: the
847              equivalent command is
848
849                     pkzip -rP foo *.c
850
851              PKZIP does not allow recursion in  directories  other  than  the
852              current one.)  The backslash avoids the shell filename substitu‐
853              tion, so that the name matching  is  performed  by  zip  at  all
854              directory  levels.   [This is for Unix and other systems where \
855              escapes the next character.  For other systems where  the  shell
856              does not process * do not use \ and the above is
857
858                     zip -r foo . -i *.c
859
860              Examples  are  for  Unix  unless  otherwise  specified.]   So to
861              include dir, a directory directly under the  current  directory,
862              use
863
864                     zip -r foo . -i dir/\*
865
866              or
867
868                     zip -r foo . -i "dir/*"
869
870              to  match paths such as dir/a and dir/b/file.c [on ports without
871              wildcard expansion in the shell such as MSDOS and Windows
872
873                     zip -r foo . -i dir/*
874
875              is used.]  Note that currently the  trailing  /  is  needed  for
876              directories (as in
877
878                     zip -r foo . -i dir/
879
880              to include directory dir).
881
882              The long option form of the first example is
883
884                     zip -r foo . --include \*.c
885
886              and does the same thing as the short option form.
887
888              Though  the  command syntax used to require -i at the end of the
889              command line, this version actually  allows  -i  (or  --include)
890              anywhere.   The  list  of  files terminates at the next argument
891              starting with -, the end of the command line, or the list termi‐
892              nator @ (an argument that is just @).  So the above can be given
893              as
894
895                     zip -i \*.c @ -r foo .
896
897              for example.  There must be a space between the option  and  the
898              first  file of a list.  For just one file you can use the single
899              value form
900
901                     zip -i\*.c -r foo .
902
903              (no space between option and value) or
904
905                     zip --include=\*.c -r foo .
906
907              as additional examples.  The single value forms are  not  recom‐
908              mended  because  they  can  be confusing and, in particular, the
909              -ifile format can cause problems if the  first  letter  of  file
910              combines  with  i  to  form a two-letter option starting with i.
911              Use -sc to see how your command line will be parsed.
912
913              Also possible:
914
915                     zip -r foo  . -i@include.lst
916
917              which will only include the files in the current  directory  and
918              its   subdirectories   that  match  the  patterns  in  the  file
919              include.lst.
920
921              Files to -i and -x are patterns matching internal archive paths.
922              See -R for more on patterns.
923
924
925       -I
926       --no-image
927              [Acorn  RISC OS] Don't scan through Image files.  When used, zip
928              will not consider Image files (eg. DOS partitions or  Spark  ar‐
929              chives  when  SparkFS  is  loaded) as directories but will store
930              them as single files.
931
932              For example, if you have SparkFS loaded, zipping a Spark archive
933              will  result  in  a zipfile containing a directory (and its con‐
934              tent) while using the 'I' option will result in a  zipfile  con‐
935              taining a Spark archive. Obviously this second case will also be
936              obtained (without the 'I' option) if SparkFS isn't loaded.
937
938
939       -ic
940       --ignore-case
941              [VMS, WIN32] Ignore case when matching  archive  entries.   This
942              option  is  only available on systems where the case of files is
943              ignored.  On systems with case-insensitive file systems, case is
944              normally  ignored  when matching files on the file system but is
945              not ignored for -f (freshen), -d (delete), -U (copy), and  simi‐
946              lar  modes  when  matching against archive entries (currently -f
947              ignores case on VMS) because archive entries can be from systems
948              where  case  does  matter and names that are the same except for
949              case can exist in an archive.  The -ic option makes all matching
950              case  insensitive.   This can result in multiple archive entries
951              matching a command line pattern.
952
953
954       -j
955       --junk-paths
956              Store just the name of a saved file (junk the path), and do  not
957              store  directory names. By default, zip will store the full path
958              (relative to the current directory).
959
960
961       -jj
962       --absolute-path
963              [MacOS] record Fullpath (+ Volname). The complete path including
964              volume  will  be  stored.  By  default the relative path will be
965              stored.
966
967
968       -J
969       --junk-sfx
970              Strip any prepended data (e.g. a SFX stub) from the archive.
971
972       -k
973       --DOS-names
974              Attempt to convert the names and  paths  to  conform  to  MSDOS,
975              store  only  the  MSDOS attribute (just the user write attribute
976              from Unix), and mark the entry as made under MSDOS (even  though
977              it  was  not);  for compatibility with PKUNZIP under MSDOS which
978              cannot handle certain names such as those with two dots.
979
980       -l
981       --to-crlf
982              Translate the Unix end-of-line character LF into the MSDOS  con‐
983              vention  CR  LF. This option should not be used on binary files.
984              This option can be used on Unix if the zip file is intended  for
985              PKUNZIP  under  MSDOS. If the input files already contain CR LF,
986              this option adds an extra CR. This is to ensure that unzip -a on
987              Unix  will  get back an exact copy of the original file, to undo
988              the effect of zip -l.  See -ll for how binary files are handled.
989
990       -la
991       --log-append
992              Append to existing logfile.  Default is to overwrite.
993
994       -lf logfilepath
995       --logfile-path logfilepath
996              Open a logfile at the given path.  By default any existing  file
997              at  that location is overwritten, but the -la option will result
998              in an existing file being opened and  the  new  log  information
999              appended  to any existing information.  Only warnings and errors
1000              are written to the log unless the -li option is also given, then
1001              all information messages are also written to the log.
1002
1003       -li
1004       --log-info
1005              Include  information  messages, such as file names being zipped,
1006              in the log.  The default is to only include  the  command  line,
1007              any warnings and errors, and the final status.
1008
1009       -ll
1010       --from-crlf
1011              Translate the MSDOS end-of-line CR LF into Unix LF.  This option
1012              should not be used on binary files.  This option can be used  on
1013              MSDOS  if the zip file is intended for unzip under Unix.  If the
1014              file is converted and the file is later determined to be  binary
1015              a warning is issued and the file is probably corrupted.  In this
1016              release if -ll detects binary in the first buffer  read  from  a
1017              file,  zip now issues a warning and skips line end conversion on
1018              the file.  This check seems to catch all  binary  files  tested,
1019              but  the original check remains and if a converted file is later
1020              determined to be binary that warning is  still  issued.   A  new
1021              algorithm  is  now  being  used for binary detection that should
1022              allow line end conversion of text files  in  UTF-8  and  similar
1023              encodings.
1024
1025       -L
1026       --license
1027              Display the zip license.
1028
1029       -m
1030       --move
1031              Move  the  specified  files into the zip archive; actually, this
1032              deletes the target directories/files after making the  specified
1033              zip  archive.  If a directory becomes empty after removal of the
1034              files, the directory is also  removed.  No  deletions  are  done
1035              until zip has created the archive without error.  This is useful
1036              for conserving disk space, but is potentially dangerous so it is
1037              recommended to use it in combination with -T to test the archive
1038              before removing all input files.
1039
1040       -MM
1041       --must-match
1042              All input patterns must match at least one file  and  all  input
1043              files  found  must  be readable.  Normally when an input pattern
1044              does not match a file the "name not matched" warning  is  issued
1045              and  when  an  input file has been found but later is missing or
1046              not readable a missing or not readable warning  is  issued.   In
1047              either  case zip continues creating the archive, with missing or
1048              unreadable new files being skipped and files already in the  ar‐
1049              chive remaining unchanged.  After the archive is created, if any
1050              files were not readable zip returns the OPEN error code  (18  on
1051              most  systems)  instead  of the normal success return (0 on most
1052              systems).  With -MM set, zip exits as soon as an  input  pattern
1053              is not matched (whenever the "name not matched" warning would be
1054              issued) or when an input file is not readable.  In  either  case
1055              zip exits with an OPEN error and no archive is created.
1056
1057              This option is useful when a known list of files is to be zipped
1058              so any missing or unreadable files will result in an error.   It
1059              is less useful when used with wildcards, but zip will still exit
1060              with an error if any input pattern doesn't match  at  least  one
1061              file  and  if  any matched files are unreadable.  If you want to
1062              create the archive anyway and only need to know  if  files  were
1063              skipped, don't use -MM and just check the return code.  Also -lf
1064              could be useful.
1065
1066       -n suffixes
1067       --suffixes suffixes
1068              Do not attempt to compress files named with the given  suffixes.
1069              Such  files are simply stored (0% compression) in the output zip
1070              file, so that zip doesn't waste  its  time  trying  to  compress
1071              them.   The  suffixes  are  separated  by either colons or semi‐
1072              colons.  For example:
1073
1074                     zip -rn .Z:.zip:.tiff:.gif:.snd  foo foo
1075
1076              will copy everything from foo into foo.zip, but will  store  any
1077              files  that end in .Z, .zip, .tiff, .gif, or .snd without trying
1078              to compress them (image and sound files  often  have  their  own
1079              specialized compression methods).  By default, zip does not com‐
1080              press     files     with     extensions     in     the      list
1081              .Z:.zip:.zoo:.arc:.lzh:.arj.   Such files are stored directly in
1082              the output archive.  The environment variable ZIPOPT can be used
1083              to change the default options. For example under Unix with csh:
1084
1085                     setenv ZIPOPT "-n .gif:.zip"
1086
1087              To attempt compression on all files, use:
1088
1089                     zip -n : foo
1090
1091              The  maximum  compression option -9 also attempts compression on
1092              all files regardless of extension.
1093
1094              On Acorn RISC OS systems the suffixes are actually filetypes  (3
1095              hex  digit format). By default, zip does not compress files with
1096              filetypes in the list DDC:D96:68E (i.e. Archives, CFS files  and
1097              PackDir files).
1098
1099       -nw
1100       --no-wild
1101              Do not perform internal wildcard processing (shell processing of
1102              wildcards is still done by the shell unless  the  arguments  are
1103              escaped).   Useful if a list of paths is being read and no wild‐
1104              card substitution is desired.
1105
1106       -N
1107       --notes
1108              [Amiga, MacOS] Save Amiga or MacOS  filenotes  as  zipfile  com‐
1109              ments.  They can be restored by using the -N option of unzip. If
1110              -c is used also, you are prompted for comments  only  for  those
1111              files that do not have filenotes.
1112
1113       -o
1114       --latest-time
1115              Set  the  "last  modified" time of the zip archive to the latest
1116              (oldest) "last modified" time found among the entries in the zip
1117              archive.   This  can  be  used  without any other operations, if
1118              desired.  For example:
1119
1120              zip -o foo
1121
1122              will change the last modified time of foo.zip to the latest time
1123              of the entries in foo.zip.
1124
1125       -O output-file
1126       --output-file output-file
1127              Process  the  archive  changes as usual, but instead of updating
1128              the existing archive, output the  new  archive  to  output-file.
1129              Useful for updating an archive without changing the existing ar‐
1130              chive and the input archive must be a different  file  than  the
1131              output archive.
1132
1133              This  option  can  be used to create updated split archives.  It
1134              can also be used with -U to copy entries from  an  existing  ar‐
1135              chive to a new archive.  See the EXAMPLES section below.
1136
1137              Another  use  is  converting  zip  files  from one split size to
1138              another.  For instance, to convert an archive  with  700  MB  CD
1139              splits to one with 2 GB DVD splits, can use:
1140
1141                     zip -s 2g cd-split.zip --out dvd-split.zip
1142
1143              which uses copy mode.  See -U below.  Also:
1144
1145                     zip -s 0 split.zip --out unsplit.zip
1146
1147              will convert a split archive to a single-file archive.
1148
1149              Copy  mode  will  convert stream entries (using data descriptors
1150              and which should be  compatible  with  most  unzips)  to  normal
1151              entries  (which should be compatible with all unzips), except if
1152              standard encryption  was  used.   For  archives  with  encrypted
1153              entries,  zipcloak  will decrypt the entries and convert them to
1154              normal entries.
1155
1156       -p
1157       --paths
1158              Include relative file paths as part of the names of files stored
1159              in  the  archive.  This is the default.  The -j option junks the
1160              paths and just stores the names of the files.
1161
1162       -P password
1163       --password password
1164              Use password to encrypt zipfile entries (if any).  THIS IS INSE‐
1165              CURE!   Many  multi-user  operating systems provide ways for any
1166              user to see the current command line of any other user; even  on
1167              stand-alone  systems  there  is  always  the threat of over-the-
1168              shoulder peeking.  Storing the plaintext password as part  of  a
1169              command  line  in  an  automated script is even worse.  Whenever
1170              possible, use the non-echoing, interactive prompt to enter pass‐
1171              words.   (And  where  security  is  truly  important, use strong
1172              encryption such as Pretty Good Privacy instead of the relatively
1173              weak standard encryption provided by zipfile utilities.)
1174
1175       -q
1176       --quiet
1177              Quiet   mode;   eliminate  informational  messages  and  comment
1178              prompts.  (Useful, for example, in shell scripts and  background
1179              tasks).
1180
1181       -Qn
1182       --Q-flag n
1183              [QDOS]  store information about the file in the file header with
1184              n defined as
1185              bit  0: Don't add headers for any file
1186              bit  1: Add headers for all files
1187              bit  2: Don't wait for interactive key press on exit
1188
1189       -r
1190       --recurse-paths
1191              Travel the directory structure recursively; for example:
1192
1193                     zip -r foo.zip foo
1194
1195              or more concisely
1196
1197                     zip -r foo foo
1198
1199              In this case, all the files and directories in foo are saved  in
1200              a zip archive named foo.zip, including files with names starting
1201              with ".", since the recursion does not use the shell's file-name
1202              substitution  mechanism.  If you wish to include only a specific
1203              subset of the files in directory foo and its subdirectories, use
1204              the  -i  option  to specify the pattern of files to be included.
1205              You should not use -r with the name  ".*",  since  that  matches
1206              ".."   which will attempt to zip up the parent directory (proba‐
1207              bly not what was intended).
1208
1209              Multiple source directories are allowed as in
1210
1211                     zip -r foo foo1 foo2
1212
1213              which first zips up foo1 and then foo2, going down  each  direc‐
1214              tory.
1215
1216              Note  that  while  wildcards  to -r are typically resolved while
1217              recursing down directories in the file system, any -R,  -x,  and
1218              -i  wildcards are applied to internal archive pathnames once the
1219              directories are scanned.  To have wildcards apply  to  files  in
1220              subdirectories  when recursing on Unix and similar systems where
1221              the shell does wildcard substitution, either  escape  all  wild‐
1222              cards  or put all arguments with wildcards in quotes.  This lets
1223              zip see the wildcards and match files  in  subdirectories  using
1224              them as it recurses.
1225
1226       -R
1227       --recurse-patterns
1228              Travel  the directory structure recursively starting at the cur‐
1229              rent directory; for example:
1230
1231                     zip -R foo "*.c"
1232
1233              In this case, all the files matching *.c in the tree starting at
1234              the  current  directory  are  stored  into  a  zip archive named
1235              foo.zip.  Note that *.c will match file.c, a/file.c and  a/b/.c.
1236              More than one pattern can be listed as separate arguments.  Note
1237              for PKZIP users: the equivalent command is
1238
1239                     pkzip -rP foo *.c
1240
1241              Patterns are relative file paths as they appear in the  archive,
1242              or  will after zipping, and can have optional wildcards in them.
1243              For example, given the current directory is foo and under it are
1244              directories foo1 and foo2 and in foo1 is the file bar.c,
1245
1246                     zip -R foo/*
1247
1248              will zip up foo, foo/foo1, foo/foo1/bar.c, and foo/foo2.
1249
1250                     zip -R */bar.c
1251
1252              will  zip  up  foo/foo1/bar.c.   See the note for -r on escaping
1253              wildcards.
1254
1255
1256       -RE
1257       --regex
1258              [WIN32]  Before zip 3.0, regular expression  list  matching  was
1259              enabled  by  default on Windows platforms.  Because of confusion
1260              resulting from the need to escape "[" and "]" in  names,  it  is
1261              now  off  by  default for Windows so "[" and "]" are just normal
1262              characters in names.  This option enables [] matching again.
1263
1264
1265       -s splitsize
1266       --split-size splitsize
1267              Enable creating a split archive and set the split size.  A split
1268              archive  is  an archive that could be split over many files.  As
1269              the archive is created, if the size of the archive  reaches  the
1270              specified  split  size,  that split is closed and the next split
1271              opened.  In general all splits but the last will  be  the  split
1272              size  and  the last will be whatever is left.  If the entire ar‐
1273              chive is smaller than the split size a  single-file  archive  is
1274              created.
1275
1276              Split  archives  are  stored in numbered files.  For example, if
1277              the output  archive  is  named  archive  and  three  splits  are
1278              required,  the  resulting archive will be in the three files ar‐
1279              chive.z01, archive.z02, and archive.zip.  Do not change the num‐
1280              bering  of  these  files  or the archive will not be readable as
1281              these are used to determine the order the splits are read.
1282
1283              Split size is a number  optionally  followed  by  a  multiplier.
1284              Currently  the  number  must  be an integer.  The multiplier can
1285              currently be one of k (kilobytes), m (megabytes), g (gigabytes),
1286              or  t  (terabytes).   As  64k is the minimum split size, numbers
1287              without multipliers default to megabytes.  For example, to  cre‐
1288              ate  a  split  archive  called  foo with the contents of the bar
1289              directory with splits of 670 MB that might be useful for burning
1290              on CDs, the command:
1291
1292                     zip -s 670m -r foo bar
1293
1294              could be used.
1295
1296              Currently  the  old  splits  of a split archive are not excluded
1297              from a new archive, but they can be specifically  excluded.   If
1298              possible,  keep  the  input  and output archives out of the path
1299              being zipped when creating split archives.
1300
1301              Using -s without -sp as above creates all the splits  where  foo
1302              is  being  written,  in  this  case the current directory.  This
1303              split mode updates the splits as the archive is  being  created,
1304              requiring  all  splits to remain writable, but creates split ar‐
1305              chives that are readable by any unzip that  supports  split  ar‐
1306              chives.   See  -sp  below  for  enabling  split pause mode which
1307              allows splits to be written directly to removable media.
1308
1309              The option -sv can be used to enable verbose splitting and  pro‐
1310              vide details of how the splitting is being done.  The -sb option
1311              can be used to ring the bell when zip pauses for the next  split
1312              destination.
1313
1314              Split  archives cannot be updated, but see the -O (--out) option
1315              for how a split archive can be updated as it is copied to a  new
1316              archive.   A  split archive can also be converted into a single-
1317              file archive using a split size of 0 or negating the -s option:
1318
1319                     zip -s 0 split.zip --out single.zip
1320
1321              Also see -U (--copy) for more on using copy mode.
1322
1323       -sb
1324       --split-bell
1325              If splitting and using split pause mode, ring the bell when  zip
1326              pauses for each split destination.
1327
1328       -sc
1329       --show-command
1330              Show  the  command line starting zip as processed and exit.  The
1331              new command parser permutes the arguments, putting  all  options
1332              and  any values associated with them before any non-option argu‐
1333              ments.  This allows an option to appear anywhere in the  command
1334              line  as  long as any values that go with the option go with it.
1335              This option displays the command line as zip sees it,  including
1336              any arguments from the environment such as from the ZIPOPT vari‐
1337              able.  Where allowed, options later  in  the  command  line  can
1338              override options earlier in the command line.
1339
1340       -sf
1341       --show-files
1342              Show  the  files  that  would  be  operated  on, then exit.  For
1343              instance, if creating a new archive, this will  list  the  files
1344              that  would  be  added.   If the option is negated, -sf-, output
1345              only to an open log file.  Screen display is not recommended for
1346              large lists.
1347
1348       -so
1349       --show-options
1350              Show  all  available options supported by zip as compiled on the
1351              current system.  As this command  reads  the  option  table,  it
1352              should include all options.  Each line includes the short option
1353              (if defined), the long option (if defined), the  format  of  any
1354              value  that  goes with the option, if the option can be negated,
1355              and a small description.  The value  format  can  be  no  value,
1356              required  value,  optional value, single character value, number
1357              value, or a list of values.  The output of this  option  is  not
1358              intended  to  show  how  to  use  any  option but only show what
1359              options are available.
1360
1361       -sp
1362       --split-pause
1363              If splitting is enabled with -s, enable split pause mode.   This
1364              creates split archives as -s does, but stream writing is used so
1365              each split can be closed as soon as it is written and  zip  will
1366              pause  between each split to allow changing split destination or
1367              media.
1368
1369              Though this split mode allows writing splits directly to  remov‐
1370              able  media, it uses stream archive format that may not be read‐
1371              able by some unzips.  Before relying on splits created with -sp,
1372              test a split archive with the unzip you will be using.
1373
1374              To  convert a stream split archive (created with -sp) to a stan‐
1375              dard archive see the --out option.
1376
1377       -su
1378       --show-unicode
1379              As -sf, but also show Unicode version of the path if exists.
1380
1381       -sU
1382       --show-just-unicode
1383              As -sf, but only show Unicode version of  the  path  if  exists,
1384              otherwise show the standard version of the path.
1385
1386       -sv
1387       --split-verbose
1388              Enable various verbose messages while splitting, showing how the
1389              splitting is being done.
1390
1391       -S
1392       --system-hidden
1393              [MSDOS, OS/2, WIN32 and ATARI] Include system and hidden files.
1394              [MacOS] Includes finder invisible files, which are ignored  oth‐
1395              erwise.
1396
1397       -t mmddyyyy
1398       --from-date mmddyyyy
1399              Do  not  operate  on files modified prior to the specified date,
1400              where mm is the month (00-12),  dd  is  the  day  of  the  month
1401              (01-31),  and  yyyy  is  the  year.   The  ISO 8601  date format
1402              yyyy-mm-dd is also accepted.  For example:
1403
1404                     zip -rt 12071991 infamy foo
1405
1406                     zip -rt 1991-12-07 infamy foo
1407
1408              will add all the files in foo and its subdirectories  that  were
1409              last  modified  on  or after 7 December 1991, to the zip archive
1410              infamy.zip.
1411
1412       -tt mmddyyyy
1413       --before-date mmddyyyy
1414              Do not operate on files modified after or at the specified date,
1415              where  mm  is  the  month  (00-12),  dd  is the day of the month
1416              (01-31), and  yyyy  is  the  year.   The  ISO 8601  date  format
1417              yyyy-mm-dd is also accepted.  For example:
1418
1419                     zip -rtt 11301995 infamy foo
1420
1421                     zip -rtt 1995-11-30 infamy foo
1422
1423              will  add  all the files in foo and its subdirectories that were
1424              last modified before  30  November  1995,  to  the  zip  archive
1425              infamy.zip.
1426
1427       -T
1428       --test
1429              Test  the integrity of the new zip file. If the check fails, the
1430              old zip file is unchanged and (with  the  -m  option)  no  input
1431              files are removed.
1432
1433       -TT cmd
1434       --unzip-command cmd
1435              Use  command cmd instead of 'unzip -tqq' to test an archive when
1436              the -T option is used.  On Unix, to use a copy of unzip  in  the
1437              current  directory  instead  of the standard system unzip, could
1438              use:
1439
1440               zip archive file1 file2 -T -TT "./unzip -tqq"
1441
1442              In cmd, {} is replaced by the name  of  the  temporary  archive,
1443              otherwise  the name of the archive is appended to the end of the
1444              command.  The return code is checked for success (0 on Unix).
1445
1446       -u
1447       --update
1448              Replace (update) an existing entry in the zip archive only if it
1449              has  been modified more recently than the version already in the
1450              zip archive.  For example:
1451
1452                     zip -u stuff *
1453
1454              will add any new files in the current directory, and update  any
1455              files  which  have been modified since the zip archive stuff.zip
1456              was last created/modified (note that zip will not  try  to  pack
1457              stuff.zip into itself when you do this).
1458
1459              Note  that  the -u option with no input file arguments acts like
1460              the -f (freshen) option.
1461
1462       -U
1463       --copy-entries
1464              Copy entries from one archive to another.   Requires  the  --out
1465              option  to  specify  a  different output file than the input ar‐
1466              chive.  Copy mode is the reverse of -d delete.  When  delete  is
1467              being used with --out, the selected entries are deleted from the
1468              archive and all other entries are copied  to  the  new  archive,
1469              while copy mode selects the files to include in the new archive.
1470              Unlike -u update, input patterns on the command line are matched
1471              against archive entries only and not the file system files.  For
1472              instance,
1473
1474                     zip inarchive "*.c" --copy --out outarchive
1475
1476              copies entries with names ending in .c from  inarchive  to  out‐
1477              archive.   The  wildcard must be escaped on some systems to pre‐
1478              vent the shell from substituting names of files  from  the  file
1479              system  which  may  have  no relevance to the entries in the ar‐
1480              chive.
1481
1482              If no input files appear on the command line and --out is  used,
1483              copy mode is assumed:
1484
1485                     zip inarchive --out outarchive
1486
1487              This is useful for changing split size for instance.  Encrypting
1488              and decrypting entries is not yet  supported  using  copy  mode.
1489              Use zipcloak for that.
1490
1491       -UN v
1492       --unicode v
1493              Determine  what zip should do with Unicode file names.  zip 3.0,
1494              in addition to the standard file path, now  includes  the  UTF-8
1495              translation  of the path if the entry path is not entirely 7-bit
1496              ASCII.  When an entry is missing the Unicode path,  zip  reverts
1497              back  to  the  standard  file  path.  The problem with using the
1498              standard path is this path is in the local character set of  the
1499              zip  that  created  the entry, which may contain characters that
1500              are not valid in the character set  being  used  by  the  unzip.
1501              When  zip  is reading an archive, if an entry also has a Unicode
1502              path, zip now defaults to using the Unicode path to recreate the
1503              standard path using the current local character set.
1504
1505              This  option  can  be  used to determine what zip should do with
1506              this path if there is a mismatch  between  the  stored  standard
1507              path and the stored UTF-8 path (which can happen if the standard
1508              path was updated).  In all cases, if there is a mismatch  it  is
1509              assumed  that  the  standard  path  is more current and zip uses
1510              that.  Values for v are
1511
1512                     q - quit if paths do not match
1513
1514                     w - warn, continue with standard path
1515
1516                     i - ignore, continue with standard path
1517
1518                     n - no Unicode, do not use Unicode paths
1519
1520              The default is to warn and continue.
1521
1522              Characters that are not valid in the current character  set  are
1523              escaped  as  #Uxxxx  and #Lxxxxxx, where x is an ASCII character
1524              for a hex digit.  The first is used if a 16-bit character number
1525              is  sufficient to represent the Unicode character and the second
1526              if the character needs more than 16 bits to represent it's  Uni‐
1527              code character code.  Setting -UN to
1528
1529                     e - escape
1530
1531              as in
1532
1533                     zip archive -sU -UN=e
1534
1535              forces zip to escape all characters that are not printable 7-bit
1536              ASCII.
1537
1538              Normally zip stores UTF-8 directly in the standard path field on
1539              systems  where UTF-8 is the current character set and stores the
1540              UTF-8 in the new extra fields otherwise.  The option
1541
1542                     u - UTF-8
1543
1544              as in
1545
1546                     zip archive dir -r -UN=UTF8
1547
1548              forces zip to store UTF-8 as native in the archive.   Note  that
1549              storing  UTF-8 directly is the default on Unix systems that sup‐
1550              port it.  This option could be useful on Windows  systems  where
1551              the  escaped  path is too large to be a valid path and the UTF-8
1552              version of the path is smaller, but native UTF-8 is not backward
1553              compatible on Windows systems.
1554
1555
1556       -v
1557       --verbose
1558              Verbose mode or print diagnostic version info.
1559
1560              Normally,  when  applied to real operations, this option enables
1561              the display of a progress indicator during compression (see  -dd
1562              for  more  on  dots)  and requests verbose diagnostic info about
1563              zipfile structure oddities.
1564
1565              However, when -v is the only command line argument a  diagnostic
1566              screen  is printed instead.  This should now work even if stdout
1567              is redirected to a file, allowing easy saving of the information
1568              for  sending  with  bug reports to Info-ZIP.  The version screen
1569              provides the help screen header with program name, version,  and
1570              release  date,  some pointers to the Info-ZIP home and distribu‐
1571              tion sites, and shows information about the  target  environment
1572              (compiler type and version, OS version, compilation date and the
1573              enabled optional features used to create the zip executable).
1574
1575       -V
1576       --VMS-portable
1577              [VMS] Save VMS file attributes.  (Files are  truncated at  EOF.)
1578              When  a  -V  archive is unpacked on a non-VMS system,  some file
1579              types (notably Stream_LF text  files   and   pure  binary  files
1580              like  fixed-512)  should be extracted intact.  Indexed files and
1581              file types with embedded record sizes  (notably  variable-length
1582              record types) will probably be seen as corrupt elsewhere.
1583
1584       -VV
1585       --VMS-specific
1586              [VMS]  Save  VMS file attributes, and  all allocated blocks in a
1587              file,  including  any  data beyond EOF.  Useful for moving  ill-
1588              formed  files   among   VMS  systems.    When  a  -VV archive is
1589              unpacked on a non-VMS system, almost all files will appear  cor‐
1590              rupt.
1591
1592       -w
1593       --VMS-versions
1594              [VMS]  Append  the  version  number  of  the  files to the name,
1595              including multiple versions of files.  Default is  to  use  only
1596              the most recent version of a specified file.
1597
1598       -ww
1599       --VMS-dot-versions
1600              [VMS]  Append  the  version  number  of  the  files to the name,
1601              including multiple versions of files,  using  the  .nnn  format.
1602              Default  is  to  use only the most recent version of a specified
1603              file.
1604
1605       -ws
1606       --wild-stop-dirs
1607              Wildcards match only at a directory level.  Normally zip handles
1608              paths as strings and given the paths
1609
1610                     /foo/bar/dir/file1.c
1611
1612                     /foo/bar/file2.c
1613
1614              an input pattern such as
1615
1616                     /foo/bar/*
1617
1618              normally  would match both paths, the * matching dir/file1.c and
1619              file2.c.  Note that in the first case a directory  boundary  (/)
1620              was  crossed in the match.  With -ws no directory bounds will be
1621              included in the match, making  wildcards  local  to  a  specific
1622              directory  level.   So,  with  -ws enabled, only the second path
1623              would be matched.
1624
1625              When using -ws, use ** to match across directory boundaries as *
1626              does normally.
1627
1628       -x files
1629       --exclude files
1630              Explicitly exclude the specified files, as in:
1631
1632                     zip -r foo foo -x \*.o
1633
1634              which  will include the contents of foo in foo.zip while exclud‐
1635              ing all the files that end in  .o.   The  backslash  avoids  the
1636              shell  filename  substitution, so that the name matching is per‐
1637              formed by zip at all directory levels.
1638
1639              Also possible:
1640
1641                     zip -r foo foo -x@exclude.lst
1642
1643              which will include the contents of foo in foo.zip while  exclud‐
1644              ing   all  the  files  that  match  the  patterns  in  the  file
1645              exclude.lst.
1646
1647              The long option forms of the above are
1648
1649                     zip -r foo foo --exclude \*.o
1650
1651              and
1652
1653                     zip -r foo foo --exclude @exclude.lst
1654
1655              Multiple patterns can be specified, as in:
1656
1657                     zip -r foo foo -x \*.o \*.c
1658
1659              If there is no space between -x and the pattern, just one  value
1660              is assumed (no list):
1661
1662                     zip -r foo foo -x\*.o
1663
1664              See -i for more on include and exclude.
1665
1666       -X
1667       --no-extra
1668              Do  not save extra file attributes (Extended Attributes on OS/2,
1669              uid/gid and file times on Unix).   The  zip  format  uses  extra
1670              fields  to  include additional information for each entry.  Some
1671              extra fields are specific to particular systems while others are
1672              applicable to all systems.  Normally when zip reads entries from
1673              an existing archive, it reads the extra fields it knows,  strips
1674              the  rest,  and adds the extra fields applicable to that system.
1675              With -X, zip strips all old fields and only includes the Unicode
1676              and  Zip64 extra fields (currently these two extra fields cannot
1677              be disabled).
1678
1679              Negating this  option,  -X-,  includes  all  the  default  extra
1680              fields, but also copies over any unrecognized extra fields.
1681
1682       -y
1683       --symlinks
1684              For  UNIX and VMS (V8.3 and later), store symbolic links as such
1685              in the zip archive, instead of compressing and storing the  file
1686              referred  to  by  the  link.   This can avoid multiple copies of
1687              files being included in the archive as zip recurses  the  direc‐
1688              tory trees and accesses files directly and by links.
1689
1690       -z
1691       --archive-comment
1692              Prompt for a multi-line comment for the entire zip archive.  The
1693              comment is ended by a line containing just a period, or  an  end
1694              of file condition (^D on Unix, ^Z on MSDOS, OS/2, and VMS).  The
1695              comment can be taken from a file:
1696
1697                     zip -z foo < foowhat
1698
1699       -Z cm
1700       --compression-method cm
1701              Set the default compression method.  Currently the main  methods
1702              supported  by zip are store and deflate.  Compression method can
1703              be set to:
1704
1705              store - Setting the compression method to store  forces  zip  to
1706              store  entries  with  no  compression.  This is generally faster
1707              than compressing entries, but results in no space savings.  This
1708              is the same as using -0 (compression level zero).
1709
1710              deflate - This is the default method for zip.  If zip determines
1711              that storing is better than deflation, the entry will be  stored
1712              instead.
1713
1714              bzip2 - If bzip2 support is compiled in, this compression method
1715              also becomes available.  Only some modern unzips currently  sup‐
1716              port the bzip2 compression method, so test the unzip you will be
1717              using before relying on archives using this method  (compression
1718              method 12).
1719
1720              For  example,  to  add bar.c to archive foo using bzip2 compres‐
1721              sion:
1722
1723                     zip -Z bzip2 foo bar.c
1724
1725              The compression method can be abbreviated:
1726
1727                     zip -Zb foo bar.c
1728
1729       -#
1730       (-0, -1, -2, -3, -4, -5, -6, -7, -8, -9)
1731              Regulate the speed of compression using the specified  digit  #,
1732              where  -0  indicates  no compression (store all files), -1 indi‐
1733              cates the fastest compression speed (less  compression)  and  -9
1734              indicates  the  slowest  compression speed (optimal compression,
1735              ignores the suffix list). The default compression level is -6.
1736
1737              Though still being worked, the intention is  this  setting  will
1738              control  compression  speed  for  all compression methods.  Cur‐
1739              rently only deflation is controlled.
1740
1741       -!
1742       --use-privileges
1743              [WIN32] Use priviliges (if granted) to  obtain  all  aspects  of
1744              WinNT security.
1745
1746       -@
1747       --names-stdin
1748              Take the list of input files from standard input. Only one file‐
1749              name per line.
1750
1751       -$
1752       --volume-label
1753              [MSDOS, OS/2, WIN32] Include the  volume  label  for  the  drive
1754              holding the first file to be compressed.  If you want to include
1755              only the volume label or to force  a  specific  drive,  use  the
1756              drive name as first file name, as in:
1757
1758                     zip -$ foo a: c:bar
1759

EXAMPLES

1761       The simplest example:
1762
1763              zip stuff *
1764
1765       creates the archive stuff.zip (assuming it does not exist) and puts all
1766       the files in the current directory in it, in compressed form (the  .zip
1767       suffix  is  added automatically, unless the archive name contains a dot
1768       already; this allows the explicit specification of other suffixes).
1769
1770       Because of the way the shell on Unix does filename substitution,  files
1771       starting with "." are not included; to include these as well:
1772
1773              zip stuff .* *
1774
1775       Even  this  will not include any subdirectories from the current direc‐
1776       tory.
1777
1778       To zip up an entire directory, the command:
1779
1780              zip -r foo foo
1781
1782       creates the archive foo.zip, containing all the files  and  directories
1783       in the directory foo that is contained within the current directory.
1784
1785       You  may  want  to  make  a zip archive that contains the files in foo,
1786       without recording the directory name, foo.  You can use the  -j  option
1787       to leave off the paths, as in:
1788
1789              zip -j foo foo/*
1790
1791       If  you are short on disk space, you might not have enough room to hold
1792       both the original directory and the corresponding  compressed  zip  ar‐
1793       chive.   In this case, you can create the archive in steps using the -m
1794       option.  If foo contains the subdirectories tom, dick, and  harry,  you
1795       can:
1796
1797              zip -rm foo foo/tom
1798              zip -rm foo foo/dick
1799              zip -rm foo foo/harry
1800
1801       where  the  first  command creates foo.zip, and the next two add to it.
1802       At the completion of each zip command,  the  last  created  archive  is
1803       deleted, making room for the next zip command to function.
1804
1805
1806
1807
1808       Use  -s  to set the split size and create a split archive.  The size is
1809       given as a number followed optionally by one of k (kB), m (MB), g (GB),
1810       or t (TB).  The command
1811
1812              zip -s 2g -r split.zip foo
1813
1814       creates a split archive of the directory foo with splits no bigger than
1815       2 GB each.  If foo contained 5 GB of contents  and  the  contents  were
1816       stored  in  the split archive without compression (to make this example
1817       simple), this would create three splits, split.z01 at  2 GB,  split.z02
1818       at 2 GB, and split.zip at a little over 1 GB.
1819
1820       The  -sp option can be used to pause zip between splits to allow chang‐
1821       ing removable media, for example, but read the descriptions  and  warn‐
1822       ings for both -s and -sp below.
1823
1824       Though  zip does not update split archives, zip provides the new option
1825       -O (--output-file) to allow split archives to be updated and saved in a
1826       new archive.  For example,
1827
1828              zip inarchive.zip foo.c bar.c --out outarchive.zip
1829
1830       reads  archive  inarchive.zip,  even if split, adds the files foo.c and
1831       bar.c, and writes the resulting archive to  outarchive.zip.   If  inar‐
1832       chive.zip is split then outarchive.zip defaults to the same split size.
1833       Be aware that outarchive.zip and any split files that are created  with
1834       it  are always overwritten without warning.  This may be changed in the
1835       future.
1836
1837
1838
1839
1840

PATTERN MATCHING

1842       This section applies only to Unix.  Watch this  space  for  details  on
1843       MSDOS  and  VMS  operation.  However, the special wildcard characters *
1844       and [] below apply to at least MSDOS also.
1845
1846       The Unix shells (sh, csh, bash, and others) normally do  filename  sub‐
1847       stitution (also called "globbing") on command arguments.  Generally the
1848       special characters are:
1849
1850       ?      match any single character
1851
1852       *      match any number of characters (including none)
1853
1854       []     match any character in the range indicated within  the  brackets
1855              (example:  [a-f], [0-9]).  This form of wildcard matching allows
1856              a user to specify a list of characters between  square  brackets
1857              and  if any of the characters match the expression matches.  For
1858              example:
1859
1860                     zip archive "*.[hc]"
1861
1862              would archive all files in the current directory that end in  .h
1863              or .c.
1864
1865              Ranges of characters are supported:
1866
1867                     zip archive "[a-f]*"
1868
1869              would  add  to  the  archive all files starting with "a" through
1870              "f".
1871
1872              Negation is also supported, where any character in that position
1873              not in the list matches.  Negation is supported by adding ! or ^
1874              to the beginning of the list:
1875
1876                     zip archive "*.[!o]"
1877
1878              matches files that don't end in ".o".
1879
1880              On WIN32, [] matching needs to be turned on with the -RE  option
1881              to avoid the confusion that names with [ or ] have caused.
1882
1883
1884       When  these  characters  are  encountered (without being escaped with a
1885       backslash or quotes), the shell will look for  files  relative  to  the
1886       current  path  that  match the pattern, and replace the argument with a
1887       list of the names that matched.
1888
1889       The zip program can do the same matching on names that are in  the  zip
1890       archive  being  modified  or,  in  the  case  of the -x (exclude) or -i
1891       (include) options, on the list of files to be  operated  on,  by  using
1892       backslashes  or  quotes to tell the shell not to do the name expansion.
1893       In general, when zip encounters a name in the list of files to  do,  it
1894       first  looks  for the name in the file system.  If it finds it, it then
1895       adds it to the list of files to do.  If it does not find it,  it  looks
1896       for  the  name  in the zip archive being modified (if it exists), using
1897       the pattern matching characters described above, if present.  For  each
1898       match,  it  will  add  that  name to the list of files to be processed,
1899       unless this name matches one given with the  -x  option,  or  does  not
1900       match any name given with the -i option.
1901
1902       The pattern matching includes the path, and so patterns like \*.o match
1903       names that end in ".o", no matter what the path prefix is.   Note  that
1904       the  backslash must precede every special character (i.e. ?*[]), or the
1905       entire argument must be enclosed in double quotes ("").
1906
1907       In general, use backslashes or double quotes for paths that have  wild‐
1908       cards  to  make  zip do the pattern matching for file paths, and always
1909       for paths and strings that have spaces or wildcards for -i, -x, -R, -d,
1910       and -U and anywhere zip needs to process the wildcards.
1911

ENVIRONMENT

1913       The  following  environment  variables  are  read  and  used  by zip as
1914       described.
1915
1916       ZIPOPT
1917              contains default options that will be  used  when  running  zip.
1918              The  contents of this environment variable will get added to the
1919              command line just after the zip command.
1920
1921       ZIP
1922              [Not on RISC OS and VMS] see ZIPOPT
1923
1924       Zip$Options
1925              [RISC OS] see ZIPOPT
1926
1927       Zip$Exts
1928              [RISC OS] contains extensions separated by a : that  will  cause
1929              native  filenames  with  one  of  the specified extensions to be
1930              added to the zip file with basename and extension swapped.
1931
1932       ZIP_OPTS
1933              [VMS] see ZIPOPT
1934

SEE ALSO

1936       compress(1), shar(1L), tar(1), unzip(1L), gzip(1L)
1937

DIAGNOSTICS

1939       The exit status (or error level) approximates the exit codes defined by
1940       PKWARE and takes on the following values, except under VMS:
1941
1942              0      normal; no errors or warnings detected.
1943
1944              2      unexpected end of zip file.
1945
1946              3      a generic error in the zipfile format was detected.  Pro‐
1947                     cessing may have completed successfully anyway; some bro‐
1948                     ken zipfiles created by other archivers have simple work-
1949                     arounds.
1950
1951              4      zip was unable to allocate memory for one or more buffers
1952                     during program initialization.
1953
1954              5      a  severe error in the zipfile format was detected.  Pro‐
1955                     cessing probably failed immediately.
1956
1957              6      entry too large to be  processed  (such  as  input  files
1958                     larger  than  2 GB when not using Zip64 or trying to read
1959                     an existing archive that is too large) or entry too large
1960                     to be split with zipsplit
1961
1962              7      invalid comment format
1963
1964              8      zip -T failed or out of memory
1965
1966              9      the user aborted zip prematurely with control-C (or simi‐
1967                     lar)
1968
1969              10     zip encountered an error while using a temp file
1970
1971              11     read or seek error
1972
1973              12     zip has nothing to do
1974
1975              13     missing or empty zip file
1976
1977              14     error writing to a file
1978
1979              15     zip was unable to create a file to write to
1980
1981              16     bad command line parameters
1982
1983              18     zip could not open a specified file to read
1984
1985              19     zip was compiled with options not supported on this  sys‐
1986                     tem
1987
1988       VMS  interprets  standard Unix (or PC) return values as other, scarier-
1989       looking things, so zip instead maps them into VMS-style  status  codes.
1990       In  general, zip sets VMS Facility = 1955 (0x07A3), Code = 2* Unix_sta‐
1991       tus, and an appropriate Severity  (as  specified  in  ziperr.h).   More
1992       details   are   included   in   the  VMS-specific  documentation.   See
1993       [.vms]NOTES.TXT and [.vms]vms_msg_gen.c.
1994

BUGS

1996       zip 3.0 is not compatible with PKUNZIP 1.10. Use zip 1.1 to produce zip
1997       files which can be extracted by PKUNZIP 1.10.
1998
1999       zip  files  produced by zip 3.0 must not be updated by zip 1.1 or PKZIP
2000       1.10, if they contain encrypted members or if they have  been  produced
2001       in a pipe or on a non-seekable device. The old versions of zip or PKZIP
2002       would create an archive with an incorrect format.  The old versions can
2003       list the contents of the zip file but cannot extract it anyway (because
2004       of the new compression algorithm).  If you do not  use  encryption  and
2005       use regular disk files, you do not have to care about this problem.
2006
2007       Under  VMS, not all of the odd file formats are treated properly.  Only
2008       stream-LF format zip files are expected to work with zip.   Others  can
2009       be  converted  using  Rahul  Dhesi's BILF program.  This version of zip
2010       handles some of the conversion internally.  When using Kermit to trans‐
2011       fer  zip  files  from  VMS to MSDOS, type "set file type block" on VMS.
2012       When transfering from MSDOS to VMS, type "set file type fixed" on  VMS.
2013       In both cases, type "set file type binary" on MSDOS.
2014
2015       Under  some  older  VMS  versions, zip may hang for file specifications
2016       that use DECnet syntax foo::*.*.
2017
2018       On OS/2, zip cannot match some names, such as those including an excla‐
2019       mation  mark  or a hash sign.  This is a bug in OS/2 itself: the 32-bit
2020       DosFindFirst/Next don't find such names.  Other programs  such  as  GNU
2021       tar are also affected by this bug.
2022
2023       Under  OS/2, the amount of Extended Attributes displayed by DIR is (for
2024       compatibility) the amount returned by the 16-bit version  of  DosQuery‐
2025       PathInfo().  Otherwise OS/2 1.3 and 2.0 would report different EA sizes
2026       when DIRing a file.  However, the  structure  layout  returned  by  the
2027       32-bit  DosQueryPathInfo()  is  a  bit different, it uses extra padding
2028       bytes and link pointers (it's a linked list)  to  have  all  fields  on
2029       4-byte  boundaries for portability to future RISC OS/2 versions. There‐
2030       fore the value reported by zip (which uses this 32-bit-mode size)  dif‐
2031       fers  from  that  reported  by  DIR.   zip stores the 32-bit format for
2032       portability, even the 16-bit MS-C-compiled version running on OS/2 1.3,
2033       so even this one shows the 32-bit-mode size.
2034

AUTHORS

2036       Copyright (C) 1997-2008 Info-ZIP.
2037
2038       Currently distributed under the Info-ZIP license.
2039
2040       Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,
2041       Onno van der Linden, Kai Uwe Rommel, Igor Mandrichenko, John  Bush  and
2042       Paul Kienitz.
2043
2044       Original copyright:
2045
2046       Permission is granted to any individual or institution to use, copy, or
2047       redistribute this software so long as all of  the  original  files  are
2048       included,  that  it  is  not  sold  for profit, and that this copyright
2049       notice is retained.
2050
2051       LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS  ASSOCIATED  UTILITIES  ARE
2052       PROVIDED  AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED
2053       OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE  LIABLE  FOR  ANY
2054       DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE.
2055
2056       Please  send  bug reports and comments using the web page at: www.info-
2057       zip.org.  For bug reports, please  include  the  version  of  zip  (see
2058       zip -h),  the make options used to compile it (see zip -v), the machine
2059       and operating system in use, and as much additional information as pos‐
2060       sible.
2061

ACKNOWLEDGEMENTS

2063       Thanks  to  R. P. Byrne for his Shrink.Pas program, which inspired this
2064       project, and from which the shrink algorithm was stolen; to  Phil  Katz
2065       for  placing in the public domain the zip file format, compression for‐
2066       mat, and .ZIP filename extension, and for accepting  minor  changes  to
2067       the  file  format; to Steve Burg for clarifications on the deflate for‐
2068       mat; to Haruhiko Okumura and Leonid Broukhis for providing some  useful
2069       ideas  for  the  compression  algorithm; to Keith Petersen, Rich Wales,
2070       Hunter Goatley and Mark Adler for providing a mailing list and ftp site
2071       for  the  Info-ZIP  group to use; and most importantly, to the Info-ZIP
2072       group itself (listed in the file infozip.who)  without  whose  tireless
2073       testing  and bug-fixing efforts a portable zip would not have been pos‐
2074       sible.  Finally we should thank (blame) the first  Info-ZIP  moderator,
2075       David  Kirschbaum,  for  getting  us into this mess in the first place.
2076       The manual page was rewritten for Unix by R. P. C. Rodgers and  updated
2077       by E. Gordon for zip 3.0.
2078
2079
2080
2081Info-ZIP                      16 June 2008 (v3.0)                      ZIP(1L)
Impressum