· 10 years ago · Aug 24, 2016, 05:06 PM
1ZIP(1L) ZIP(1L)
2
3
4
5NNAAMMEE
6 zip - package and compress (archive) files
7
8SSYYNNOOPPSSIISS
9 zziipp [-aaAABBccddDDeeEEffFFgghhjjkkllLLmmooqqrrRRSSTTuuvvVVwwXXyyzz!!@@$$] [--longoption ...] [-bb path]
10 [-nn suffixes] [-tt date] [-tttt date] [_z_i_p_f_i_l_e [_f_i_l_e ...]] [--xxii list]
11
12 zziippccllooaakk (see separate man page)
13
14 zziippnnoottee (see separate man page)
15
16 zziippsspplliitt (see separate man page)
17
18 Note: Command line processing in _z_i_p 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
23DDEESSCCRRIIPPTTIIOONN
24 _z_i_p 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 _t_a_r(1) and
27 _c_o_m_p_r_e_s_s(1) and is compatible with PKZIP (Phil Katz's ZIP for MSDOS
28 systems).
29
30 A companion program (_u_n_z_i_p(1L)) unpacks _z_i_p archives. The _z_i_p and
31 _u_n_z_i_p(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 _z_i_p (with some exceptions, notably
34 streamed archives, but recent changes in the zip file standard may
35 facilitate better compatibility). _z_i_p 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). _z_i_p also now supports bbzziipp22 compression if the bbzziipp22
39 library is included when _z_i_p is compiled. Note that PKUNZIP 1.10 can-
40 not extract files produced by PKZIP 2.04 or _z_i_p _3_._0. You must use PKUN-
41 ZIP 2.04g or _u_n_z_i_p _5_._0_p_1 (or later versions) to extract them.
42
43 See the EEXXAAMMPPLLEESS section at the bottom of this page for examples of
44 some typical uses of _z_i_p.
45
46 LLaarrggee AArrcchhiivveess aanndd ZZiipp6644.. _z_i_p 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 --ffzz-- can be used to force _z_i_p 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 _u_n_z_i_p _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 _z_i_p uses).
63
64
65 MMaacc OOSS XX.. Though previous Mac versions had their own _z_i_p port, _z_i_p
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 _z_i_p release.
70
71
72 For a brief help on _z_i_p and _u_n_z_i_p, run each without specifying any
73 parameters on the command line.
74
75
76UUSSEE
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 _z_i_p program puts one or more compressed files into a single _z_i_p 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 _z_i_p ar-
85 chive with a single command. Compression ratios of 2:1 to 3:1 are com-
86 mon for text files. _z_i_p has one compression method (deflation) and can
87 also store files without compression. (If bbzziipp22 support is added, _z_i_p
88 can also compress using bbzziipp22 compression, but such entries require a
89 reasonably modern unzip to decompress. When bbzziipp22 compression is
90 selected, it replaces deflation as the default method.) _z_i_p automati-
91 cally chooses the better of the two (deflation or store or, if bbzziipp22 is
92 selected, bbzziipp22 or store) for each file to be compressed.
93
94 CCoommmmaanndd ffoorrmmaatt.. The basic command format is
95
96 zziipp options archive inpath inpath ...
97
98 where aarrcchhiivvee is a new or existing _z_i_p archive and iinnppaatthh is a direc-
99 tory or file path optionally including wildcards. When given the name
100 of an existing _z_i_p archive, _z_i_p will replace identically named entries
101 in the _z_i_p archive (matching the relative names as stored in the ar-
102 chive) or add entries for new names. For example, if _f_o_o_._z_i_p exists
103 and contains _f_o_o_/_f_i_l_e_1 and _f_o_o_/_f_i_l_e_2, and the directory _f_o_o contains
104 the files _f_o_o_/_f_i_l_e_1 and _f_o_o_/_f_i_l_e_3, then:
105
106 zip -r foo.zip foo
107
108 or more concisely
109
110 zip -r foo foo
111
112 will replace _f_o_o_/_f_i_l_e_1 in _f_o_o_._z_i_p and add _f_o_o_/_f_i_l_e_3 to _f_o_o_._z_i_p. After
113 this, _f_o_o_._z_i_p contains _f_o_o_/_f_i_l_e_1, _f_o_o_/_f_i_l_e_2, and _f_o_o_/_f_i_l_e_3, with
114 _f_o_o_/_f_i_l_e_2 unchanged from before.
115
116 So if before the zip command is executed _f_o_o_._z_i_p has:
117
118 foo/file1 foo/file2
119
120 and directory foo has:
121
122 file1 file3
123
124 then _f_o_o_._z_i_p will have:
125
126 foo/file1 foo/file2 foo/file3
127
128 where _f_o_o_/_f_i_l_e_1 is replaced and _f_o_o_/_f_i_l_e_3 is new.
129
130 --@@ ffiillee lliissttss.. If a file list is specified as --@@ [Not on MacOS], _z_i_p
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 _f_o_o_._z_i_p.
137
138 Under Unix, this option can be used to powerful effect in conjunction
139 with the _f_i_n_d (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 SSttrreeaammiinngg iinnppuutt aanndd oouuttppuutt.. _z_i_p 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 _z_i_p 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 _z_i_p 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, _z_i_p 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 _z_i_p archives created in this manner can be extracted with the program
182 _f_u_n_z_i_p which is provided in the _u_n_z_i_p package, or by _g_u_n_z_i_p which is
183 provided in the _g_z_i_p package (but some _g_u_n_z_i_p may not support this if
184 _z_i_p 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 _u_n_z_i_p used.
189
190 If Zip64 support for large files and archives is enabled and _z_i_p is
191 used as a filter, _z_i_p 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 --ffzz-- can be used to prevent use of Zip64, but _z_i_p will exit with
198 an error if Zip64 was in fact needed. _z_i_p _3 and _u_n_z_i_p _6 and later can
199 read archives with Zip64 entries. Also, _z_i_p removes the Zip64 exten-
200 sions if not needed when archive entries are copied (see the --UU
201 (----ccooppyy) option).
202
203 When directing the output to another file, note that all options should
204 be before the redirection including --xx. For example:
205
206 zip archive "*.h" "*.c" -x donotinclude.h orthis.h > tofile
207
208 ZZiipp ffiilleess.. When changing an existing _z_i_p archive, _z_i_p 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 _z_i_p archive does not contain an extension, the
214 extension ..zziipp is added. If the name already contains an extension
215 other than ..zziipp, the existing extension is kept unchanged. However,
216 split archives (archives split over multiple files) require the ..zziipp
217 extension on the last split.
218
219 SSccaannnniinngg aanndd rreeaaddiinngg ffiilleess.. When _z_i_p starts, it scans for files to
220 process (if needed). If this scan takes longer than about 5 seconds,
221 _z_i_p 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 --ddss dot size option, but the dots are turned off by the
231 --qq quiet option. The --ssff 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 _z_i_p is not able to read a file, it issues a warning but continues.
236 See the --MMMM option below for more on how _z_i_p 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 CCoommmmaanndd mmooddeess.. _z_i_p now supports two distinct types of command modes,
242 eexxtteerrnnaall and iinntteerrnnaall. The eexxtteerrnnaall modes (add, update, and freshen)
243 read files from the file system (as well as from an existing archive)
244 while the iinntteerrnnaall modes (delete and copy) operate exclusively on
245 entries in an existing archive.
246
247
248 aadddd
249 Update existing entries and add new files. If the archive does
250 not exist create it. This is the default mode.
251
252 uuppddaattee (--uu)
253 Update existing entries if newer on the file system and add new
254 files. If the archive does not exist issue warning then create
255 a new archive.
256
257 ffrreesshheenn (--ff)
258 Update existing entries of an archive if newer on the file sys-
259 tem. Does not add new files to the archive.
260
261 ddeelleettee (--dd)
262 Select entries in an existing archive and delete them.
263
264 ccooppyy (--UU)
265 Select entries in an existing archive and copy them to a new ar-
266 chive. This new mode is similar to uuppddaattee but command line pat-
267 terns select entries in the existing archive rather than files
268 from the file system and it uses the ----oouutt option to write the
269 resulting archive to a new file rather than update the existing
270 archive, leaving the original archive unchanged.
271
272 The new File Sync option (--FFSS) is also considered a new mode, though it
273 is similar to uuppddaattee. This mode synchronizes the archive with the
274 files on the OS, only replacing files in the archive if the file time
275 or size of the OS file is different, adding new files, and deleting
276 entries from the archive where there is no matching file. As this mode
277 can delete entries from the archive, consider making a backup copy of
278 the archive.
279
280 Also see --DDFF for creating difference archives.
281
282 See each option description below for details and the EEXXAAMMPPLLEESS section
283 below for examples.
284
285 SSpplliitt aarrcchhiivveess.. _z_i_p version 3.0 and later can create split archives.
286 A sspplliitt aarrcchhiivvee is a standard zip archive split over multiple files.
287 (Note that split archives are not just archives split in to pieces, as
288 the offsets of entries are now based on the start of each split. Con-
289 catenating the pieces together will invalidate these offsets, but _u_n_z_i_p
290 can usually deal with it. _z_i_p will usually refuse to process such a
291 spliced archive unless the --FFFF fix option is used to fix the offsets.)
292
293 One use of split archives is storing a large archive on multiple remov-
294 able media. For a split archive with 20 split files the files are typ-
295 ically named (replace ARCHIVE with the name of your archive) AR-
296 CHIVE.z01, ARCHIVE.z02, ..., ARCHIVE.z19, ARCHIVE.zip. Note that the
297 last file is the ..zziipp file. In contrast, ssppaannnneedd aarrcchhiivveess are the
298 original multi-disk archive generally requiring floppy disks and using
299 volume labels to store disk numbers. _z_i_p supports split archives but
300 not spanned archives, though a procedure exists for converting split
301 archives of the right size to spanned archives. The reverse is also
302 true, where each file of a spanned archive can be copied in order to
303 files with the above names to create a split archive.
304
305 Use --ss to set the split size and create a split archive. The size is
306 given as a number followed optionally by one of k (kB), m (MB), g (GB),
307 or t (TB) (the default is m). The --sspp option can be used to pause _z_i_p
308 between splits to allow changing removable media, for example, but read
309 the descriptions and warnings for both --ss and --sspp below.
310
311 Though _z_i_p does not update split archives, _z_i_p provides the new option
312 --OO (----oouuttppuutt--ffiillee or ----oouutt) to allow split archives to be updated and
313 saved in a new archive. For example,
314
315 zip inarchive.zip foo.c bar.c --out outarchive.zip
316
317 reads archive iinnaarrcchhiivvee..zziipp, even if split, adds the files ffoooo..cc and
318 bbaarr..cc, and writes the resulting archive to oouuttaarrcchhiivvee..zziipp. If iinnaarr--
319 cchhiivvee..zziipp is split then oouuttaarrcchhiivvee..zziipp defaults to the same split size.
320 Be aware that if oouuttaarrcchhiivvee..zziipp and any split files that are created
321 with it already exist, these are always overwritten as needed without
322 warning. This may be changed in the future.
323
324 UUnniiccooddee.. Though the zip standard requires storing paths in an archive
325 using a specific character set, in practice zips have stored paths in
326 archives in whatever the local character set is. This creates problems
327 when an archive is created or updated on a system using one character
328 set and then extracted on another system using a different character
329 set. When compiled with Unicode support enabled on platforms that sup-
330 port wide characters, _z_i_p now stores, in addition to the standard local
331 path for backward compatibility, the UTF-8 translation of the path.
332 This provides a common universal character set for storing paths that
333 allows these paths to be fully extracted on other systems that support
334 Unicode and to match as close as possible on systems that don't.
335
336 On Win32 systems where paths are internally stored as Unicode but rep-
337 resented in the local character set, it's possible that some paths will
338 be skipped during a local character set directory scan. _z_i_p with Uni-
339 code support now can read and store these paths. Note that Win 9x sys-
340 tems and FAT file systems don't fully support Unicode.
341
342 Be aware that console windows on Win32 and Unix, for example, sometimes
343 don't accurately show all characters due to how each operating system
344 switches in character sets for display. However, directory navigation
345 tools should show the correct paths if the needed fonts are loaded.
346
347 CCoommmmaanndd lliinnee ffoorrmmaatt.. This version of _z_i_p has updated command line pro-
348 cessing and support for long options.
349
350 Short options take the form
351
352 -s[-][s[-]...][value][=value][ value]
353
354 where s is a one or two character short option. A short option that
355 takes a value is last in an argument and anything after it is taken as
356 the value. If the option can be negated and "-" immediately follows
357 the option, the option is negated. Short options can also be given as
358 separate arguments
359
360 -s[-][value][=value][ value] -s[-][value][=value][ value] ...
361
362 Short options in general take values either as part of the same argu-
363 ment or as the following argument. An optional = is also supported.
364 So
365
366 -ttmmddyyyy
367
368 and
369
370 -tt=mmddyyyy
371
372 and
373
374 -tt mmddyyyy
375
376 all work. The --xx and --ii options accept lists of values and use a
377 slightly different format described below. See the --xx and --ii options.
378
379 Long options take the form
380
381 --longoption[-][=value][ value]
382
383 where the option starts with --, has a multicharacter name, can include
384 a trailing dash to negate the option (if the option supports it), and
385 can have a value (option argument) specified by preceeding it with =
386 (no spaces). Values can also follow the argument. So
387
388 --before-date=mmddyyyy
389
390 and
391
392 --before-date mmddyyyy
393
394 both work.
395
396 Long option names can be shortened to the shortest unique abbreviation.
397 See the option descriptions below for which support long options. To
398 avoid confusion, avoid abbreviating a negatable option with an embedded
399 dash ("-") at the dash if you plan to negate it (the parser would con-
400 sider a trailing dash, such as for the option ----ssoommee--ooppttiioonn using
401 ----ssoommee-- as the option, as part of the name rather than a negating
402 dash). This may be changed to force the last dash in ----ssoommee-- to be
403 negating in the future.
404
405OOPPTTIIOONNSS
406 --aa
407 ----aasscciiii
408 [Systems using EBCDIC] Translate file to ASCII format.
409
410
411 --AA
412 ----aaddjjuusstt--ssffxx
413 Adjust self-extracting executable archive. A self-extracting
414 executable archive is created by prepending the SFX stub to an
415 existing archive. The --AA option tells _z_i_p to adjust the entry
416 offsets stored in the archive to take into account this "pream-
417 ble" data.
418
419 Note: self-extracting archives for the Amiga are a special case. At
420 present, only the Amiga port of _z_i_p is capable of adjusting or updating
421 these without corrupting them. -J can be used to remove the SFX stub if
422 other updates need to be made.
423
424
425 --AACC
426 ----aarrcchhiivvee--cclleeaarr
427 [WIN32] Once archive is created (and tested if --TT is used,
428 which is recommended), clear the archive bits of files pro-
429 cessed. WARNING: Once the bits are cleared they are cleared.
430 You may want to use the --ssff show files option to store the list
431 of files processed in case the archive operation must be
432 repeated. Also consider using the --MMMM must match option. Be
433 sure to check out --DDFF as a possibly better way to do incremental
434 backups.
435
436
437 --AASS
438 ----aarrcchhiivvee--sseett
439 [WIN32] Only include files that have the archive bit set.
440 Directories are not stored when --AASS is used, though by default
441 the paths of entries, including directories, are stored as usual
442 and can be used by most unzips to recreate directories.
443
444 The archive bit is set by the operating system when a file is
445 modified and, if used with --AACC, --AASS can provide an incremental
446 backup capability. However, other applications can modify the
447 archive bit and it may not be a reliable indicator of which
448 files have changed since the last archive operation. Alterna-
449 tive ways to create incremental backups are using --tt to use file
450 dates, though this won't catch old files copied to directories
451 being archived, and --DDFF to create a differential archive.
452
453
454 --BB
455 ----bbiinnaarryy
456 [VM/CMS and MVS] force file to be read binary (default is text).
457
458
459 --BBn [TANDEM] set Edit/Enscribe formatting options with n defined as
460 bit 0: Don't add delimiter (Edit/Enscribe)
461 bit 1: Use LF rather than CR/LF as delimiter (Edit/Enscribe)
462 bit 2: Space fill record to maximum record length (Enscribe)
463 bit 3: Trim trailing space (Enscribe)
464 bit 8: Force 30K (Expand) large read for unstructured files
465
466
467 --bb path
468 ----tteemmpp--ppaatthh path
469 Use the specified _p_a_t_h for the temporary _z_i_p archive. For exam-
470 ple:
471
472 zip -b /tmp stuff *
473
474 will put the temporary _z_i_p archive in the directory _/_t_m_p, copy-
475 ing over _s_t_u_f_f_._z_i_p to the current directory when done. This
476 option is useful when updating an existing archive and the file
477 system containing this old archive does not have enough space to
478 hold both old and new archives at the same time. It may also be
479 useful when streaming in some cases to avoid the need for data
480 descriptors. Note that using this option may require _z_i_p take
481 additional time to copy the archive file when done to the desti-
482 nation file system.
483
484
485 --cc
486 ----eennttrryy--ccoommmmeennttss
487 Add one-line comments for each file. File operations (adding,
488 updating) are done first, and the user is then prompted for a
489 one-line comment for each file. Enter the comment followed by
490 return, or just return for no comment.
491
492
493 --CC
494 ----pprreesseerrvvee--ccaassee
495 [VMS] Preserve case all on VMS. Negating this option (--CC--)
496 downcases.
497
498
499 --CC22
500 ----pprreesseerrvvee--ccaassee--22
501 [VMS] Preserve case ODS2 on VMS. Negating this option (--CC22--)
502 downcases.
503
504
505 --CC55
506 ----pprreesseerrvvee--ccaassee--55
507 [VMS] Preserve case ODS5 on VMS. Negating this option (--CC55--)
508 downcases.
509
510
511 --dd
512 ----ddeelleettee
513 Remove (delete) entries from a _z_i_p archive. For example:
514
515 zip -d foo foo/tom/junk foo/harry/\* \*.o
516
517 will remove the entry _f_o_o_/_t_o_m_/_j_u_n_k, all of the files that start
518 with _f_o_o_/_h_a_r_r_y_/, and all of the files that end with ..oo (in any
519 path). Note that shell pathname expansion has been inhibited
520 with backslashes, so that _z_i_p can see the asterisks, enabling
521 _z_i_p to match on the contents of the _z_i_p archive instead of the
522 contents of the current directory. (The backslashes are not
523 used on MSDOS-based platforms.) Can also use quotes to escape
524 the asterisks as in
525
526 zip -d foo foo/tom/junk "foo/harry/*" "*.o"
527
528 Not escaping the asterisks on a system where the shell expands
529 wildcards could result in the asterisks being converted to a
530 list of files in the current directory and that list used to
531 delete entries from the archive.
532
533 Under MSDOS, --dd is case sensitive when it matches names in the
534 _z_i_p archive. This requires that file names be entered in upper
535 case if they were zipped by PKZIP on an MSDOS system. (We con-
536 sidered making this case insensitive on systems where paths were
537 case insensitive, but it is possible the archive came from a
538 system where case does matter and the archive could include both
539 BBaarr and bbaarr as separate files in the archive.) But see the new
540 option --iicc to ignore case in the archive.
541
542
543 --ddbb
544 ----ddiissppllaayy--bbyytteess
545 Display running byte counts showing the bytes zipped and the
546 bytes to go.
547
548
549 --ddcc
550 ----ddiissppllaayy--ccoouunnttss
551 Display running count of entries zipped and entries to go.
552
553
554 --dddd
555 ----ddiissppllaayy--ddoottss
556 Display dots while each entry is zipped (except on ports that
557 have their own progress indicator). See --ddss below for setting
558 dot size. The default is a dot every 10 MB of input file pro-
559 cessed. The --vv option also displays dots (previously at a much
560 higher rate than this but now --vv also defaults to 10 MB) and
561 this rate is also controlled by --ddss.
562
563
564 --ddff
565 ----ddaattaaffoorrkk
566 [MacOS] Include only data-fork of files zipped into the archive.
567 Good for exporting files to foreign operating-systems.
568 Resource-forks will be ignored at all.
569
570
571 --ddgg
572 ----ddiissppllaayy--gglloobbaallddoottss
573 Display progress dots for the archive instead of for each file.
574 The command
575
576 zip -qdgds 10m
577
578 will turn off most output except dots every 10 MB.
579
580
581 --ddss size
582 ----ddoott--ssiizzee size
583 Set amount of input file processed for each dot displayed. See
584 --dddd to enable displaying dots. Setting this option implies --dddd.
585 Size is in the format nm where n is a number and m is a multi-
586 plier. Currently m can be k (KB), m (MB), g (GB), or t (TB), so
587 if n is 100 and m is k, size would be 100k which is 100 KB. The
588 default is 10 MB.
589
590 The --vv option also displays dots and now defaults to 10 MB also.
591 This rate is also controlled by this option. A size of 0 turns
592 dots off.
593
594 This option does not control the dots from the "Scanning files"
595 message as _z_i_p scans for input files. The dot size for that is
596 fixed at 2 seconds or a fixed number of entries, whichever is
597 longer.
598
599
600 --dduu
601 ----ddiissppllaayy--uussiizzee
602 Display the uncompressed size of each entry.
603
604
605 --ddvv
606 ----ddiissppllaayy--vvoolluummee
607 Display the volume (disk) number each entry is being read from,
608 if reading an existing archive, and being written to.
609
610
611 --DD
612 ----nnoo--ddiirr--eennttrriieess
613 Do not create entries in the _z_i_p archive for directories.
614 Directory entries are created by default so that their
615 attributes can be saved in the zip archive. The environment
616 variable ZIPOPT can be used to change the default options. For
617 example under Unix with sh:
618
619 ZIPOPT="-D"; export ZIPOPT
620
621 (The variable ZIPOPT can be used for any option, including --ii
622 and --xx using a new option format detailed below, and can include
623 several options.) The option --DD is a shorthand for --xx "*/" but
624 the latter previously could not be set as default in the ZIPOPT
625 environment variable as the contents of ZIPOPT gets inserted
626 near the beginning of the command line and the file list had to
627 end at the end of the line.
628
629 This version of _z_i_p does allow --xx and --ii options in ZIPOPT if
630 the form
631
632 --xx file file ... @@
633
634 is used, where the @ (an argument that is just @) terminates the
635 list.
636
637
638 --DDFF
639 ----ddiiffffeerreennccee--aarrcchhiivvee
640 Create an archive that contains all new and changed files since
641 the original archive was created. For this to work, the input
642 file list and current directory must be the same as during the
643 original _z_i_p operation.
644
645 For example, if the existing archive was created using
646
647 zip -r foofull .
648
649 from the _b_a_r directory, then the command
650
651 zip -r foofull . -DF --out foonew
652
653 also from the _b_a_r directory creates the archive _f_o_o_n_e_w with just
654 the files not in _f_o_o_f_u_l_l and the files where the size or file
655 time of the files do not match those in _f_o_o_f_u_l_l.
656
657 Note that the timezone environment variable TZ should be set
658 according to the local timezone in order for this option to work
659 correctly. A change in timezone since the original archive was
660 created could result in no times matching and all files being
661 included.
662
663 A possible approach to backing up a directory might be to create
664 a normal archive of the contents of the directory as a full
665 backup, then use this option to create incremental backups.
666
667
668 --ee
669 ----eennccrryypptt
670 Encrypt the contents of the _z_i_p archive using a password which
671 is entered on the terminal in response to a prompt (this will
672 not be echoed; if standard error is not a tty, _z_i_p will exit
673 with an error). The password prompt is repeated to save the
674 user from typing errors.
675
676
677 --EE
678 ----lloonnggnnaammeess
679 [OS/2] Use the .LONGNAME Extended Attribute (if found) as file-
680 name.
681
682
683 --ff
684 ----ffrreesshheenn
685 Replace (freshen) an existing entry in the _z_i_p archive only if
686 it has been modified more recently than the version already in
687 the _z_i_p archive; unlike the update option (--uu) this will not add
688 files that are not already in the _z_i_p archive. For example:
689
690 zip -f foo
691
692 This command should be run from the same directory from which
693 the original _z_i_p command was run, since paths stored in _z_i_p ar-
694 chives are always relative.
695
696 Note that the timezone environment variable TZ should be set
697 according to the local timezone in order for the --ff, --uu and --oo
698 options to work correctly.
699
700 The reasons behind this are somewhat subtle but have to do with
701 the differences between the Unix-format file times (always in
702 GMT) and most of the other operating systems (always local time)
703 and the necessity to compare the two. A typical TZ value is
704 ``MET-1MEST'' (Middle European time with automatic adjustment
705 for ``summertime'' or Daylight Savings Time).
706
707 The format is TTThhDDD, where TTT is the time zone such as MET,
708 hh is the difference between GMT and local time such as -1
709 above, and DDD is the time zone when daylight savings time is in
710 effect. Leave off the DDD if there is no daylight savings time.
711 For the US Eastern time zone EST5EDT.
712
713
714 --FF
715 ----ffiixx
716 --FFFF
717 ----ffiixxffiixx
718 Fix the _z_i_p archive. The --FF option can be used if some portions
719 of the archive are missing, but requires a reasonably intact
720 central directory. The input archive is scanned as usual, but
721 _z_i_p will ignore some problems. The resulting archive should be
722 valid, but any inconsistent entries will be left out.
723
724 When doubled as in --FFFF, the archive is scanned from the begin-
725 ning and _z_i_p scans for special signatures to identify the limits
726 between the archive members. The single --FF is more reliable if
727 the archive is not too much damaged, so try this option first.
728
729 If the archive is too damaged or the end has been truncated, you
730 must use --FFFF. This is a change from _z_i_p _2_._3_2, where the --FF
731 option is able to read a truncated archive. The --FF option now
732 more reliably fixes archives with minor damage and the --FFFF
733 option is needed to fix archives where --FF might have been suffi-
734 cient before.
735
736 Neither option will recover archives that have been incorrectly
737 transferred in ascii mode instead of binary. After the repair,
738 the --tt option of _u_n_z_i_p may show that some files have a bad CRC.
739 Such files cannot be recovered; you can remove them from the ar-
740 chive using the --dd option of _z_i_p.
741
742 Note that --FFFF may have trouble fixing archives that include an
743 embedded zip archive that was stored (without compression) in
744 the archive and, depending on the damage, it may find the
745 entries in the embedded archive rather than the archive itself.
746 Try --FF first as it does not have this problem.
747
748 The format of the fix commands have changed. For example, to
749 fix the damaged archive _f_o_o_._z_i_p,
750
751 zip -F foo --out foofix
752
753 tries to read the entries normally, copying good entries to the
754 new archive _f_o_o_f_i_x_._z_i_p. If this doesn't work, as when the ar-
755 chive is truncated, or if some entries you know are in the ar-
756 chive are missed, then try
757
758 zip -FF foo --out foofixfix
759
760 and compare the resulting archive to the archive created by --FF.
761 The --FFFF option may create an inconsistent archive. Depending on
762 what is damaged, you can then use the --FF option to fix that ar-
763 chive.
764
765 A split archive with missing split files can be fixed using --FF
766 if you have the last split of the archive (the ..zziipp file). If
767 this file is missing, you must use --FFFF to fix the archive, which
768 will prompt you for the splits you have.
769
770 Currently the fix options can't recover entries that have a bad
771 checksum or are otherwise damaged.
772
773
774 --FFII
775 ----ffiiffoo [Unix] Normally _z_i_p skips reading any FIFOs (named pipes)
776 encountered, as _z_i_p can hang if the FIFO is not being fed. This
777 option tells _z_i_p to read the contents of any FIFO it finds.
778
779
780 --FFSS
781 ----ffiilleessyynncc
782 Synchronize the contents of an archive with the files on the OS.
783 Normally when an archive is updated, new files are added and
784 changed files are updated but files that no longer exist on the
785 OS are not deleted from the archive. This option enables a new
786 mode that checks entries in the archive against the file system.
787 If the file time and file size of the entry matches that of the
788 OS file, the entry is copied from the old archive instead of
789 being read from the file system and compressed. If the OS file
790 has changed, the entry is read and compressed as usual. If the
791 entry in the archive does not match a file on the OS, the entry
792 is deleted. Enabling this option should create archives that
793 are the same as new archives, but since existing entries are
794 copied instead of compressed, updating an existing archive with
795 --FFSS can be much faster than creating a new archive. Also con-
796 sider using --uu for updating an archive.
797
798 For this option to work, the archive should be updated from the
799 same directory it was created in so the relative paths match.
800 If few files are being copied from the old archive, it may be
801 faster to create a new archive instead.
802
803 Note that the timezone environment variable TZ should be set
804 according to the local timezone in order for this option to work
805 correctly. A change in timezone since the original archive was
806 created could result in no times matching and recompression of
807 all files.
808
809 This option deletes files from the archive. If you need to pre-
810 serve the original archive, make a copy of the archive first or
811 use the ----oouutt option to output the updated archive to a new
812 file. Even though it may be slower, creating a new archive with
813 a new archive name is safer, avoids mismatches between archive
814 and OS paths, and is preferred.
815
816
817 --gg
818 ----ggrrooww
819 Grow (append to) the specified _z_i_p archive, instead of creating
820 a new one. If this operation fails, _z_i_p attempts to restore the
821 archive to its original state. If the restoration fails, the ar-
822 chive might become corrupted. This option is ignored when
823 there's no existing archive or when at least one archive member
824 must be updated or deleted.
825
826
827 --hh
828 --??
829 ----hheellpp
830 Display the _z_i_p help information (this also appears if _z_i_p is
831 run with no arguments).
832
833
834 --hh22
835 ----mmoorree--hheellpp
836 Display extended help including more on command line format,
837 pattern matching, and more obscure options.
838
839
840 --ii files
841 ----iinncclluuddee files
842 Include only the specified files, as in:
843
844 zip -r foo . -i \*.c
845
846 which will include only the files that end in .c in the current
847 directory and its subdirectories. (Note for PKZIP users: the
848 equivalent command is
849
850 pkzip -rP foo *.c
851
852 PKZIP does not allow recursion in directories other than the
853 current one.) The backslash avoids the shell filename substitu-
854 tion, so that the name matching is performed by _z_i_p at all
855 directory levels. [This is for Unix and other systems where \
856 escapes the next character. For other systems where the shell
857 does not process * do not use \ and the above is
858
859 zip -r foo . -i *.c
860
861 Examples are for Unix unless otherwise specified.] So to
862 include dir, a directory directly under the current directory,
863 use
864
865 zip -r foo . -i dir/\*
866
867 or
868
869 zip -r foo . -i "dir/*"
870
871 to match paths such as dir/a and dir/b/file.c [on ports without
872 wildcard expansion in the shell such as MSDOS and Windows
873
874 zip -r foo . -i dir/*
875
876 is used.] Note that currently the trailing / is needed for
877 directories (as in
878
879 zip -r foo . -i dir/
880
881 to include directory dir).
882
883 The long option form of the first example is
884
885 zip -r foo . --include \*.c
886
887 and does the same thing as the short option form.
888
889 Though the command syntax used to require --ii at the end of the
890 command line, this version actually allows --ii (or ----iinncclluuddee)
891 anywhere. The list of files terminates at the next argument
892 starting with --, the end of the command line, or the list termi-
893 nator @@ (an argument that is just @). So the above can be given
894 as
895
896 zip -i \*.c @ -r foo .
897
898 for example. There must be a space between the option and the
899 first file of a list. For just one file you can use the single
900 value form
901
902 zip -i\*.c -r foo .
903
904 (no space between option and value) or
905
906 zip --include=\*.c -r foo .
907
908 as additional examples. The single value forms are not recom-
909 mended because they can be confusing and, in particular, the
910 --iiffiillee format can cause problems if the first letter of ffiillee
911 combines with ii to form a two-letter option starting with ii.
912 Use --sscc to see how your command line will be parsed.
913
914 Also possible:
915
916 zip -r foo . -i@include.lst
917
918 which will only include the files in the current directory and
919 its subdirectories that match the patterns in the file
920 include.lst.
921
922 Files to --ii and --xx are patterns matching internal archive paths.
923 See --RR for more on patterns.
924
925
926 --II
927 ----nnoo--iimmaaggee
928 [Acorn RISC OS] Don't scan through Image files. When used, _z_i_p
929 will not consider Image files (eg. DOS partitions or Spark ar-
930 chives when SparkFS is loaded) as directories but will store
931 them as single files.
932
933 For example, if you have SparkFS loaded, zipping a Spark archive
934 will result in a zipfile containing a directory (and its con-
935 tent) while using the 'I' option will result in a zipfile con-
936 taining a Spark archive. Obviously this second case will also be
937 obtained (without the 'I' option) if SparkFS isn't loaded.
938
939
940 --iicc
941 ----iiggnnoorree--ccaassee
942 [VMS, WIN32] Ignore case when matching archive entries. This
943 option is only available on systems where the case of files is
944 ignored. On systems with case-insensitive file systems, case is
945 normally ignored when matching files on the file system but is
946 not ignored for -f (freshen), -d (delete), -U (copy), and simi-
947 lar modes when matching against archive entries (currently -f
948 ignores case on VMS) because archive entries can be from systems
949 where case does matter and names that are the same except for
950 case can exist in an archive. The --iicc option makes all matching
951 case insensitive. This can result in multiple archive entries
952 matching a command line pattern.
953
954
955 --jj
956 ----jjuunnkk--ppaatthhss
957 Store just the name of a saved file (junk the path), and do not
958 store directory names. By default, _z_i_p will store the full path
959 (relative to the current directory).
960
961
962 --jjjj
963 ----aabbssoolluuttee--ppaatthh
964 [MacOS] record Fullpath (+ Volname). The complete path including
965 volume will be stored. By default the relative path will be
966 stored.
967
968
969 --JJ
970 ----jjuunnkk--ssffxx
971 Strip any prepended data (e.g. a SFX stub) from the archive.
972
973 --kk
974 ----DDOOSS--nnaammeess
975 Attempt to convert the names and paths to conform to MSDOS,
976 store only the MSDOS attribute (just the user write attribute
977 from Unix), and mark the entry as made under MSDOS (even though
978 it was not); for compatibility with PKUNZIP under MSDOS which
979 cannot handle certain names such as those with two dots.
980
981 --ll
982 ----ttoo--ccrrllff
983 Translate the Unix end-of-line character LF into the MSDOS con-
984 vention CR LF. This option should not be used on binary files.
985 This option can be used on Unix if the zip file is intended for
986 PKUNZIP under MSDOS. If the input files already contain CR LF,
987 this option adds an extra CR. This is to ensure that uunnzziipp --aa on
988 Unix will get back an exact copy of the original file, to undo
989 the effect of zziipp --ll. See --llll for how binary files are handled.
990
991 --llaa
992 ----lloogg--aappppeenndd
993 Append to existing logfile. Default is to overwrite.
994
995 --llff logfilepath
996 ----llooggffiillee--ppaatthh logfilepath
997 Open a logfile at the given path. By default any existing file
998 at that location is overwritten, but the --llaa option will result
999 in an existing file being opened and the new log information
1000 appended to any existing information. Only warnings and errors
1001 are written to the log unless the --llii option is also given, then
1002 all information messages are also written to the log.
1003
1004 --llii
1005 ----lloogg--iinnffoo
1006 Include information messages, such as file names being zipped,
1007 in the log. The default is to only include the command line,
1008 any warnings and errors, and the final status.
1009
1010 --llll
1011 ----ffrroomm--ccrrllff
1012 Translate the MSDOS end-of-line CR LF into Unix LF. This option
1013 should not be used on binary files. This option can be used on
1014 MSDOS if the zip file is intended for unzip under Unix. If the
1015 file is converted and the file is later determined to be binary
1016 a warning is issued and the file is probably corrupted. In this
1017 release if --llll detects binary in the first buffer read from a
1018 file, _z_i_p now issues a warning and skips line end conversion on
1019 the file. This check seems to catch all binary files tested,
1020 but the original check remains and if a converted file is later
1021 determined to be binary that warning is still issued. A new
1022 algorithm is now being used for binary detection that should
1023 allow line end conversion of text files in UUTTFF--88 and similar
1024 encodings.
1025
1026 --LL
1027 ----lliicceennssee
1028 Display the _z_i_p license.
1029
1030 --mm
1031 ----mmoovvee
1032 Move the specified files into the _z_i_p archive; actually, this
1033 deletes the target directories/files after making the specified
1034 _z_i_p archive. If a directory becomes empty after removal of the
1035 files, the directory is also removed. No deletions are done
1036 until _z_i_p has created the archive without error. This is useful
1037 for conserving disk space, but is potentially dangerous so it is
1038 recommended to use it in combination with --TT to test the archive
1039 before removing all input files.
1040
1041 --MMMM
1042 ----mmuusstt--mmaattcchh
1043 All input patterns must match at least one file and all input
1044 files found must be readable. Normally when an input pattern
1045 does not match a file the "name not matched" warning is issued
1046 and when an input file has been found but later is missing or
1047 not readable a missing or not readable warning is issued. In
1048 either case _z_i_p continues creating the archive, with missing or
1049 unreadable new files being skipped and files already in the ar-
1050 chive remaining unchanged. After the archive is created, if any
1051 files were not readable _z_i_p returns the OPEN error code (18 on
1052 most systems) instead of the normal success return (0 on most
1053 systems). With --MMMM set, _z_i_p exits as soon as an input pattern
1054 is not matched (whenever the "name not matched" warning would be
1055 issued) or when an input file is not readable. In either case
1056 _z_i_p exits with an OPEN error and no archive is created.
1057
1058 This option is useful when a known list of files is to be zipped
1059 so any missing or unreadable files will result in an error. It
1060 is less useful when used with wildcards, but _z_i_p will still exit
1061 with an error if any input pattern doesn't match at least one
1062 file and if any matched files are unreadable. If you want to
1063 create the archive anyway and only need to know if files were
1064 skipped, don't use --MMMM and just check the return code. Also --llff
1065 could be useful.
1066
1067 --nn suffixes
1068 ----ssuuffffiixxeess suffixes
1069 Do not attempt to compress files named with the given ssuuffffiixxeess.
1070 Such files are simply stored (0% compression) in the output zip
1071 file, so that _z_i_p doesn't waste its time trying to compress
1072 them. The suffixes are separated by either colons or semi-
1073 colons. For example:
1074
1075 zip -rn .Z:.zip:.tiff:.gif:.snd foo foo
1076
1077 will copy everything from _f_o_o into _f_o_o_._z_i_p, but will store any
1078 files that end in _._Z, _._z_i_p, _._t_i_f_f, _._g_i_f, or _._s_n_d without trying
1079 to compress them (image and sound files often have their own
1080 specialized compression methods). By default, _z_i_p does not com-
1081 press files with extensions in the list
1082 _._Z_:_._z_i_p_:_._z_o_o_:_._a_r_c_:_._l_z_h_:_._a_r_j_. Such files are stored directly in
1083 the output archive. The environment variable ZIPOPT can be used
1084 to change the default options. For example under Unix with csh:
1085
1086 setenv ZIPOPT "-n .gif:.zip"
1087
1088 To attempt compression on all files, use:
1089
1090 zip -n : foo
1091
1092 The maximum compression option --99 also attempts compression on
1093 all files regardless of extension.
1094
1095 On Acorn RISC OS systems the suffixes are actually filetypes (3
1096 hex digit format). By default, _z_i_p does not compress files with
1097 filetypes in the list DDC:D96:68E (i.e. Archives, CFS files and
1098 PackDir files).
1099
1100 --nnww
1101 ----nnoo--wwiilldd
1102 Do not perform internal wildcard processing (shell processing of
1103 wildcards is still done by the shell unless the arguments are
1104 escaped). Useful if a list of paths is being read and no wild-
1105 card substitution is desired.
1106
1107 --NN
1108 ----nnootteess
1109 [Amiga, MacOS] Save Amiga or MacOS filenotes as zipfile com-
1110 ments. They can be restored by using the -N option of _u_n_z_i_p. If
1111 -c is used also, you are prompted for comments only for those
1112 files that do not have filenotes.
1113
1114 --oo
1115 ----llaatteesstt--ttiimmee
1116 Set the "last modified" time of the _z_i_p archive to the latest
1117 (oldest) "last modified" time found among the entries in the _z_i_p
1118 archive. This can be used without any other operations, if
1119 desired. For example:
1120
1121 zip -o foo
1122
1123 will change the last modified time of ffoooo..zziipp to the latest time
1124 of the entries in ffoooo..zziipp.
1125
1126 --OO output-file
1127 ----oouuttppuutt--ffiillee output-file
1128 Process the archive changes as usual, but instead of updating
1129 the existing archive, output the new archive to output-file.
1130 Useful for updating an archive without changing the existing ar-
1131 chive and the input archive must be a different file than the
1132 output archive.
1133
1134 This option can be used to create updated split archives. It
1135 can also be used with --UU to copy entries from an existing ar-
1136 chive to a new archive. See the EEXXAAMMPPLLEESS section below.
1137
1138 Another use is converting _z_i_p files from one split size to
1139 another. For instance, to convert an archive with 700 MB CD
1140 splits to one with 2 GB DVD splits, can use:
1141
1142 zip -s 2g cd-split.zip --out dvd-split.zip
1143
1144 which uses copy mode. See --UU below. Also:
1145
1146 zip -s 0 split.zip --out unsplit.zip
1147
1148 will convert a split archive to a single-file archive.
1149
1150 Copy mode will convert stream entries (using data descriptors
1151 and which should be compatible with most unzips) to normal
1152 entries (which should be compatible with all unzips), except if
1153 standard encryption was used. For archives with encrypted
1154 entries, _z_i_p_c_l_o_a_k will decrypt the entries and convert them to
1155 normal entries.
1156
1157 --pp
1158 ----ppaatthhss
1159 Include relative file paths as part of the names of files stored
1160 in the archive. This is the default. The --jj option junks the
1161 paths and just stores the names of the files.
1162
1163 --PP password
1164 ----ppaasssswwoorrdd password
1165 Use _p_a_s_s_w_o_r_d to encrypt zipfile entries (if any). TTHHIISS IISS IINNSSEE--
1166 CCUURREE!! Many multi-user operating systems provide ways for any
1167 user to see the current command line of any other user; even on
1168 stand-alone systems there is always the threat of over-the-
1169 shoulder peeking. Storing the plaintext password as part of a
1170 command line in an automated script is even worse. Whenever
1171 possible, use the non-echoing, interactive prompt to enter pass-
1172 words. (And where security is truly important, use strong
1173 encryption such as Pretty Good Privacy instead of the relatively
1174 weak standard encryption provided by zipfile utilities.)
1175
1176 --qq
1177 ----qquuiieett
1178 Quiet mode; eliminate informational messages and comment
1179 prompts. (Useful, for example, in shell scripts and background
1180 tasks).
1181
1182 --QQn
1183 ----QQ--ffllaagg n
1184 [QDOS] store information about the file in the file header with
1185 n defined as
1186 bit 0: Don't add headers for any file
1187 bit 1: Add headers for all files
1188 bit 2: Don't wait for interactive key press on exit
1189
1190 --rr
1191 ----rreeccuurrssee--ppaatthhss
1192 Travel the directory structure recursively; for example:
1193
1194 zip -r foo.zip foo
1195
1196 or more concisely
1197
1198 zip -r foo foo
1199
1200 In this case, all the files and directories in ffoooo are saved in
1201 a _z_i_p archive named ffoooo..zziipp, including files with names starting
1202 with "".."", since the recursion does not use the shell's file-name
1203 substitution mechanism. If you wish to include only a specific
1204 subset of the files in directory ffoooo and its subdirectories, use
1205 the --ii option to specify the pattern of files to be included.
1206 You should not use --rr with the name ""..**"", since that matches
1207 ""...."" which will attempt to zip up the parent directory (proba-
1208 bly not what was intended).
1209
1210 Multiple source directories are allowed as in
1211
1212 zip -r foo foo1 foo2
1213
1214 which first zips up ffoooo11 and then ffoooo22, going down each direc-
1215 tory.
1216
1217 Note that while wildcards to --rr are typically resolved while
1218 recursing down directories in the file system, any --RR,, --xx, and
1219 --ii wildcards are applied to internal archive pathnames once the
1220 directories are scanned. To have wildcards apply to files in
1221 subdirectories when recursing on Unix and similar systems where
1222 the shell does wildcard substitution, either escape all wild-
1223 cards or put all arguments with wildcards in quotes. This lets
1224 _z_i_p see the wildcards and match files in subdirectories using
1225 them as it recurses.
1226
1227 --RR
1228 ----rreeccuurrssee--ppaatttteerrnnss
1229 Travel the directory structure recursively starting at the cur-
1230 rent directory; for example:
1231
1232 zip -R foo "*.c"
1233
1234 In this case, all the files matching **..cc in the tree starting at
1235 the current directory are stored into a _z_i_p archive named
1236 ffoooo..zziipp. Note that **..cc will match ffiillee..cc, aa//ffiillee..cc and aa//bb//..cc.
1237 More than one pattern can be listed as separate arguments. Note
1238 for PKZIP users: the equivalent command is
1239
1240 pkzip -rP foo *.c
1241
1242 Patterns are relative file paths as they appear in the archive,
1243 or will after zipping, and can have optional wildcards in them.
1244 For example, given the current directory is ffoooo and under it are
1245 directories ffoooo11 and ffoooo22 and in ffoooo11 is the file bbaarr..cc,
1246
1247 zip -R foo/*
1248
1249 will zip up ffoooo, ffoooo//ffoooo11, ffoooo//ffoooo11//bbaarr..cc, and ffoooo//ffoooo22.
1250
1251 zip -R */bar.c
1252
1253 will zip up ffoooo//ffoooo11//bbaarr..cc. See the note for --rr on escaping
1254 wildcards.
1255
1256
1257 --RREE
1258 ----rreeggeexx
1259 [WIN32] Before _z_i_p _3_._0, regular expression list matching was
1260 enabled by default on Windows platforms. Because of confusion
1261 resulting from the need to escape "[" and "]" in names, it is
1262 now off by default for Windows so "[" and "]" are just normal
1263 characters in names. This option enables [] matching again.
1264
1265
1266 --ss splitsize
1267 ----sspplliitt--ssiizzee splitsize
1268 Enable creating a split archive and set the split size. A split
1269 archive is an archive that could be split over many files. As
1270 the archive is created, if the size of the archive reaches the
1271 specified split size, that split is closed and the next split
1272 opened. In general all splits but the last will be the split
1273 size and the last will be whatever is left. If the entire ar-
1274 chive is smaller than the split size a single-file archive is
1275 created.
1276
1277 Split archives are stored in numbered files. For example, if
1278 the output archive is named aarrcchhiivvee and three splits are
1279 required, the resulting archive will be in the three files aarr--
1280 cchhiivvee..zz0011, aarrcchhiivvee..zz0022, and aarrcchhiivvee..zziipp. Do not change the num-
1281 bering of these files or the archive will not be readable as
1282 these are used to determine the order the splits are read.
1283
1284 Split size is a number optionally followed by a multiplier.
1285 Currently the number must be an integer. The multiplier can
1286 currently be one of kk (kilobytes), mm (megabytes), gg (gigabytes),
1287 or tt (terabytes). As 64k is the minimum split size, numbers
1288 without multipliers default to megabytes. For example, to cre-
1289 ate a split archive called ffoooo with the contents of the bbaarr
1290 directory with splits of 670 MB that might be useful for burning
1291 on CDs, the command:
1292
1293 zip -s 670m -r foo bar
1294
1295 could be used.
1296
1297 Currently the old splits of a split archive are not excluded
1298 from a new archive, but they can be specifically excluded. If
1299 possible, keep the input and output archives out of the path
1300 being zipped when creating split archives.
1301
1302 Using --ss without --sspp as above creates all the splits where ffoooo
1303 is being written, in this case the current directory. This
1304 split mode updates the splits as the archive is being created,
1305 requiring all splits to remain writable, but creates split ar-
1306 chives that are readable by any unzip that supports split ar-
1307 chives. See --sspp below for enabling split pause mode which
1308 allows splits to be written directly to removable media.
1309
1310 The option --ssvv can be used to enable verbose splitting and pro-
1311 vide details of how the splitting is being done. The --ssbb option
1312 can be used to ring the bell when _z_i_p pauses for the next split
1313 destination.
1314
1315 Split archives cannot be updated, but see the --OO (----oouutt) option
1316 for how a split archive can be updated as it is copied to a new
1317 archive. A split archive can also be converted into a single-
1318 file archive using a split size of 0 or negating the --ss option:
1319
1320 zip -s 0 split.zip --out single.zip
1321
1322 Also see --UU (----ccooppyy) for more on using copy mode.
1323
1324 --ssbb
1325 ----sspplliitt--bbeellll
1326 If splitting and using split pause mode, ring the bell when _z_i_p
1327 pauses for each split destination.
1328
1329 --sscc
1330 ----sshhooww--ccoommmmaanndd
1331 Show the command line starting _z_i_p as processed and exit. The
1332 new command parser permutes the arguments, putting all options
1333 and any values associated with them before any non-option argu-
1334 ments. This allows an option to appear anywhere in the command
1335 line as long as any values that go with the option go with it.
1336 This option displays the command line as _z_i_p sees it, including
1337 any arguments from the environment such as from the ZZIIPPOOPPTT vari-
1338 able. Where allowed, options later in the command line can
1339 override options earlier in the command line.
1340
1341 --ssff
1342 ----sshhooww--ffiilleess
1343 Show the files that would be operated on, then exit. For
1344 instance, if creating a new archive, this will list the files
1345 that would be added. If the option is negated, --ssff--, output
1346 only to an open log file. Screen display is not recommended for
1347 large lists.
1348
1349 --ssoo
1350 ----sshhooww--ooppttiioonnss
1351 Show all available options supported by _z_i_p as compiled on the
1352 current system. As this command reads the option table, it
1353 should include all options. Each line includes the short option
1354 (if defined), the long option (if defined), the format of any
1355 value that goes with the option, if the option can be negated,
1356 and a small description. The value format can be no value,
1357 required value, optional value, single character value, number
1358 value, or a list of values. The output of this option is not
1359 intended to show how to use any option but only show what
1360 options are available.
1361
1362 --sspp
1363 ----sspplliitt--ppaauussee
1364 If splitting is enabled with --ss, enable split pause mode. This
1365 creates split archives as --ss does, but stream writing is used so
1366 each split can be closed as soon as it is written and _z_i_p will
1367 pause between each split to allow changing split destination or
1368 media.
1369
1370 Though this split mode allows writing splits directly to remov-
1371 able media, it uses stream archive format that may not be read-
1372 able by some unzips. Before relying on splits created with --sspp,
1373 test a split archive with the unzip you will be using.
1374
1375 To convert a stream split archive (created with --sspp) to a stan-
1376 dard archive see the ----oouutt option.
1377
1378 --ssuu
1379 ----sshhooww--uunniiccooddee
1380 As --ssff, but also show Unicode version of the path if exists.
1381
1382 --ssUU
1383 ----sshhooww--jjuusstt--uunniiccooddee
1384 As --ssff, but only show Unicode version of the path if exists,
1385 otherwise show the standard version of the path.
1386
1387 --ssvv
1388 ----sspplliitt--vveerrbboossee
1389 Enable various verbose messages while splitting, showing how the
1390 splitting is being done.
1391
1392 --SS
1393 ----ssyysstteemm--hhiiddddeenn
1394 [MSDOS, OS/2, WIN32 and ATARI] Include system and hidden files.
1395 [MacOS] Includes finder invisible files, which are ignored oth-
1396 erwise.
1397
1398 --tt mmddyyyy
1399 ----ffrroomm--ddaattee mmddyyyy
1400 Do not operate on files modified prior to the specified date,
1401 where mmmm is the month (00-12), dddd is the day of the month
1402 (01-31), and yyyyyyyy is the year. The _I_S_O _8_6_0_1 date format
1403 yyyyyyyy--mmmm--dddd is also accepted. For example:
1404
1405 zip -rt 12071991 infamy foo
1406
1407 zip -rt 1991-12-07 infamy foo
1408
1409 will add all the files in ffoooo and its subdirectories that were
1410 last modified on or after 7 December 1991, to the _z_i_p archive
1411 iinnffaammyy..zziipp.
1412
1413 --tttt mmddyyyy
1414 ----bbeeffoorree--ddaattee mmddyyyy
1415 Do not operate on files modified after or at the specified date,
1416 where mmmm is the month (00-12), dddd is the day of the month
1417 (01-31), and yyyyyyyy is the year. The _I_S_O _8_6_0_1 date format
1418 yyyyyyyy--mmmm--dddd is also accepted. For example:
1419
1420 zip -rtt 11301995 infamy foo
1421
1422 zip -rtt 1995-11-30 infamy foo
1423
1424 will add all the files in ffoooo and its subdirectories that were
1425 last modified before 30 November 1995, to the _z_i_p archive
1426 iinnffaammyy..zziipp.
1427
1428 --TT
1429 ----tteesstt
1430 Test the integrity of the new zip file. If the check fails, the
1431 old zip file is unchanged and (with the --mm option) no input
1432 files are removed.
1433
1434 --TTTT cmd
1435 ----uunnzziipp--ccoommmmaanndd cmd
1436 Use command cmd instead of 'unzip -tqq' to test an archive when
1437 the --TT option is used. On Unix, to use a copy of unzip in the
1438 current directory instead of the standard system unzip, could
1439 use:
1440
1441 zip archive file1 file2 -T -TT "./unzip -tqq"
1442
1443 In cmd, {} is replaced by the name of the temporary archive,
1444 otherwise the name of the archive is appended to the end of the
1445 command. The return code is checked for success (0 on Unix).
1446
1447 --uu
1448 ----uuppddaattee
1449 Replace (update) an existing entry in the _z_i_p archive only if it
1450 has been modified more recently than the version already in the
1451 _z_i_p archive. For example:
1452
1453 zip -u stuff *
1454
1455 will add any new files in the current directory, and update any
1456 files which have been modified since the _z_i_p archive _s_t_u_f_f_._z_i_p
1457 was last created/modified (note that _z_i_p will not try to pack
1458 _s_t_u_f_f_._z_i_p into itself when you do this).
1459
1460 Note that the --uu option with no input file arguments acts like
1461 the --ff (freshen) option.
1462
1463 --UU
1464 ----ccooppyy--eennttrriieess
1465 Copy entries from one archive to another. Requires the ----oouutt
1466 option to specify a different output file than the input ar-
1467 chive. Copy mode is the reverse of --dd delete. When delete is
1468 being used with ----oouutt, the selected entries are deleted from the
1469 archive and all other entries are copied to the new archive,
1470 while copy mode selects the files to include in the new archive.
1471 Unlike --uu update, input patterns on the command line are matched
1472 against archive entries only and not the file system files. For
1473 instance,
1474
1475 zip inarchive "*.c" --copy --out outarchive
1476
1477 copies entries with names ending in ..cc from iinnaarrcchhiivvee to oouutt--
1478 aarrcchhiivvee. The wildcard must be escaped on some systems to pre-
1479 vent the shell from substituting names of files from the file
1480 system which may have no relevance to the entries in the ar-
1481 chive.
1482
1483 If no input files appear on the command line and ----oouutt is used,
1484 copy mode is assumed:
1485
1486 zip inarchive --out outarchive
1487
1488 This is useful for changing split size for instance. Encrypting
1489 and decrypting entries is not yet supported using copy mode.
1490 Use _z_i_p_c_l_o_a_k for that.
1491
1492 --UUNN v
1493 ----uunniiccooddee v
1494 Determine what _z_i_p should do with Unicode file names. _z_i_p _3_._0,
1495 in addition to the standard file path, now includes the UTF-8
1496 translation of the path if the entry path is not entirely 7-bit
1497 ASCII. When an entry is missing the Unicode path, _z_i_p reverts
1498 back to the standard file path. The problem with using the
1499 standard path is this path is in the local character set of the
1500 zip that created the entry, which may contain characters that
1501 are not valid in the character set being used by the unzip.
1502 When _z_i_p is reading an archive, if an entry also has a Unicode
1503 path, _z_i_p now defaults to using the Unicode path to recreate the
1504 standard path using the current local character set.
1505
1506 This option can be used to determine what _z_i_p should do with
1507 this path if there is a mismatch between the stored standard
1508 path and the stored UTF-8 path (which can happen if the standard
1509 path was updated). In all cases, if there is a mismatch it is
1510 assumed that the standard path is more current and _z_i_p uses
1511 that. Values for vv are
1512
1513 q - quit if paths do not match
1514
1515 w - warn, continue with standard path
1516
1517 i - ignore, continue with standard path
1518
1519 n - no Unicode, do not use Unicode paths
1520
1521 The default is to warn and continue.
1522
1523 Characters that are not valid in the current character set are
1524 escaped as ##UUxxxxxxxx and ##LLxxxxxxxxxxxx, where x is an ASCII character
1525 for a hex digit. The first is used if a 16-bit character number
1526 is sufficient to represent the Unicode character and the second
1527 if the character needs more than 16 bits to represent it's Uni-
1528 code character code. Setting --UUNN to
1529
1530 e - escape
1531
1532 as in
1533
1534 zip archive -sU -UN=e
1535
1536 forces _z_i_p to escape all characters that are not printable 7-bit
1537 ASCII.
1538
1539 Normally _z_i_p stores UTF-8 directly in the standard path field on
1540 systems where UTF-8 is the current character set and stores the
1541 UTF-8 in the new extra fields otherwise. The option
1542
1543 u - UTF-8
1544
1545 as in
1546
1547 zip archive dir -r -UN=UTF8
1548
1549 forces _z_i_p to store UTF-8 as native in the archive. Note that
1550 storing UTF-8 directly is the default on Unix systems that sup-
1551 port it. This option could be useful on Windows systems where
1552 the escaped path is too large to be a valid path and the UTF-8
1553 version of the path is smaller, but native UTF-8 is not backward
1554 compatible on Windows systems.
1555
1556
1557 --vv
1558 ----vveerrbboossee
1559 Verbose mode or print diagnostic version info.
1560
1561 Normally, when applied to real operations, this option enables
1562 the display of a progress indicator during compression (see --dddd
1563 for more on dots) and requests verbose diagnostic info about
1564 zipfile structure oddities.
1565
1566 However, when --vv is the only command line argument a diagnostic
1567 screen is printed instead. This should now work even if stdout
1568 is redirected to a file, allowing easy saving of the information
1569 for sending with bug reports to Info-ZIP. The version screen
1570 provides the help screen header with program name, version, and
1571 release date, some pointers to the Info-ZIP home and distribu-
1572 tion sites, and shows information about the target environment
1573 (compiler type and version, OS version, compilation date and the
1574 enabled optional features used to create the _z_i_p executable).
1575
1576 --VV
1577 ----VVMMSS--ppoorrttaabbllee
1578 [VMS] Save VMS file attributes. (Files are truncated at EOF.)
1579 When a -V archive is unpacked on a non-VMS system, some file
1580 types (notably Stream_LF text files and pure binary files
1581 like fixed-512) should be extracted intact. Indexed files and
1582 file types with embedded record sizes (notably variable-length
1583 record types) will probably be seen as corrupt elsewhere.
1584
1585 --VVVV
1586 ----VVMMSS--ssppeecciiffiicc
1587 [VMS] Save VMS file attributes, and all allocated blocks in a
1588 file, including any data beyond EOF. Useful for moving ill-
1589 formed files among VMS systems. When a -VV archive is
1590 unpacked on a non-VMS system, almost all files will appear cor-
1591 rupt.
1592
1593 --ww
1594 ----VVMMSS--vveerrssiioonnss
1595 [VMS] Append the version number of the files to the name,
1596 including multiple versions of files. Default is to use only
1597 the most recent version of a specified file.
1598
1599 --wwww
1600 ----VVMMSS--ddoott--vveerrssiioonnss
1601 [VMS] Append the version number of the files to the name,
1602 including multiple versions of files, using the .nnn format.
1603 Default is to use only the most recent version of a specified
1604 file.
1605
1606 --wwss
1607 ----wwiilldd--ssttoopp--ddiirrss
1608 Wildcards match only at a directory level. Normally _z_i_p handles
1609 paths as strings and given the paths
1610
1611 /foo/bar/dir/file1.c
1612
1613 /foo/bar/file2.c
1614
1615 an input pattern such as
1616
1617 /foo/bar/*
1618
1619 normally would match both paths, the * matching ddiirr//ffiillee11..cc and
1620 ffiillee22..cc. Note that in the first case a directory boundary (/)
1621 was crossed in the match. With --wwss no directory bounds will be
1622 included in the match, making wildcards local to a specific
1623 directory level. So, with --wwss enabled, only the second path
1624 would be matched.
1625
1626 When using --wwss, use ** to match across directory boundaries as *
1627 does normally.
1628
1629 --xx files
1630 ----eexxcclluuddee files
1631 Explicitly exclude the specified files, as in:
1632
1633 zip -r foo foo -x \*.o
1634
1635 which will include the contents of ffoooo in ffoooo..zziipp while exclud-
1636 ing all the files that end in ..oo. The backslash avoids the
1637 shell filename substitution, so that the name matching is per-
1638 formed by _z_i_p at all directory levels.
1639
1640 Also possible:
1641
1642 zip -r foo foo -x@exclude.lst
1643
1644 which will include the contents of ffoooo in ffoooo..zziipp while exclud-
1645 ing all the files that match the patterns in the file
1646 eexxcclluuddee..llsstt.
1647
1648 The long option forms of the above are
1649
1650 zip -r foo foo --exclude \*.o
1651
1652 and
1653
1654 zip -r foo foo --exclude @exclude.lst
1655
1656 Multiple patterns can be specified, as in:
1657
1658 zip -r foo foo -x \*.o \*.c
1659
1660 If there is no space between --xx and the pattern, just one value
1661 is assumed (no list):
1662
1663 zip -r foo foo -x\*.o
1664
1665
1666 See --ii for more on include and exclude.
1667
1668 --XX
1669 ----nnoo--eexxttrraa
1670 Do not save extra file attributes (Extended Attributes on OS/2,
1671 uid/gid and file times on Unix). The zip format uses extra
1672 fields to include additional information for each entry. Some
1673 extra fields are specific to particular systems while others are
1674 applicable to all systems. Normally when _z_i_p reads entries from
1675 an existing archive, it reads the extra fields it knows, strips
1676 the rest, and adds the extra fields applicable to that system.
1677 With --XX, _z_i_p strips all old fields and only includes the Unicode
1678 and Zip64 extra fields (currently these two extra fields cannot
1679 be disabled).
1680
1681 Negating this option, --XX--, includes all the default extra
1682 fields, but also copies over any unrecognized extra fields.
1683
1684 --yy
1685 ----ssyymmlliinnkkss
1686 For UNIX and VMS (V8.3 and later), store symbolic links as such
1687 in the _z_i_p archive, instead of compressing and storing the file
1688 referred to by the link. This can avoid multiple copies of
1689 files being included in the archive as _z_i_p recurses the direc-
1690 tory trees and accesses files directly and by links.
1691
1692 --zz
1693 ----aarrcchhiivvee--ccoommmmeenntt
1694 Prompt for a multi-line comment for the entire _z_i_p archive. The
1695 comment is ended by a line containing just a period, or an end
1696 of file condition (^D on Unix, ^Z on MSDOS, OS/2, and VMS). The
1697 comment can be taken from a file:
1698
1699 zip -z foo < foowhat
1700
1701 --ZZ cm
1702 ----ccoommpprreessssiioonn--mmeetthhoodd cm
1703 Set the default compression method. Currently the main methods
1704 supported by _z_i_p are ssttoorree and ddeeffllaattee. Compression method can
1705 be set to:
1706
1707 ssttoorree - Setting the compression method to ssttoorree forces _z_i_p to
1708 store entries with no compression. This is generally faster
1709 than compressing entries, but results in no space savings. This
1710 is the same as using --00 (compression level zero).
1711
1712 ddeeffllaattee - This is the default method for _z_i_p. If _z_i_p determines
1713 that storing is better than deflation, the entry will be stored
1714 instead.
1715
1716 bbzziipp22 - If bbzziipp22 support is compiled in, this compression method
1717 also becomes available. Only some modern unzips currently sup-
1718 port the bbzziipp22 compression method, so test the unzip you will be
1719 using before relying on archives using this method (compression
1720 method 12).
1721
1722 For example, to add bbaarr..cc to archive ffoooo using bbzziipp22 compres-
1723 sion:
1724
1725 zip -Z bzip2 foo bar.c
1726
1727 The compression method can be abbreviated:
1728
1729 zip -Zb foo bar.c
1730
1731
1732 --##
1733 ((--00,, --11,, --22,, --33,, --44,, --55,, --66,, --77,, --88,, --99))
1734 Regulate the speed of compression using the specified digit ##,
1735 where --00 indicates no compression (store all files), --11 indi-
1736 cates the fastest compression speed (less compression) and --99
1737 indicates the slowest compression speed (optimal compression,
1738 ignores the suffix list). The default compression level is --66..
1739
1740 Though still being worked, the intention is this setting will
1741 control compression speed for all compression methods. Cur-
1742 rently only deflation is controlled.
1743
1744 --!!
1745 ----uussee--pprriivviilleeggeess
1746 [WIN32] Use priviliges (if granted) to obtain all aspects of
1747 WinNT security.
1748
1749 --@@
1750 ----nnaammeess--ssttddiinn
1751 Take the list of input files from standard input. Only one file-
1752 name per line.
1753
1754 --$$
1755 ----vvoolluummee--llaabbeell
1756 [MSDOS, OS/2, WIN32] Include the volume label for the drive
1757 holding the first file to be compressed. If you want to include
1758 only the volume label or to force a specific drive, use the
1759 drive name as first file name, as in:
1760
1761 zip -$ foo a: c:bar
1762
1763
1764EEXXAAMMPPLLEESS
1765 The simplest example:
1766
1767 zip stuff *
1768
1769 creates the archive _s_t_u_f_f_._z_i_p (assuming it does not exist) and puts all
1770 the files in the current directory in it, in compressed form (the ..zziipp
1771 suffix is added automatically, unless the archive name contains a dot
1772 already; this allows the explicit specification of other suffixes).
1773
1774 Because of the way the shell on Unix does filename substitution, files
1775 starting with "." are not included; to include these as well:
1776
1777 zip stuff .* *
1778
1779 Even this will not include any subdirectories from the current direc-
1780 tory.
1781
1782 To zip up an entire directory, the command:
1783
1784 zip -r foo foo
1785
1786 creates the archive _f_o_o_._z_i_p, containing all the files and directories
1787 in the directory _f_o_o that is contained within the current directory.
1788
1789 You may want to make a _z_i_p archive that contains the files in _f_o_o,
1790 without recording the directory name, _f_o_o. You can use the --jj option
1791 to leave off the paths, as in:
1792
1793 zip -j foo foo/*
1794
1795 If you are short on disk space, you might not have enough room to hold
1796 both the original directory and the corresponding compressed _z_i_p ar-
1797 chive. In this case, you can create the archive in steps using the --mm
1798 option. If _f_o_o contains the subdirectories _t_o_m, _d_i_c_k, and _h_a_r_r_y, you
1799 can:
1800
1801 zip -rm foo foo/tom
1802 zip -rm foo foo/dick
1803 zip -rm foo foo/harry
1804
1805 where the first command creates _f_o_o_._z_i_p, and the next two add to it.
1806 At the completion of each _z_i_p command, the last created archive is
1807 deleted, making room for the next _z_i_p command to function.
1808
1809
1810
1811
1812 Use --ss to set the split size and create a split archive. The size is
1813 given as a number followed optionally by one of k (kB), m (MB), g (GB),
1814 or t (TB). The command
1815
1816 zip -s 2g -r split.zip foo
1817
1818 creates a split archive of the directory foo with splits no bigger than
1819 2 GB each. If foo contained 5 GB of contents and the contents were
1820 stored in the split archive without compression (to make this example
1821 simple), this would create three splits, split.z01 at 2 GB, split.z02
1822 at 2 GB, and split.zip at a little over 1 GB.
1823
1824 The --sspp option can be used to pause _z_i_p between splits to allow chang-
1825 ing removable media, for example, but read the descriptions and warn-
1826 ings for both --ss and --sspp below.
1827
1828 Though _z_i_p does not update split archives, _z_i_p provides the new option
1829 --OO (----oouuttppuutt--ffiillee) to allow split archives to be updated and saved in a
1830 new archive. For example,
1831
1832 zip inarchive.zip foo.c bar.c --out outarchive.zip
1833
1834 reads archive iinnaarrcchhiivvee..zziipp, even if split, adds the files ffoooo..cc and
1835 bbaarr..cc, and writes the resulting archive to oouuttaarrcchhiivvee..zziipp. If iinnaarr--
1836 cchhiivvee..zziipp is split then oouuttaarrcchhiivvee..zziipp defaults to the same split size.
1837 Be aware that oouuttaarrcchhiivvee..zziipp and any split files that are created with
1838 it are always overwritten without warning. This may be changed in the
1839 future.
1840
1841
1842
1843
1844
1845PPAATTTTEERRNN MMAATTCCHHIINNGG
1846 This section applies only to Unix. Watch this space for details on
1847 MSDOS and VMS operation. However, the special wildcard characters **
1848 and [[]] below apply to at least MSDOS also.
1849
1850 The Unix shells (_s_h, _c_s_h, _b_a_s_h, and others) normally do filename sub-
1851 stitution (also called "globbing") on command arguments. Generally the
1852 special characters are:
1853
1854 ?? match any single character
1855
1856 ** match any number of characters (including none)
1857
1858 [[]] match any character in the range indicated within the brackets
1859 (example: [a-f], [0-9]). This form of wildcard matching allows
1860 a user to specify a list of characters between square brackets
1861 and if any of the characters match the expression matches. For
1862 example:
1863
1864 zip archive "*.[hc]"
1865
1866 would archive all files in the current directory that end in ..hh
1867 or ..cc.
1868
1869 Ranges of characters are supported:
1870
1871 zip archive "[a-f]*"
1872
1873 would add to the archive all files starting with "a" through
1874 "f".
1875
1876 Negation is also supported, where any character in that position
1877 not in the list matches. Negation is supported by adding !! or ^^
1878 to the beginning of the list:
1879
1880 zip archive "*.[!o]"
1881
1882 matches files that don't end in ".o".
1883
1884 On WIN32, [] matching needs to be turned on with the -RE option
1885 to avoid the confusion that names with [ or ] have caused.
1886
1887
1888 When these characters are encountered (without being escaped with a
1889 backslash or quotes), the shell will look for files relative to the
1890 current path that match the pattern, and replace the argument with a
1891 list of the names that matched.
1892
1893 The _z_i_p program can do the same matching on names that are in the _z_i_p
1894 archive being modified or, in the case of the --xx (exclude) or --ii
1895 (include) options, on the list of files to be operated on, by using
1896 backslashes or quotes to tell the shell not to do the name expansion.
1897 In general, when _z_i_p encounters a name in the list of files to do, it
1898 first looks for the name in the file system. If it finds it, it then
1899 adds it to the list of files to do. If it does not find it, it looks
1900 for the name in the _z_i_p archive being modified (if it exists), using
1901 the pattern matching characters described above, if present. For each
1902 match, it will add that name to the list of files to be processed,
1903 unless this name matches one given with the --xx option, or does not
1904 match any name given with the --ii option.
1905
1906 The pattern matching includes the path, and so patterns like \*.o match
1907 names that end in ".o", no matter what the path prefix is. Note that
1908 the backslash must precede every special character (i.e. ?*[]), or the
1909 entire argument must be enclosed in double quotes ("").
1910
1911 In general, use backslashes or double quotes for paths that have wild-
1912 cards to make _z_i_p do the pattern matching for file paths, and always
1913 for paths and strings that have spaces or wildcards for --ii, --xx, --RR, --dd,
1914 and --UU and anywhere _z_i_p needs to process the wildcards.
1915
1916EENNVVIIRROONNMMEENNTT
1917 The following environment variables are read and used by _z_i_p as
1918 described.
1919
1920 ZZIIPPOOPPTT
1921 contains default options that will be used when running _z_i_p.
1922 The contents of this environment variable will get added to the
1923 command line just after the zziipp command.
1924
1925 ZZIIPP
1926 [Not on RISC OS and VMS] see ZIPOPT
1927
1928 ZZiipp$$OOppttiioonnss
1929 [RISC OS] see ZIPOPT
1930
1931 ZZiipp$$EExxttss
1932 [RISC OS] contains extensions separated by a : that will cause
1933 native filenames with one of the specified extensions to be
1934 added to the zip file with basename and extension swapped.
1935
1936 ZZIIPP__OOPPTTSS
1937 [VMS] see ZIPOPT
1938
1939SSEEEE AALLSSOO
1940 compress(1), shar(1L), tar(1), unzip(1L), gzip(1L)
1941
1942DDIIAAGGNNOOSSTTIICCSS
1943 The exit status (or error level) approximates the exit codes defined by
1944 PKWARE and takes on the following values, except under VMS:
1945
1946 0 normal; no errors or warnings detected.
1947
1948 2 unexpected end of zip file.
1949
1950 3 a generic error in the zipfile format was detected. Pro-
1951 cessing may have completed successfully anyway; some bro-
1952 ken zipfiles created by other archivers have simple work-
1953 arounds.
1954
1955 4 _z_i_p was unable to allocate memory for one or more buffers
1956 during program initialization.
1957
1958 5 a severe error in the zipfile format was detected. Pro-
1959 cessing probably failed immediately.
1960
1961 6 entry too large to be processed (such as input files
1962 larger than 2 GB when not using Zip64 or trying to read
1963 an existing archive that is too large) or entry too large
1964 to be split with _z_i_p_s_p_l_i_t
1965
1966 7 invalid comment format
1967
1968 8 _z_i_p -T failed or out of memory
1969
1970 9 the user aborted _z_i_p prematurely with control-C (or simi-
1971 lar)
1972
1973 10 _z_i_p encountered an error while using a temp file
1974
1975 11 read or seek error
1976
1977 12 _z_i_p has nothing to do
1978
1979 13 missing or empty zip file
1980
1981 14 error writing to a file
1982
1983 15 _z_i_p was unable to create a file to write to
1984
1985 16 bad command line parameters
1986
1987 18 _z_i_p could not open a specified file to read
1988
1989 19 _z_i_p was compiled with options not supported on this sys-
1990 tem
1991
1992 VMS interprets standard Unix (or PC) return values as other, scarier-
1993 looking things, so _z_i_p instead maps them into VMS-style status codes.
1994 In general, _z_i_p sets VMS Facility = 1955 (0x07A3), Code = 2* Unix_sta-
1995 tus, and an appropriate Severity (as specified in ziperr.h). More
1996 details are included in the VMS-specific documentation. See
1997 [.vms]NOTES.TXT and [.vms]vms_msg_gen.c.
1998
1999BBUUGGSS
2000 _z_i_p 3.0 is not compatible with PKUNZIP 1.10. Use _z_i_p 1.1 to produce _z_i_p
2001 files which can be extracted by PKUNZIP 1.10.
2002
2003 _z_i_p files produced by _z_i_p 3.0 must not be _u_p_d_a_t_e_d by _z_i_p 1.1 or PKZIP
2004 1.10, if they contain encrypted members or if they have been produced
2005 in a pipe or on a non-seekable device. The old versions of _z_i_p or PKZIP
2006 would create an archive with an incorrect format. The old versions can
2007 list the contents of the zip file but cannot extract it anyway (because
2008 of the new compression algorithm). If you do not use encryption and
2009 use regular disk files, you do not have to care about this problem.
2010
2011 Under VMS, not all of the odd file formats are treated properly. Only
2012 stream-LF format _z_i_p files are expected to work with _z_i_p. Others can
2013 be converted using Rahul Dhesi's BILF program. This version of _z_i_p
2014 handles some of the conversion internally. When using Kermit to trans-
2015 fer zip files from VMS to MSDOS, type "set file type block" on VMS.
2016 When transfering from MSDOS to VMS, type "set file type fixed" on VMS.
2017 In both cases, type "set file type binary" on MSDOS.
2018
2019 Under some older VMS versions, _z_i_p may hang for file specifications
2020 that use DECnet syntax _f_o_o_:_:_*_._*_.
2021
2022 On OS/2, zip cannot match some names, such as those including an excla-
2023 mation mark or a hash sign. This is a bug in OS/2 itself: the 32-bit
2024 DosFindFirst/Next don't find such names. Other programs such as GNU
2025 tar are also affected by this bug.
2026
2027 Under OS/2, the amount of Extended Attributes displayed by DIR is (for
2028 compatibility) the amount returned by the 16-bit version of DosQuery-
2029 PathInfo(). Otherwise OS/2 1.3 and 2.0 would report different EA sizes
2030 when DIRing a file. However, the structure layout returned by the
2031 32-bit DosQueryPathInfo() is a bit different, it uses extra padding
2032 bytes and link pointers (it's a linked list) to have all fields on
2033 4-byte boundaries for portability to future RISC OS/2 versions. There-
2034 fore the value reported by _z_i_p (which uses this 32-bit-mode size) dif-
2035 fers from that reported by DIR. _z_i_p stores the 32-bit format for
2036 portability, even the 16-bit MS-C-compiled version running on OS/2 1.3,
2037 so even this one shows the 32-bit-mode size.
2038
2039AAUUTTHHOORRSS
2040 Copyright (C) 1997-2008 Info-ZIP.
2041
2042 Currently distributed under the Info-ZIP license.
2043
2044 Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,
2045 Onno van der Linden, Kai Uwe Rommel, Igor Mandrichenko, John Bush and
2046 Paul Kienitz.
2047
2048 Original copyright:
2049
2050 Permission is granted to any individual or institution to use, copy, or
2051 redistribute this software so long as all of the original files are
2052 included, that it is not sold for profit, and that this copyright
2053 notice is retained.
2054
2055 LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES ARE
2056 PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED
2057 OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
2058 DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE.
2059
2060 Please send bug reports and comments using the web page at: _w_w_w_._i_n_f_o_-
2061 _z_i_p_._o_r_g. For bug reports, please include the version of _z_i_p (see
2062 _z_i_p _-_h), the make options used to compile it (see _z_i_p _-_v), the machine
2063 and operating system in use, and as much additional information as pos-
2064 sible.
2065
2066AACCKKNNOOWWLLEEDDGGEEMMEENNTTSS
2067 Thanks to R. P. Byrne for his _S_h_r_i_n_k_._P_a_s program, which inspired this
2068 project, and from which the shrink algorithm was stolen; to Phil Katz
2069 for placing in the public domain the _z_i_p file format, compression for-
2070 mat, and .ZIP filename extension, and for accepting minor changes to
2071 the file format; to Steve Burg for clarifications on the deflate for-
2072 mat; to Haruhiko Okumura and Leonid Broukhis for providing some useful
2073 ideas for the compression algorithm; to Keith Petersen, Rich Wales,
2074 Hunter Goatley and Mark Adler for providing a mailing list and _f_t_p site
2075 for the Info-ZIP group to use; and most importantly, to the Info-ZIP
2076 group itself (listed in the file _i_n_f_o_z_i_p_._w_h_o) without whose tireless
2077 testing and bug-fixing efforts a portable _z_i_p would not have been pos-
2078 sible. Finally we should thank (blame) the first Info-ZIP moderator,
2079 David Kirschbaum, for getting us into this mess in the first place.
2080 The manual page was rewritten for Unix by R. P. C. Rodgers and updated
2081 by E. Gordon for _z_i_p 3.0.
2082
2083
2084
2085Info-ZIP 16 June 2008 (v3.0) ZIP(1L)