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