~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to zip/zip/MANUAL

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

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