zip.txt 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027
  1. ZIP(1L) ZIP(1L)
  2. NAME
  3. zip - package and compress (archive) files
  4. SYNOPSIS
  5. zip [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [--longoption ...] [-b path]
  6. [-n suffixes] [-t date] [-tt date] [zipfile [file ...]] [-xi list]
  7. zipcloak (see separate man page)
  8. zipnote (see separate man page)
  9. zipsplit (see separate man page)
  10. Note: Command line processing in zip has been changed to support long
  11. options and handle all options and arguments more consistently. Some
  12. old command lines that depend on command line inconsistencies may no
  13. longer work.
  14. DESCRIPTION
  15. zip is a compression and file packaging utility for Unix, VMS, MSDOS,
  16. OS/2, Windows 9x/NT/XP, Minix, Atari, Macintosh, Amiga, and Acorn RISC
  17. OS. It is analogous to a combination of the Unix commands tar(1) and
  18. compress(1) and is compatible with PKZIP (Phil Katz's ZIP for MSDOS
  19. systems).
  20. A companion program (unzip(1L)) unpacks zip archives. The zip and
  21. unzip(1L) programs can work with archives produced by PKZIP (supporting
  22. most PKZIP features up to PKZIP version 4.6), and PKZIP and PKUNZIP can
  23. work with archives produced by zip (with some exceptions, notably
  24. streamed archives, but recent changes in the zip file standard may
  25. facilitate better compatibility). zip version 3.0 is compatible with
  26. PKZIP 2.04 and also supports the Zip64 extensions of PKZIP 4.5 which
  27. allow archives as well as files to exceed the previous 2 GB limit (4 GB
  28. in some cases). zip also now supports bzip2 compression if the bzip2
  29. library is included when zip is compiled. Note that PKUNZIP 1.10 can-
  30. not extract files produced by PKZIP 2.04 or zip 3.0. You must use PKUN-
  31. ZIP 2.04g or unzip 5.0p1 (or later versions) to extract them.
  32. See the EXAMPLES section at the bottom of this page for examples of
  33. some typical uses of zip.
  34. Large Archives and Zip64. zip automatically uses the Zip64 extensions
  35. when files larger than 4 GB are added to an archive, an archive con-
  36. taining Zip64 entries is updated (if the resulting archive still needs
  37. Zip64), the size of the archive will exceed 4 GB, or when the number of
  38. entries in the archive will exceed about 64K. Zip64 is also used for
  39. archives streamed from standard input as the size of such archives are
  40. not known in advance, but the option -fz- can be used to force zip to
  41. create PKZIP 2 compatible archives (as long as Zip64 extensions are not
  42. needed). You must use a PKZIP 4.5 compatible unzip, such as unzip 6.0
  43. or later, to extract files using the Zip64 extensions.
  44. In addition, streamed archives, entries encrypted with standard encryp-
  45. tion, or split archives created with the pause option may not be com-
  46. patible with PKZIP as data descriptors are used and PKZIP at the time
  47. of this writing does not support data descriptors (but recent changes
  48. in the PKWare published zip standard now include some support for the
  49. data descriptor format zip uses).
  50. Mac OS X. Though previous Mac versions had their own zip port, zip
  51. supports Mac OS X as part of the Unix port and most Unix features
  52. apply. References to "MacOS" below generally refer to MacOS versions
  53. older than OS X. Support for some Mac OS features in the Unix Mac OS X
  54. port, such as resource forks, is expected in the next zip release.
  55. For a brief help on zip and unzip, run each without specifying any
  56. parameters on the command line.
  57. USE
  58. The program is useful for packaging a set of files for distribution;
  59. for archiving files; and for saving disk space by temporarily compress-
  60. ing unused files or directories.
  61. The zip program puts one or more compressed files into a single zip
  62. archive, along with information about the files (name, path, date, time
  63. of last modification, protection, and check information to verify file
  64. integrity). An entire directory structure can be packed into a zip
  65. archive with a single command. Compression ratios of 2:1 to 3:1 are
  66. common for text files. zip has one compression method (deflation) and
  67. can also store files without compression. (If bzip2 support is added,
  68. zip can also compress using bzip2 compression, but such entries require
  69. a reasonably modern unzip to decompress. When bzip2 compression is
  70. selected, it replaces deflation as the default method.) zip automati-
  71. cally chooses the better of the two (deflation or store or, if bzip2 is
  72. selected, bzip2 or store) for each file to be compressed.
  73. Command format. The basic command format is
  74. zip options archive inpath inpath ...
  75. where archive is a new or existing zip archive and inpath is a direc-
  76. tory or file path optionally including wildcards. When given the name
  77. of an existing zip archive, zip will replace identically named entries
  78. in the zip archive (matching the relative names as stored in the
  79. archive) or add entries for new names. For example, if foo.zip exists
  80. and contains foo/file1 and foo/file2, and the directory foo contains
  81. the files foo/file1 and foo/file3, then:
  82. zip -r foo.zip foo
  83. or more concisely
  84. zip -r foo foo
  85. will replace foo/file1 in foo.zip and add foo/file3 to foo.zip. After
  86. this, foo.zip contains foo/file1, foo/file2, and foo/file3, with
  87. foo/file2 unchanged from before.
  88. So if before the zip command is executed foo.zip has:
  89. foo/file1 foo/file2
  90. and directory foo has:
  91. file1 file3
  92. then foo.zip will have:
  93. foo/file1 foo/file2 foo/file3
  94. where foo/file1 is replaced and foo/file3 is new.
  95. -@ file lists. If a file list is specified as -@ [Not on MacOS], zip
  96. takes the list of input files from standard input instead of from the
  97. command line. For example,
  98. zip -@ foo
  99. will store the files listed one per line on stdin in foo.zip.
  100. Under Unix, this option can be used to powerful effect in conjunction
  101. with the find (1) command. For example, to archive all the C source
  102. files in the current directory and its subdirectories:
  103. find . -name "*.[ch]" -print | zip source -@
  104. (note that the pattern must be quoted to keep the shell from expanding
  105. it).
  106. Streaming input and output. zip will also accept a single dash ("-")
  107. as the zip file name, in which case it will write the zip file to stan-
  108. dard output, allowing the output to be piped to another program. For
  109. example:
  110. zip -r - . | dd of=/dev/nrst0 obs=16k
  111. would write the zip output directly to a tape with the specified block
  112. size for the purpose of backing up the current directory.
  113. zip also accepts a single dash ("-") as the name of a file to be com-
  114. pressed, in which case it will read the file from standard input,
  115. allowing zip to take input from another program. For example:
  116. tar cf - . | zip backup -
  117. would compress the output of the tar command for the purpose of backing
  118. up the current directory. This generally produces better compression
  119. than the previous example using the -r option because zip can take
  120. advantage of redundancy between files. The backup can be restored using
  121. the command
  122. unzip -p backup | tar xf -
  123. When no zip file name is given and stdout is not a terminal, zip acts
  124. as a filter, compressing standard input to standard output. For exam-
  125. ple,
  126. tar cf - . | zip | dd of=/dev/nrst0 obs=16k
  127. is equivalent to
  128. tar cf - . | zip - - | dd of=/dev/nrst0 obs=16k
  129. zip archives created in this manner can be extracted with the program
  130. funzip which is provided in the unzip package, or by gunzip which is
  131. provided in the gzip package (but some gunzip may not support this if
  132. zip used the Zip64 extensions). For example:
  133. dd if=/dev/nrst0 ibs=16k | funzip | tar xvf -
  134. The stream can also be saved to a file and unzip used.
  135. If Zip64 support for large files and archives is enabled and zip is
  136. used as a filter, zip creates a Zip64 archive that requires a PKZIP 4.5
  137. or later compatible unzip to read it. This is to avoid amgibuities in
  138. the zip file structure as defined in the current zip standard (PKWARE
  139. AppNote) where the decision to use Zip64 needs to be made before data
  140. is written for the entry, but for a stream the size of the data is not
  141. known at that point. If the data is known to be smaller than 4 GB, the
  142. option -fz- can be used to prevent use of Zip64, but zip will exit with
  143. an error if Zip64 was in fact needed. zip 3 and unzip 6 and later can
  144. read archives with Zip64 entries. Also, zip removes the Zip64 exten-
  145. sions if not needed when archive entries are copied (see the -U
  146. (--copy) option).
  147. When directing the output to another file, note that all options should
  148. be before the redirection including -x. For example:
  149. zip archive "*.h" "*.c" -x donotinclude.h orthis.h > tofile
  150. Zip files. When changing an existing zip archive, zip will write a
  151. temporary file with the new contents, and only replace the old one when
  152. the process of creating the new version has been completed without
  153. error.
  154. If the name of the zip archive does not contain an extension, the
  155. extension .zip is added. If the name already contains an extension
  156. other than .zip, the existing extension is kept unchanged. However,
  157. split archives (archives split over multiple files) require the .zip
  158. extension on the last split.
  159. Scanning and reading files. When zip starts, it scans for files to
  160. process (if needed). If this scan takes longer than about 5 seconds,
  161. zip will display a "Scanning files" message and start displaying
  162. progress dots every 2 seconds or every so many entries processed,
  163. whichever takes longer. If there is more than 2 seconds between dots
  164. it could indicate that finding each file is taking time and could mean
  165. a slow network connection for example. (Actually the initial file scan
  166. is a two-step process where the directory scan is followed by a sort
  167. and these two steps are separated with a space in the dots. If updat-
  168. ing an existing archive, a space also appears between the existing file
  169. scan and the new file scan.) The scanning files dots are not con-
  170. trolled by the -ds dot size option, but the dots are turned off by the
  171. -q quiet option. The -sf show files option can be used to scan for
  172. files and get the list of files scanned without actually processing
  173. them.
  174. If zip is not able to read a file, it issues a warning but continues.
  175. See the -MM option below for more on how zip handles patterns that are
  176. not matched and files that are not readable. If some files were
  177. skipped, a warning is issued at the end of the zip operation noting how
  178. many files were read and how many skipped.
  179. Command modes. zip now supports two distinct types of command modes,
  180. external and internal. The external modes (add, update, and freshen)
  181. read files from the file system (as well as from an existing archive)
  182. while the internal modes (delete and copy) operate exclusively on
  183. entries in an existing archive.
  184. add
  185. Update existing entries and add new files. If the archive does
  186. not exist create it. This is the default mode.
  187. update (-u)
  188. Update existing entries if newer on the file system and add new
  189. files. If the archive does not exist issue warning then create
  190. a new archive.
  191. freshen (-f)
  192. Update existing entries of an archive if newer on the file sys-
  193. tem. Does not add new files to the archive.
  194. delete (-d)
  195. Select entries in an existing archive and delete them.
  196. copy (-U)
  197. Select entries in an existing archive and copy them to a new
  198. archive. This new mode is similar to update but command line
  199. patterns select entries in the existing archive rather than
  200. files from the file system and it uses the --out option to write
  201. the resulting archive to a new file rather than update the
  202. existing archive, leaving the original archive unchanged.
  203. The new File Sync option (-FS) is also considered a new mode, though it
  204. is similar to update. This mode synchronizes the archive with the
  205. files on the OS, only replacing files in the archive if the file time
  206. or size of the OS file is different, adding new files, and deleting
  207. entries from the archive where there is no matching file. As this mode
  208. can delete entries from the archive, consider making a backup copy of
  209. the archive.
  210. Also see -DF for creating difference archives.
  211. See each option description below for details and the EXAMPLES section
  212. below for examples.
  213. Split archives. zip version 3.0 and later can create split archives.
  214. A split archive is a standard zip archive split over multiple files.
  215. (Note that split archives are not just archives split in to pieces, as
  216. the offsets of entries are now based on the start of each split. Con-
  217. catenating the pieces together will invalidate these offsets, but unzip
  218. can usually deal with it. zip will usually refuse to process such a
  219. spliced archive unless the -FF fix option is used to fix the offsets.)
  220. One use of split archives is storing a large archive on multiple remov-
  221. able media. For a split archive with 20 split files the files are typ-
  222. ically named (replace ARCHIVE with the name of your archive)
  223. ARCHIVE.z01, ARCHIVE.z02, ..., ARCHIVE.z19, ARCHIVE.zip. Note that the
  224. last file is the .zip file. In contrast, spanned archives are the
  225. original multi-disk archive generally requiring floppy disks and using
  226. volume labels to store disk numbers. zip supports split archives but
  227. not spanned archives, though a procedure exists for converting split
  228. archives of the right size to spanned archives. The reverse is also
  229. true, where each file of a spanned archive can be copied in order to
  230. files with the above names to create a split archive.
  231. Use -s to set the split size and create a split archive. The size is
  232. given as a number followed optionally by one of k (kB), m (MB), g (GB),
  233. or t (TB) (the default is m). The -sp option can be used to pause zip
  234. between splits to allow changing removable media, for example, but read
  235. the descriptions and warnings for both -s and -sp below.
  236. Though zip does not update split archives, zip provides the new option
  237. -O (--output-file or --out) to allow split archives to be updated and
  238. saved in a new archive. For example,
  239. zip inarchive.zip foo.c bar.c --out outarchive.zip
  240. reads archive inarchive.zip, even if split, adds the files foo.c and
  241. bar.c, and writes the resulting archive to outarchive.zip. If inar-
  242. chive.zip is split then outarchive.zip defaults to the same split size.
  243. Be aware that if outarchive.zip and any split files that are created
  244. with it already exist, these are always overwritten as needed without
  245. warning. This may be changed in the future.
  246. Unicode. Though the zip standard requires storing paths in an archive
  247. using a specific character set, in practice zips have stored paths in
  248. archives in whatever the local character set is. This creates problems
  249. when an archive is created or updated on a system using one character
  250. set and then extracted on another system using a different character
  251. set. When compiled with Unicode support enabled on platforms that sup-
  252. port wide characters, zip now stores, in addition to the standard local
  253. path for backward compatibility, the UTF-8 translation of the path.
  254. This provides a common universal character set for storing paths that
  255. allows these paths to be fully extracted on other systems that support
  256. Unicode and to match as close as possible on systems that don't.
  257. On Win32 systems where paths are internally stored as Unicode but rep-
  258. resented in the local character set, it's possible that some paths will
  259. be skipped during a local character set directory scan. zip with Uni-
  260. code support now can read and store these paths. Note that Win 9x sys-
  261. tems and FAT file systems don't fully support Unicode.
  262. Be aware that console windows on Win32 and Unix, for example, sometimes
  263. don't accurately show all characters due to how each operating system
  264. switches in character sets for display. However, directory navigation
  265. tools should show the correct paths if the needed fonts are loaded.
  266. Command line format. This version of zip has updated command line pro-
  267. cessing and support for long options.
  268. Short options take the form
  269. -s[-][s[-]...][value][=value][ value]
  270. where s is a one or two character short option. A short option that
  271. takes a value is last in an argument and anything after it is taken as
  272. the value. If the option can be negated and "-" immediately follows
  273. the option, the option is negated. Short options can also be given as
  274. separate arguments
  275. -s[-][value][=value][ value] -s[-][value][=value][ value] ...
  276. Short options in general take values either as part of the same argu-
  277. ment or as the following argument. An optional = is also supported.
  278. So
  279. -ttmmddyyyy
  280. and
  281. -tt=mmddyyyy
  282. and
  283. -tt mmddyyyy
  284. all work. The -x and -i options accept lists of values and use a
  285. slightly different format described below. See the -x and -i options.
  286. Long options take the form
  287. --longoption[-][=value][ value]
  288. where the option starts with --, has a multicharacter name, can include
  289. a trailing dash to negate the option (if the option supports it), and
  290. can have a value (option argument) specified by preceeding it with =
  291. (no spaces). Values can also follow the argument. So
  292. --before-date=mmddyyyy
  293. and
  294. --before-date mmddyyyy
  295. both work.
  296. Long option names can be shortened to the shortest unique abbreviation.
  297. See the option descriptions below for which support long options. To
  298. avoid confusion, avoid abbreviating a negatable option with an embedded
  299. dash ("-") at the dash if you plan to negate it (the parser would con-
  300. sider a trailing dash, such as for the option --some-option using
  301. --some- as the option, as part of the name rather than a negating
  302. dash). This may be changed to force the last dash in --some- to be
  303. negating in the future.
  304. OPTIONS
  305. -a
  306. --ascii
  307. [Systems using EBCDIC] Translate file to ASCII format.
  308. -A
  309. --adjust-sfx
  310. Adjust self-extracting executable archive. A self-extracting
  311. executable archive is created by prepending the SFX stub to an
  312. existing archive. The -A option tells zip to adjust the entry
  313. offsets stored in the archive to take into account this "pream-
  314. ble" data.
  315. Note: self-extracting archives for the Amiga are a special case. At
  316. present, only the Amiga port of zip is capable of adjusting or updating
  317. these without corrupting them. -J can be used to remove the SFX stub if
  318. other updates need to be made.
  319. -AC
  320. --archive-clear
  321. [WIN32] Once archive is created (and tested if -T is used,
  322. which is recommended), clear the archive bits of files pro-
  323. cessed. WARNING: Once the bits are cleared they are cleared.
  324. You may want to use the -sf show files option to store the list
  325. of files processed in case the archive operation must be
  326. repeated. Also consider using the -MM must match option. Be
  327. sure to check out -DF as a possibly better way to do incremental
  328. backups.
  329. -AS
  330. --archive-set
  331. [WIN32] Only include files that have the archive bit set.
  332. Directories are not stored when -AS is used, though by default
  333. the paths of entries, including directories, are stored as usual
  334. and can be used by most unzips to recreate directories.
  335. The archive bit is set by the operating system when a file is
  336. modified and, if used with -AC, -AS can provide an incremental
  337. backup capability. However, other applications can modify the
  338. archive bit and it may not be a reliable indicator of which
  339. files have changed since the last archive operation. Alterna-
  340. tive ways to create incremental backups are using -t to use file
  341. dates, though this won't catch old files copied to directories
  342. being archived, and -DF to create a differential archive.
  343. -B
  344. --binary
  345. [VM/CMS and MVS] force file to be read binary (default is text).
  346. -Bn [TANDEM] set Edit/Enscribe formatting options with n defined as
  347. bit 0: Don't add delimiter (Edit/Enscribe)
  348. bit 1: Use LF rather than CR/LF as delimiter (Edit/Enscribe)
  349. bit 2: Space fill record to maximum record length (Enscribe)
  350. bit 3: Trim trailing space (Enscribe)
  351. bit 8: Force 30K (Expand) large read for unstructured files
  352. -b path
  353. --temp-path path
  354. Use the specified path for the temporary zip archive. For exam-
  355. ple:
  356. zip -b /tmp stuff *
  357. will put the temporary zip archive in the directory /tmp, copy-
  358. ing over stuff.zip to the current directory when done. This
  359. option is useful when updating an existing archive and the file
  360. system containing this old archive does not have enough space to
  361. hold both old and new archives at the same time. It may also be
  362. useful when streaming in some cases to avoid the need for data
  363. descriptors. Note that using this option may require zip take
  364. additional time to copy the archive file when done to the desti-
  365. nation file system.
  366. -c
  367. --entry-comments
  368. Add one-line comments for each file. File operations (adding,
  369. updating) are done first, and the user is then prompted for a
  370. one-line comment for each file. Enter the comment followed by
  371. return, or just return for no comment.
  372. -C
  373. --preserve-case
  374. [VMS] Preserve case all on VMS. Negating this option (-C-)
  375. downcases.
  376. -C2
  377. --preserve-case-2
  378. [VMS] Preserve case ODS2 on VMS. Negating this option (-C2-)
  379. downcases.
  380. -C5
  381. --preserve-case-5
  382. [VMS] Preserve case ODS5 on VMS. Negating this option (-C5-)
  383. downcases.
  384. -d
  385. --delete
  386. Remove (delete) entries from a zip archive. For example:
  387. zip -d foo foo/tom/junk foo/harry/\* \*.o
  388. will remove the entry foo/tom/junk, all of the files that start
  389. with foo/harry/, and all of the files that end with .o (in any
  390. path). Note that shell pathname expansion has been inhibited
  391. with backslashes, so that zip can see the asterisks, enabling
  392. zip to match on the contents of the zip archive instead of the
  393. contents of the current directory. (The backslashes are not
  394. used on MSDOS-based platforms.) Can also use quotes to escape
  395. the asterisks as in
  396. zip -d foo foo/tom/junk "foo/harry/*" "*.o"
  397. Not escaping the asterisks on a system where the shell expands
  398. wildcards could result in the asterisks being converted to a
  399. list of files in the current directory and that list used to
  400. delete entries from the archive.
  401. Under MSDOS, -d is case sensitive when it matches names in the
  402. zip archive. This requires that file names be entered in upper
  403. case if they were zipped by PKZIP on an MSDOS system. (We con-
  404. sidered making this case insensitive on systems where paths were
  405. case insensitive, but it is possible the archive came from a
  406. system where case does matter and the archive could include both
  407. Bar and bar as separate files in the archive.) But see the new
  408. option -ic to ignore case in the archive.
  409. -db
  410. --display-bytes
  411. Display running byte counts showing the bytes zipped and the
  412. bytes to go.
  413. -dc
  414. --display-counts
  415. Display running count of entries zipped and entries to go.
  416. -dd
  417. --display-dots
  418. Display dots while each entry is zipped (except on ports that
  419. have their own progress indicator). See -ds below for setting
  420. dot size. The default is a dot every 10 MB of input file pro-
  421. cessed. The -v option also displays dots (previously at a much
  422. higher rate than this but now -v also defaults to 10 MB) and
  423. this rate is also controlled by -ds.
  424. -df
  425. --datafork
  426. [MacOS] Include only data-fork of files zipped into the archive.
  427. Good for exporting files to foreign operating-systems.
  428. Resource-forks will be ignored at all.
  429. -dg
  430. --display-globaldots
  431. Display progress dots for the archive instead of for each file.
  432. The command
  433. zip -qdgds 10m
  434. will turn off most output except dots every 10 MB.
  435. -ds size
  436. --dot-size size
  437. Set amount of input file processed for each dot displayed. See
  438. -dd to enable displaying dots. Setting this option implies -dd.
  439. Size is in the format nm where n is a number and m is a multi-
  440. plier. Currently m can be k (KB), m (MB), g (GB), or t (TB), so
  441. if n is 100 and m is k, size would be 100k which is 100 KB. The
  442. default is 10 MB.
  443. The -v option also displays dots and now defaults to 10 MB also.
  444. This rate is also controlled by this option. A size of 0 turns
  445. dots off.
  446. This option does not control the dots from the "Scanning files"
  447. message as zip scans for input files. The dot size for that is
  448. fixed at 2 seconds or a fixed number of entries, whichever is
  449. longer.
  450. -du
  451. --display-usize
  452. Display the uncompressed size of each entry.
  453. -dv
  454. --display-volume
  455. Display the volume (disk) number each entry is being read from,
  456. if reading an existing archive, and being written to.
  457. -D
  458. --no-dir-entries
  459. Do not create entries in the zip archive for directories.
  460. Directory entries are created by default so that their
  461. attributes can be saved in the zip archive. The environment
  462. variable ZIPOPT can be used to change the default options. For
  463. example under Unix with sh:
  464. ZIPOPT="-D"; export ZIPOPT
  465. (The variable ZIPOPT can be used for any option, including -i
  466. and -x using a new option format detailed below, and can include
  467. several options.) The option -D is a shorthand for -x "*/" but
  468. the latter previously could not be set as default in the ZIPOPT
  469. environment variable as the contents of ZIPOPT gets inserted
  470. near the beginning of the command line and the file list had to
  471. end at the end of the line.
  472. This version of zip does allow -x and -i options in ZIPOPT if
  473. the form
  474. -x file file ... @
  475. is used, where the @ (an argument that is just @) terminates the
  476. list.
  477. -DF
  478. --difference-archive
  479. Create an archive that contains all new and changed files since
  480. the original archive was created. For this to work, the input
  481. file list and current directory must be the same as during the
  482. original zip operation.
  483. For example, if the existing archive was created using
  484. zip -r foofull .
  485. from the bar directory, then the command
  486. zip -r foofull . -DF --out foonew
  487. also from the bar directory creates the archive foonew with just
  488. the files not in foofull and the files where the size or file
  489. time of the files do not match those in foofull.
  490. Note that the timezone environment variable TZ should be set
  491. according to the local timezone in order for this option to work
  492. correctly. A change in timezone since the original archive was
  493. created could result in no times matching and all files being
  494. included.
  495. A possible approach to backing up a directory might be to create
  496. a normal archive of the contents of the directory as a full
  497. backup, then use this option to create incremental backups.
  498. -e
  499. --encrypt
  500. Encrypt the contents of the zip archive using a password which
  501. is entered on the terminal in response to a prompt (this will
  502. not be echoed; if standard error is not a tty, zip will exit
  503. with an error). The password prompt is repeated to save the
  504. user from typing errors.
  505. -E
  506. --longnames
  507. [OS/2] Use the .LONGNAME Extended Attribute (if found) as file-
  508. name.
  509. -f
  510. --freshen
  511. Replace (freshen) an existing entry in the zip archive only if
  512. it has been modified more recently than the version already in
  513. the zip archive; unlike the update option (-u) this will not add
  514. files that are not already in the zip archive. For example:
  515. zip -f foo
  516. This command should be run from the same directory from which
  517. the original zip command was run, since paths stored in zip
  518. archives are always relative.
  519. Note that the timezone environment variable TZ should be set
  520. according to the local timezone in order for the -f, -u and -o
  521. options to work correctly.
  522. The reasons behind this are somewhat subtle but have to do with
  523. the differences between the Unix-format file times (always in
  524. GMT) and most of the other operating systems (always local time)
  525. and the necessity to compare the two. A typical TZ value is
  526. ``MET-1MEST'' (Middle European time with automatic adjustment
  527. for ``summertime'' or Daylight Savings Time).
  528. The format is TTThhDDD, where TTT is the time zone such as MET,
  529. hh is the difference between GMT and local time such as -1
  530. above, and DDD is the time zone when daylight savings time is in
  531. effect. Leave off the DDD if there is no daylight savings time.
  532. For the US Eastern time zone EST5EDT.
  533. -F
  534. --fix
  535. -FF
  536. --fixfix
  537. Fix the zip archive. The -F option can be used if some portions
  538. of the archive are missing, but requires a reasonably intact
  539. central directory. The input archive is scanned as usual, but
  540. zip will ignore some problems. The resulting archive should be
  541. valid, but any inconsistent entries will be left out.
  542. When doubled as in -FF, the archive is scanned from the begin-
  543. ning and zip scans for special signatures to identify the limits
  544. between the archive members. The single -F is more reliable if
  545. the archive is not too much damaged, so try this option first.
  546. If the archive is too damaged or the end has been truncated, you
  547. must use -FF. This is a change from zip 2.32, where the -F
  548. option is able to read a truncated archive. The -F option now
  549. more reliably fixes archives with minor damage and the -FF
  550. option is needed to fix archives where -F might have been suffi-
  551. cient before.
  552. Neither option will recover archives that have been incorrectly
  553. transferred in ascii mode instead of binary. After the repair,
  554. the -t option of unzip may show that some files have a bad CRC.
  555. Such files cannot be recovered; you can remove them from the
  556. archive using the -d option of zip.
  557. Note that -FF may have trouble fixing archives that include an
  558. embedded zip archive that was stored (without compression) in
  559. the archive and, depending on the damage, it may find the
  560. entries in the embedded archive rather than the archive itself.
  561. Try -F first as it does not have this problem.
  562. The format of the fix commands have changed. For example, to
  563. fix the damaged archive foo.zip,
  564. zip -F foo --out foofix
  565. tries to read the entries normally, copying good entries to the
  566. new archive foofix.zip. If this doesn't work, as when the
  567. archive is truncated, or if some entries you know are in the
  568. archive are missed, then try
  569. zip -FF foo --out foofixfix
  570. and compare the resulting archive to the archive created by -F.
  571. The -FF option may create an inconsistent archive. Depending on
  572. what is damaged, you can then use the -F option to fix that
  573. archive.
  574. A split archive with missing split files can be fixed using -F
  575. if you have the last split of the archive (the .zip file). If
  576. this file is missing, you must use -FF to fix the archive, which
  577. will prompt you for the splits you have.
  578. Currently the fix options can't recover entries that have a bad
  579. checksum or are otherwise damaged.
  580. -FI
  581. --fifo [Unix] Normally zip skips reading any FIFOs (named pipes)
  582. encountered, as zip can hang if the FIFO is not being fed. This
  583. option tells zip to read the contents of any FIFO it finds.
  584. -FS
  585. --filesync
  586. Synchronize the contents of an archive with the files on the OS.
  587. Normally when an archive is updated, new files are added and
  588. changed files are updated but files that no longer exist on the
  589. OS are not deleted from the archive. This option enables a new
  590. mode that checks entries in the archive against the file system.
  591. If the file time and file size of the entry matches that of the
  592. OS file, the entry is copied from the old archive instead of
  593. being read from the file system and compressed. If the OS file
  594. has changed, the entry is read and compressed as usual. If the
  595. entry in the archive does not match a file on the OS, the entry
  596. is deleted. Enabling this option should create archives that
  597. are the same as new archives, but since existing entries are
  598. copied instead of compressed, updating an existing archive with
  599. -FS can be much faster than creating a new archive. Also con-
  600. sider using -u for updating an archive.
  601. For this option to work, the archive should be updated from the
  602. same directory it was created in so the relative paths match.
  603. If few files are being copied from the old archive, it may be
  604. faster to create a new archive instead.
  605. Note that the timezone environment variable TZ should be set
  606. according to the local timezone in order for this option to work
  607. correctly. A change in timezone since the original archive was
  608. created could result in no times matching and recompression of
  609. all files.
  610. This option deletes files from the archive. If you need to pre-
  611. serve the original archive, make a copy of the archive first or
  612. use the --out option to output the updated archive to a new
  613. file. Even though it may be slower, creating a new archive with
  614. a new archive name is safer, avoids mismatches between archive
  615. and OS paths, and is preferred.
  616. -g
  617. --grow
  618. Grow (append to) the specified zip archive, instead of creating
  619. a new one. If this operation fails, zip attempts to restore the
  620. archive to its original state. If the restoration fails, the
  621. archive might become corrupted. This option is ignored when
  622. there's no existing archive or when at least one archive member
  623. must be updated or deleted.
  624. -h
  625. -?
  626. --help
  627. Display the zip help information (this also appears if zip is
  628. run with no arguments).
  629. -h2
  630. --more-help
  631. Display extended help including more on command line format,
  632. pattern matching, and more obscure options.
  633. -i files
  634. --include files
  635. Include only the specified files, as in:
  636. zip -r foo . -i \*.c
  637. which will include only the files that end in .c in the current
  638. directory and its subdirectories. (Note for PKZIP users: the
  639. equivalent command is
  640. pkzip -rP foo *.c
  641. PKZIP does not allow recursion in directories other than the
  642. current one.) The backslash avoids the shell filename substitu-
  643. tion, so that the name matching is performed by zip at all
  644. directory levels. [This is for Unix and other systems where \
  645. escapes the next character. For other systems where the shell
  646. does not process * do not use \ and the above is
  647. zip -r foo . -i *.c
  648. Examples are for Unix unless otherwise specified.] So to
  649. include dir, a directory directly under the current directory,
  650. use
  651. zip -r foo . -i dir/\*
  652. or
  653. zip -r foo . -i "dir/*"
  654. to match paths such as dir/a and dir/b/file.c [on ports without
  655. wildcard expansion in the shell such as MSDOS and Windows
  656. zip -r foo . -i dir/*
  657. is used.] Note that currently the trailing / is needed for
  658. directories (as in
  659. zip -r foo . -i dir/
  660. to include directory dir).
  661. The long option form of the first example is
  662. zip -r foo . --include \*.c
  663. and does the same thing as the short option form.
  664. Though the command syntax used to require -i at the end of the
  665. command line, this version actually allows -i (or --include)
  666. anywhere. The list of files terminates at the next argument
  667. starting with -, the end of the command line, or the list termi-
  668. nator @ (an argument that is just @). So the above can be given
  669. as
  670. zip -i \*.c @ -r foo .
  671. for example. There must be a space between the option and the
  672. first file of a list. For just one file you can use the single
  673. value form
  674. zip -i\*.c -r foo .
  675. (no space between option and value) or
  676. zip --include=\*.c -r foo .
  677. as additional examples. The single value forms are not recom-
  678. mended because they can be confusing and, in particular, the
  679. -ifile format can cause problems if the first letter of file
  680. combines with i to form a two-letter option starting with i.
  681. Use -sc to see how your command line will be parsed.
  682. Also possible:
  683. zip -r foo . -i@include.lst
  684. which will only include the files in the current directory and
  685. its subdirectories that match the patterns in the file
  686. include.lst.
  687. Files to -i and -x are patterns matching internal archive paths.
  688. See -R for more on patterns.
  689. -I
  690. --no-image
  691. [Acorn RISC OS] Don't scan through Image files. When used, zip
  692. will not consider Image files (eg. DOS partitions or Spark
  693. archives when SparkFS is loaded) as directories but will store
  694. them as single files.
  695. For example, if you have SparkFS loaded, zipping a Spark archive
  696. will result in a zipfile containing a directory (and its con-
  697. tent) while using the 'I' option will result in a zipfile con-
  698. taining a Spark archive. Obviously this second case will also be
  699. obtained (without the 'I' option) if SparkFS isn't loaded.
  700. -ic
  701. --ignore-case
  702. [VMS, WIN32] Ignore case when matching archive entries. This
  703. option is only available on systems where the case of files is
  704. ignored. On systems with case-insensitive file systems, case is
  705. normally ignored when matching files on the file system but is
  706. not ignored for -f (freshen), -d (delete), -U (copy), and simi-
  707. lar modes when matching against archive entries (currently -f
  708. ignores case on VMS) because archive entries can be from systems
  709. where case does matter and names that are the same except for
  710. case can exist in an archive. The -ic option makes all matching
  711. case insensitive. This can result in multiple archive entries
  712. matching a command line pattern.
  713. -j
  714. --junk-paths
  715. Store just the name of a saved file (junk the path), and do not
  716. store directory names. By default, zip will store the full path
  717. (relative to the current directory).
  718. -jj
  719. --absolute-path
  720. [MacOS] record Fullpath (+ Volname). The complete path including
  721. volume will be stored. By default the relative path will be
  722. stored.
  723. -J
  724. --junk-sfx
  725. Strip any prepended data (e.g. a SFX stub) from the archive.
  726. -k
  727. --DOS-names
  728. Attempt to convert the names and paths to conform to MSDOS,
  729. store only the MSDOS attribute (just the user write attribute
  730. from Unix), and mark the entry as made under MSDOS (even though
  731. it was not); for compatibility with PKUNZIP under MSDOS which
  732. cannot handle certain names such as those with two dots.
  733. -l
  734. --to-crlf
  735. Translate the Unix end-of-line character LF into the MSDOS con-
  736. vention CR LF. This option should not be used on binary files.
  737. This option can be used on Unix if the zip file is intended for
  738. PKUNZIP under MSDOS. If the input files already contain CR LF,
  739. this option adds an extra CR. This is to ensure that unzip -a on
  740. Unix will get back an exact copy of the original file, to undo
  741. the effect of zip -l. See -ll for how binary files are handled.
  742. -la
  743. --log-append
  744. Append to existing logfile. Default is to overwrite.
  745. -lf logfilepath
  746. --logfile-path logfilepath
  747. Open a logfile at the given path. By default any existing file
  748. at that location is overwritten, but the -la option will result
  749. in an existing file being opened and the new log information
  750. appended to any existing information. Only warnings and errors
  751. are written to the log unless the -li option is also given, then
  752. all information messages are also written to the log.
  753. -li
  754. --log-info
  755. Include information messages, such as file names being zipped,
  756. in the log. The default is to only include the command line,
  757. any warnings and errors, and the final status.
  758. -ll
  759. --from-crlf
  760. Translate the MSDOS end-of-line CR LF into Unix LF. This option
  761. should not be used on binary files. This option can be used on
  762. MSDOS if the zip file is intended for unzip under Unix. If the
  763. file is converted and the file is later determined to be binary
  764. a warning is issued and the file is probably corrupted. In this
  765. release if -ll detects binary in the first buffer read from a
  766. file, zip now issues a warning and skips line end conversion on
  767. the file. This check seems to catch all binary files tested,
  768. but the original check remains and if a converted file is later
  769. determined to be binary that warning is still issued. A new
  770. algorithm is now being used for binary detection that should
  771. allow line end conversion of text files in UTF-8 and similar
  772. encodings.
  773. -L
  774. --license
  775. Display the zip license.
  776. -m
  777. --move
  778. Move the specified files into the zip archive; actually, this
  779. deletes the target directories/files after making the specified
  780. zip archive. If a directory becomes empty after removal of the
  781. files, the directory is also removed. No deletions are done
  782. until zip has created the archive without error. This is useful
  783. for conserving disk space, but is potentially dangerous so it is
  784. recommended to use it in combination with -T to test the archive
  785. before removing all input files.
  786. -MM
  787. --must-match
  788. All input patterns must match at least one file and all input
  789. files found must be readable. Normally when an input pattern
  790. does not match a file the "name not matched" warning is issued
  791. and when an input file has been found but later is missing or
  792. not readable a missing or not readable warning is issued. In
  793. either case zip continues creating the archive, with missing or
  794. unreadable new files being skipped and files already in the
  795. archive remaining unchanged. After the archive is created, if
  796. any files were not readable zip returns the OPEN error code (18
  797. on most systems) instead of the normal success return (0 on most
  798. systems). With -MM set, zip exits as soon as an input pattern
  799. is not matched (whenever the "name not matched" warning would be
  800. issued) or when an input file is not readable. In either case
  801. zip exits with an OPEN error and no archive is created.
  802. This option is useful when a known list of files is to be zipped
  803. so any missing or unreadable files will result in an error. It
  804. is less useful when used with wildcards, but zip will still exit
  805. with an error if any input pattern doesn't match at least one
  806. file and if any matched files are unreadable. If you want to
  807. create the archive anyway and only need to know if files were
  808. skipped, don't use -MM and just check the return code. Also -lf
  809. could be useful.
  810. -n suffixes
  811. --suffixes suffixes
  812. Do not attempt to compress files named with the given suffixes.
  813. Such files are simply stored (0% compression) in the output zip
  814. file, so that zip doesn't waste its time trying to compress
  815. them. The suffixes are separated by either colons or semi-
  816. colons. For example:
  817. zip -rn .Z:.zip:.tiff:.gif:.snd foo foo
  818. will copy everything from foo into foo.zip, but will store any
  819. files that end in .Z, .zip, .tiff, .gif, or .snd without trying
  820. to compress them (image and sound files often have their own
  821. specialized compression methods). By default, zip does not com-
  822. press files with extensions in the list
  823. .Z:.zip:.zoo:.arc:.lzh:.arj. Such files are stored directly in
  824. the output archive. The environment variable ZIPOPT can be used
  825. to change the default options. For example under Unix with csh:
  826. setenv ZIPOPT "-n .gif:.zip"
  827. To attempt compression on all files, use:
  828. zip -n : foo
  829. The maximum compression option -9 also attempts compression on
  830. all files regardless of extension.
  831. On Acorn RISC OS systems the suffixes are actually filetypes (3
  832. hex digit format). By default, zip does not compress files with
  833. filetypes in the list DDC:D96:68E (i.e. Archives, CFS files and
  834. PackDir files).
  835. -nw
  836. --no-wild
  837. Do not perform internal wildcard processing (shell processing of
  838. wildcards is still done by the shell unless the arguments are
  839. escaped). Useful if a list of paths is being read and no wild-
  840. card substitution is desired.
  841. -N
  842. --notes
  843. [Amiga, MacOS] Save Amiga or MacOS filenotes as zipfile com-
  844. ments. They can be restored by using the -N option of unzip. If
  845. -c is used also, you are prompted for comments only for those
  846. files that do not have filenotes.
  847. -o
  848. --latest-time
  849. Set the "last modified" time of the zip archive to the latest
  850. (oldest) "last modified" time found among the entries in the zip
  851. archive. This can be used without any other operations, if
  852. desired. For example:
  853. zip -o foo
  854. will change the last modified time of foo.zip to the latest time
  855. of the entries in foo.zip.
  856. -O output-file
  857. --output-file output-file
  858. Process the archive changes as usual, but instead of updating
  859. the existing archive, output the new archive to output-file.
  860. Useful for updating an archive without changing the existing
  861. archive and the input archive must be a different file than the
  862. output archive.
  863. This option can be used to create updated split archives. It
  864. can also be used with -U to copy entries from an existing
  865. archive to a new archive. See the EXAMPLES section below.
  866. Another use is converting zip files from one split size to
  867. another. For instance, to convert an archive with 700 MB CD
  868. splits to one with 2 GB DVD splits, can use:
  869. zip -s 2g cd-split.zip --out dvd-split.zip
  870. which uses copy mode. See -U below. Also:
  871. zip -s 0 split.zip --out unsplit.zip
  872. will convert a split archive to a single-file archive.
  873. Copy mode will convert stream entries (using data descriptors
  874. and which should be compatible with most unzips) to normal
  875. entries (which should be compatible with all unzips), except if
  876. standard encryption was used. For archives with encrypted
  877. entries, zipcloak will decrypt the entries and convert them to
  878. normal entries.
  879. -p
  880. --paths
  881. Include relative file paths as part of the names of files stored
  882. in the archive. This is the default. The -j option junks the
  883. paths and just stores the names of the files.
  884. -P password
  885. --password password
  886. Use password to encrypt zipfile entries (if any). THIS IS INSE-
  887. CURE! Many multi-user operating systems provide ways for any
  888. user to see the current command line of any other user; even on
  889. stand-alone systems there is always the threat of over-the-
  890. shoulder peeking. Storing the plaintext password as part of a
  891. command line in an automated script is even worse. Whenever
  892. possible, use the non-echoing, interactive prompt to enter pass-
  893. words. (And where security is truly important, use strong
  894. encryption such as Pretty Good Privacy instead of the relatively
  895. weak standard encryption provided by zipfile utilities.)
  896. -q
  897. --quiet
  898. Quiet mode; eliminate informational messages and comment
  899. prompts. (Useful, for example, in shell scripts and background
  900. tasks).
  901. -Qn
  902. --Q-flag n
  903. [QDOS] store information about the file in the file header with
  904. n defined as
  905. bit 0: Don't add headers for any file
  906. bit 1: Add headers for all files
  907. bit 2: Don't wait for interactive key press on exit
  908. -r
  909. --recurse-paths
  910. Travel the directory structure recursively; for example:
  911. zip -r foo.zip foo
  912. or more concisely
  913. zip -r foo foo
  914. In this case, all the files and directories in foo are saved in
  915. a zip archive named foo.zip, including files with names starting
  916. with ".", since the recursion does not use the shell's file-name
  917. substitution mechanism. If you wish to include only a specific
  918. subset of the files in directory foo and its subdirectories, use
  919. the -i option to specify the pattern of files to be included.
  920. You should not use -r with the name ".*", since that matches
  921. ".." which will attempt to zip up the parent directory (proba-
  922. bly not what was intended).
  923. Multiple source directories are allowed as in
  924. zip -r foo foo1 foo2
  925. which first zips up foo1 and then foo2, going down each direc-
  926. tory.
  927. Note that while wildcards to -r are typically resolved while
  928. recursing down directories in the file system, any -R, -x, and
  929. -i wildcards are applied to internal archive pathnames once the
  930. directories are scanned. To have wildcards apply to files in
  931. subdirectories when recursing on Unix and similar systems where
  932. the shell does wildcard substitution, either escape all wild-
  933. cards or put all arguments with wildcards in quotes. This lets
  934. zip see the wildcards and match files in subdirectories using
  935. them as it recurses.
  936. -R
  937. --recurse-patterns
  938. Travel the directory structure recursively starting at the cur-
  939. rent directory; for example:
  940. zip -R foo "*.c"
  941. In this case, all the files matching *.c in the tree starting at
  942. the current directory are stored into a zip archive named
  943. foo.zip. Note that *.c will match file.c, a/file.c and a/b/.c.
  944. More than one pattern can be listed as separate arguments. Note
  945. for PKZIP users: the equivalent command is
  946. pkzip -rP foo *.c
  947. Patterns are relative file paths as they appear in the archive,
  948. or will after zipping, and can have optional wildcards in them.
  949. For example, given the current directory is foo and under it are
  950. directories foo1 and foo2 and in foo1 is the file bar.c,
  951. zip -R foo/*
  952. will zip up foo, foo/foo1, foo/foo1/bar.c, and foo/foo2.
  953. zip -R */bar.c
  954. will zip up foo/foo1/bar.c. See the note for -r on escaping
  955. wildcards.
  956. -RE
  957. --regex
  958. [WIN32] Before zip 3.0, regular expression list matching was
  959. enabled by default on Windows platforms. Because of confusion
  960. resulting from the need to escape "[" and "]" in names, it is
  961. now off by default for Windows so "[" and "]" are just normal
  962. characters in names. This option enables [] matching again.
  963. -s splitsize
  964. --split-size splitsize
  965. Enable creating a split archive and set the split size. A split
  966. archive is an archive that could be split over many files. As
  967. the archive is created, if the size of the archive reaches the
  968. specified split size, that split is closed and the next split
  969. opened. In general all splits but the last will be the split
  970. size and the last will be whatever is left. If the entire
  971. archive is smaller than the split size a single-file archive is
  972. created.
  973. Split archives are stored in numbered files. For example, if
  974. the output archive is named archive and three splits are
  975. required, the resulting archive will be in the three files
  976. archive.z01, archive.z02, and archive.zip. Do not change the
  977. numbering of these files or the archive will not be readable as
  978. these are used to determine the order the splits are read.
  979. Split size is a number optionally followed by a multiplier.
  980. Currently the number must be an integer. The multiplier can
  981. currently be one of k (kilobytes), m (megabytes), g (gigabytes),
  982. or t (terabytes). As 64k is the minimum split size, numbers
  983. without multipliers default to megabytes. For example, to cre-
  984. ate a split archive called foo with the contents of the bar
  985. directory with splits of 670 MB that might be useful for burning
  986. on CDs, the command:
  987. zip -s 670m -r foo bar
  988. could be used.
  989. Currently the old splits of a split archive are not excluded
  990. from a new archive, but they can be specifically excluded. If
  991. possible, keep the input and output archives out of the path
  992. being zipped when creating split archives.
  993. Using -s without -sp as above creates all the splits where foo
  994. is being written, in this case the current directory. This
  995. split mode updates the splits as the archive is being created,
  996. requiring all splits to remain writable, but creates split
  997. archives that are readable by any unzip that supports split
  998. archives. See -sp below for enabling split pause mode which
  999. allows splits to be written directly to removable media.
  1000. The option -sv can be used to enable verbose splitting and pro-
  1001. vide details of how the splitting is being done. The -sb option
  1002. can be used to ring the bell when zip pauses for the next split
  1003. destination.
  1004. Split archives cannot be updated, but see the -O (--out) option
  1005. for how a split archive can be updated as it is copied to a new
  1006. archive. A split archive can also be converted into a single-
  1007. file archive using a split size of 0 or negating the -s option:
  1008. zip -s 0 split.zip --out single.zip
  1009. Also see -U (--copy) for more on using copy mode.
  1010. -sb
  1011. --split-bell
  1012. If splitting and using split pause mode, ring the bell when zip
  1013. pauses for each split destination.
  1014. -sc
  1015. --show-command
  1016. Show the command line starting zip as processed and exit. The
  1017. new command parser permutes the arguments, putting all options
  1018. and any values associated with them before any non-option argu-
  1019. ments. This allows an option to appear anywhere in the command
  1020. line as long as any values that go with the option go with it.
  1021. This option displays the command line as zip sees it, including
  1022. any arguments from the environment such as from the ZIPOPT vari-
  1023. able. Where allowed, options later in the command line can
  1024. override options earlier in the command line.
  1025. -sf
  1026. --show-files
  1027. Show the files that would be operated on, then exit. For
  1028. instance, if creating a new archive, this will list the files
  1029. that would be added. If the option is negated, -sf-, output
  1030. only to an open log file. Screen display is not recommended for
  1031. large lists.
  1032. -so
  1033. --show-options
  1034. Show all available options supported by zip as compiled on the
  1035. current system. As this command reads the option table, it
  1036. should include all options. Each line includes the short option
  1037. (if defined), the long option (if defined), the format of any
  1038. value that goes with the option, if the option can be negated,
  1039. and a small description. The value format can be no value,
  1040. required value, optional value, single character value, number
  1041. value, or a list of values. The output of this option is not
  1042. intended to show how to use any option but only show what
  1043. options are available.
  1044. -sp
  1045. --split-pause
  1046. If splitting is enabled with -s, enable split pause mode. This
  1047. creates split archives as -s does, but stream writing is used so
  1048. each split can be closed as soon as it is written and zip will
  1049. pause between each split to allow changing split destination or
  1050. media.
  1051. Though this split mode allows writing splits directly to remov-
  1052. able media, it uses stream archive format that may not be read-
  1053. able by some unzips. Before relying on splits created with -sp,
  1054. test a split archive with the unzip you will be using.
  1055. To convert a stream split archive (created with -sp) to a stan-
  1056. dard archive see the --out option.
  1057. -su
  1058. --show-unicode
  1059. As -sf, but also show Unicode version of the path if exists.
  1060. -sU
  1061. --show-just-unicode
  1062. As -sf, but only show Unicode version of the path if exists,
  1063. otherwise show the standard version of the path.
  1064. -sv
  1065. --split-verbose
  1066. Enable various verbose messages while splitting, showing how the
  1067. splitting is being done.
  1068. -S
  1069. --system-hidden
  1070. [MSDOS, OS/2, WIN32 and ATARI] Include system and hidden files.
  1071. [MacOS] Includes finder invisible files, which are ignored oth-
  1072. erwise.
  1073. -t mmddyyyy
  1074. --from-date mmddyyyy
  1075. Do not operate on files modified prior to the specified date,
  1076. where mm is the month (00-12), dd is the day of the month
  1077. (01-31), and yyyy is the year. The ISO 8601 date format
  1078. yyyy-mm-dd is also accepted. For example:
  1079. zip -rt 12071991 infamy foo
  1080. zip -rt 1991-12-07 infamy foo
  1081. will add all the files in foo and its subdirectories that were
  1082. last modified on or after 7 December 1991, to the zip archive
  1083. infamy.zip.
  1084. -tt mmddyyyy
  1085. --before-date mmddyyyy
  1086. Do not operate on files modified after or at the specified date,
  1087. where mm is the month (00-12), dd is the day of the month
  1088. (01-31), and yyyy is the year. The ISO 8601 date format
  1089. yyyy-mm-dd is also accepted. For example:
  1090. zip -rtt 11301995 infamy foo
  1091. zip -rtt 1995-11-30 infamy foo
  1092. will add all the files in foo and its subdirectories that were
  1093. last modified before 30 November 1995, to the zip archive
  1094. infamy.zip.
  1095. -T
  1096. --test
  1097. Test the integrity of the new zip file. If the check fails, the
  1098. old zip file is unchanged and (with the -m option) no input
  1099. files are removed.
  1100. -TT cmd
  1101. --unzip-command cmd
  1102. Use command cmd instead of 'unzip -tqq' to test an archive when
  1103. the -T option is used. On Unix, to use a copy of unzip in the
  1104. current directory instead of the standard system unzip, could
  1105. use:
  1106. zip archive file1 file2 -T -TT "./unzip -tqq"
  1107. In cmd, {} is replaced by the name of the temporary archive,
  1108. otherwise the name of the archive is appended to the end of the
  1109. command. The return code is checked for success (0 on Unix).
  1110. -u
  1111. --update
  1112. Replace (update) an existing entry in the zip archive only if it
  1113. has been modified more recently than the version already in the
  1114. zip archive. For example:
  1115. zip -u stuff *
  1116. will add any new files in the current directory, and update any
  1117. files which have been modified since the zip archive stuff.zip
  1118. was last created/modified (note that zip will not try to pack
  1119. stuff.zip into itself when you do this).
  1120. Note that the -u option with no input file arguments acts like
  1121. the -f (freshen) option.
  1122. -U
  1123. --copy-entries
  1124. Copy entries from one archive to another. Requires the --out
  1125. option to specify a different output file than the input
  1126. archive. Copy mode is the reverse of -d delete. When delete is
  1127. being used with --out, the selected entries are deleted from the
  1128. archive and all other entries are copied to the new archive,
  1129. while copy mode selects the files to include in the new archive.
  1130. Unlike -u update, input patterns on the command line are matched
  1131. against archive entries only and not the file system files. For
  1132. instance,
  1133. zip inarchive "*.c" --copy --out outarchive
  1134. copies entries with names ending in .c from inarchive to out-
  1135. archive. The wildcard must be escaped on some systems to pre-
  1136. vent the shell from substituting names of files from the file
  1137. system which may have no relevance to the entries in the
  1138. archive.
  1139. If no input files appear on the command line and --out is used,
  1140. copy mode is assumed:
  1141. zip inarchive --out outarchive
  1142. This is useful for changing split size for instance. Encrypting
  1143. and decrypting entries is not yet supported using copy mode.
  1144. Use zipcloak for that.
  1145. -UN v
  1146. --unicode v
  1147. Determine what zip should do with Unicode file names. zip 3.0,
  1148. in addition to the standard file path, now includes the UTF-8
  1149. translation of the path if the entry path is not entirely 7-bit
  1150. ASCII. When an entry is missing the Unicode path, zip reverts
  1151. back to the standard file path. The problem with using the
  1152. standard path is this path is in the local character set of the
  1153. zip that created the entry, which may contain characters that
  1154. are not valid in the character set being used by the unzip.
  1155. When zip is reading an archive, if an entry also has a Unicode
  1156. path, zip now defaults to using the Unicode path to recreate the
  1157. standard path using the current local character set.
  1158. This option can be used to determine what zip should do with
  1159. this path if there is a mismatch between the stored standard
  1160. path and the stored UTF-8 path (which can happen if the standard
  1161. path was updated). In all cases, if there is a mismatch it is
  1162. assumed that the standard path is more current and zip uses
  1163. that. Values for v are
  1164. q - quit if paths do not match
  1165. w - warn, continue with standard path
  1166. i - ignore, continue with standard path
  1167. n - no Unicode, do not use Unicode paths
  1168. The default is to warn and continue.
  1169. Characters that are not valid in the current character set are
  1170. escaped as #Uxxxx and #Lxxxxxx, where x is an ASCII character
  1171. for a hex digit. The first is used if a 16-bit character number
  1172. is sufficient to represent the Unicode character and the second
  1173. if the character needs more than 16 bits to represent it's Uni-
  1174. code character code. Setting -UN to
  1175. e - escape
  1176. as in
  1177. zip archive -sU -UN=e
  1178. forces zip to escape all characters that are not printable 7-bit
  1179. ASCII.
  1180. Normally zip stores UTF-8 directly in the standard path field on
  1181. systems where UTF-8 is the current character set and stores the
  1182. UTF-8 in the new extra fields otherwise. The option
  1183. u - UTF-8
  1184. as in
  1185. zip archive dir -r -UN=UTF8
  1186. forces zip to store UTF-8 as native in the archive. Note that
  1187. storing UTF-8 directly is the default on Unix systems that sup-
  1188. port it. This option could be useful on Windows systems where
  1189. the escaped path is too large to be a valid path and the UTF-8
  1190. version of the path is smaller, but native UTF-8 is not backward
  1191. compatible on Windows systems.
  1192. -v
  1193. --verbose
  1194. Verbose mode or print diagnostic version info.
  1195. Normally, when applied to real operations, this option enables
  1196. the display of a progress indicator during compression (see -dd
  1197. for more on dots) and requests verbose diagnostic info about
  1198. zipfile structure oddities.
  1199. However, when -v is the only command line argument a diagnostic
  1200. screen is printed instead. This should now work even if stdout
  1201. is redirected to a file, allowing easy saving of the information
  1202. for sending with bug reports to Info-ZIP. The version screen
  1203. provides the help screen header with program name, version, and
  1204. release date, some pointers to the Info-ZIP home and distribu-
  1205. tion sites, and shows information about the target environment
  1206. (compiler type and version, OS version, compilation date and the
  1207. enabled optional features used to create the zip executable).
  1208. -V
  1209. --VMS-portable
  1210. [VMS] Save VMS file attributes. (Files are truncated at EOF.)
  1211. When a -V archive is unpacked on a non-VMS system, some file
  1212. types (notably Stream_LF text files and pure binary files
  1213. like fixed-512) should be extracted intact. Indexed files and
  1214. file types with embedded record sizes (notably variable-length
  1215. record types) will probably be seen as corrupt elsewhere.
  1216. -VV
  1217. --VMS-specific
  1218. [VMS] Save VMS file attributes, and all allocated blocks in a
  1219. file, including any data beyond EOF. Useful for moving ill-
  1220. formed files among VMS systems. When a -VV archive is
  1221. unpacked on a non-VMS system, almost all files will appear cor-
  1222. rupt.
  1223. -w
  1224. --VMS-versions
  1225. [VMS] Append the version number of the files to the name,
  1226. including multiple versions of files. Default is to use only
  1227. the most recent version of a specified file.
  1228. -ww
  1229. --VMS-dot-versions
  1230. [VMS] Append the version number of the files to the name,
  1231. including multiple versions of files, using the .nnn format.
  1232. Default is to use only the most recent version of a specified
  1233. file.
  1234. -ws
  1235. --wild-stop-dirs
  1236. Wildcards match only at a directory level. Normally zip handles
  1237. paths as strings and given the paths
  1238. /foo/bar/dir/file1.c
  1239. /foo/bar/file2.c
  1240. an input pattern such as
  1241. /foo/bar/*
  1242. normally would match both paths, the * matching dir/file1.c and
  1243. file2.c. Note that in the first case a directory boundary (/)
  1244. was crossed in the match. With -ws no directory bounds will be
  1245. included in the match, making wildcards local to a specific
  1246. directory level. So, with -ws enabled, only the second path
  1247. would be matched.
  1248. When using -ws, use ** to match across directory boundaries as *
  1249. does normally.
  1250. -x files
  1251. --exclude files
  1252. Explicitly exclude the specified files, as in:
  1253. zip -r foo foo -x \*.o
  1254. which will include the contents of foo in foo.zip while exclud-
  1255. ing all the files that end in .o. The backslash avoids the
  1256. shell filename substitution, so that the name matching is per-
  1257. formed by zip at all directory levels.
  1258. Also possible:
  1259. zip -r foo foo -x@exclude.lst
  1260. which will include the contents of foo in foo.zip while exclud-
  1261. ing all the files that match the patterns in the file
  1262. exclude.lst.
  1263. The long option forms of the above are
  1264. zip -r foo foo --exclude \*.o
  1265. and
  1266. zip -r foo foo --exclude @exclude.lst
  1267. Multiple patterns can be specified, as in:
  1268. zip -r foo foo -x \*.o \*.c
  1269. If there is no space between -x and the pattern, just one value
  1270. is assumed (no list):
  1271. zip -r foo foo -x\*.o
  1272. See -i for more on include and exclude.
  1273. -X
  1274. --no-extra
  1275. Do not save extra file attributes (Extended Attributes on OS/2,
  1276. uid/gid and file times on Unix). The zip format uses extra
  1277. fields to include additional information for each entry. Some
  1278. extra fields are specific to particular systems while others are
  1279. applicable to all systems. Normally when zip reads entries from
  1280. an existing archive, it reads the extra fields it knows, strips
  1281. the rest, and adds the extra fields applicable to that system.
  1282. With -X, zip strips all old fields and only includes the Unicode
  1283. and Zip64 extra fields (currently these two extra fields cannot
  1284. be disabled).
  1285. Negating this option, -X-, includes all the default extra
  1286. fields, but also copies over any unrecognized extra fields.
  1287. -y
  1288. --symlinks
  1289. For UNIX and VMS (V8.3 and later), store symbolic links as such
  1290. in the zip archive, instead of compressing and storing the file
  1291. referred to by the link. This can avoid multiple copies of
  1292. files being included in the archive as zip recurses the direc-
  1293. tory trees and accesses files directly and by links.
  1294. -z
  1295. --archive-comment
  1296. Prompt for a multi-line comment for the entire zip archive. The
  1297. comment is ended by a line containing just a period, or an end
  1298. of file condition (^D on Unix, ^Z on MSDOS, OS/2, and VMS). The
  1299. comment can be taken from a file:
  1300. zip -z foo < foowhat
  1301. -Z cm
  1302. --compression-method cm
  1303. Set the default compression method. Currently the main methods
  1304. supported by zip are store and deflate. Compression method can
  1305. be set to:
  1306. store - Setting the compression method to store forces zip to
  1307. store entries with no compression. This is generally faster
  1308. than compressing entries, but results in no space savings. This
  1309. is the same as using -0 (compression level zero).
  1310. deflate - This is the default method for zip. If zip determines
  1311. that storing is better than deflation, the entry will be stored
  1312. instead.
  1313. bzip2 - If bzip2 support is compiled in, this compression method
  1314. also becomes available. Only some modern unzips currently sup-
  1315. port the bzip2 compression method, so test the unzip you will be
  1316. using before relying on archives using this method (compression
  1317. method 12).
  1318. For example, to add bar.c to archive foo using bzip2 compres-
  1319. sion:
  1320. zip -Z bzip2 foo bar.c
  1321. The compression method can be abbreviated:
  1322. zip -Zb foo bar.c
  1323. -#
  1324. (-0, -1, -2, -3, -4, -5, -6, -7, -8, -9)
  1325. Regulate the speed of compression using the specified digit #,
  1326. where -0 indicates no compression (store all files), -1 indi-
  1327. cates the fastest compression speed (less compression) and -9
  1328. indicates the slowest compression speed (optimal compression,
  1329. ignores the suffix list). The default compression level is -6.
  1330. Though still being worked, the intention is this setting will
  1331. control compression speed for all compression methods. Cur-
  1332. rently only deflation is controlled.
  1333. -!
  1334. --use-privileges
  1335. [WIN32] Use priviliges (if granted) to obtain all aspects of
  1336. WinNT security.
  1337. -@
  1338. --names-stdin
  1339. Take the list of input files from standard input. Only one file-
  1340. name per line.
  1341. -$
  1342. --volume-label
  1343. [MSDOS, OS/2, WIN32] Include the volume label for the drive
  1344. holding the first file to be compressed. If you want to include
  1345. only the volume label or to force a specific drive, use the
  1346. drive name as first file name, as in:
  1347. zip -$ foo a: c:bar
  1348. EXAMPLES
  1349. The simplest example:
  1350. zip stuff *
  1351. creates the archive stuff.zip (assuming it does not exist) and puts all
  1352. the files in the current directory in it, in compressed form (the .zip
  1353. suffix is added automatically, unless the archive name contains a dot
  1354. already; this allows the explicit specification of other suffixes).
  1355. Because of the way the shell on Unix does filename substitution, files
  1356. starting with "." are not included; to include these as well:
  1357. zip stuff .* *
  1358. Even this will not include any subdirectories from the current direc-
  1359. tory.
  1360. To zip up an entire directory, the command:
  1361. zip -r foo foo
  1362. creates the archive foo.zip, containing all the files and directories
  1363. in the directory foo that is contained within the current directory.
  1364. You may want to make a zip archive that contains the files in foo,
  1365. without recording the directory name, foo. You can use the -j option
  1366. to leave off the paths, as in:
  1367. zip -j foo foo/*
  1368. If you are short on disk space, you might not have enough room to hold
  1369. both the original directory and the corresponding compressed zip
  1370. archive. In this case, you can create the archive in steps using the
  1371. -m option. If foo contains the subdirectories tom, dick, and harry,
  1372. you can:
  1373. zip -rm foo foo/tom
  1374. zip -rm foo foo/dick
  1375. zip -rm foo foo/harry
  1376. where the first command creates foo.zip, and the next two add to it.
  1377. At the completion of each zip command, the last created archive is
  1378. deleted, making room for the next zip command to function.
  1379. Use -s to set the split size and create a split archive. The size is
  1380. given as a number followed optionally by one of k (kB), m (MB), g (GB),
  1381. or t (TB). The command
  1382. zip -s 2g -r split.zip foo
  1383. creates a split archive of the directory foo with splits no bigger than
  1384. 2 GB each. If foo contained 5 GB of contents and the contents were
  1385. stored in the split archive without compression (to make this example
  1386. simple), this would create three splits, split.z01 at 2 GB, split.z02
  1387. at 2 GB, and split.zip at a little over 1 GB.
  1388. The -sp option can be used to pause zip between splits to allow chang-
  1389. ing removable media, for example, but read the descriptions and warn-
  1390. ings for both -s and -sp below.
  1391. Though zip does not update split archives, zip provides the new option
  1392. -O (--output-file) to allow split archives to be updated and saved in a
  1393. new archive. For example,
  1394. zip inarchive.zip foo.c bar.c --out outarchive.zip
  1395. reads archive inarchive.zip, even if split, adds the files foo.c and
  1396. bar.c, and writes the resulting archive to outarchive.zip. If inar-
  1397. chive.zip is split then outarchive.zip defaults to the same split size.
  1398. Be aware that outarchive.zip and any split files that are created with
  1399. it are always overwritten without warning. This may be changed in the
  1400. future.
  1401. PATTERN MATCHING
  1402. This section applies only to Unix. Watch this space for details on
  1403. MSDOS and VMS operation. However, the special wildcard characters *
  1404. and [] below apply to at least MSDOS also.
  1405. The Unix shells (sh, csh, bash, and others) normally do filename sub-
  1406. stitution (also called "globbing") on command arguments. Generally the
  1407. special characters are:
  1408. ? match any single character
  1409. * match any number of characters (including none)
  1410. [] match any character in the range indicated within the brackets
  1411. (example: [a-f], [0-9]). This form of wildcard matching allows
  1412. a user to specify a list of characters between square brackets
  1413. and if any of the characters match the expression matches. For
  1414. example:
  1415. zip archive "*.[hc]"
  1416. would archive all files in the current directory that end in .h
  1417. or .c.
  1418. Ranges of characters are supported:
  1419. zip archive "[a-f]*"
  1420. would add to the archive all files starting with "a" through
  1421. "f".
  1422. Negation is also supported, where any character in that position
  1423. not in the list matches. Negation is supported by adding ! or ^
  1424. to the beginning of the list:
  1425. zip archive "*.[!o]"
  1426. matches files that don't end in ".o".
  1427. On WIN32, [] matching needs to be turned on with the -RE option
  1428. to avoid the confusion that names with [ or ] have caused.
  1429. When these characters are encountered (without being escaped with a
  1430. backslash or quotes), the shell will look for files relative to the
  1431. current path that match the pattern, and replace the argument with a
  1432. list of the names that matched.
  1433. The zip program can do the same matching on names that are in the zip
  1434. archive being modified or, in the case of the -x (exclude) or -i
  1435. (include) options, on the list of files to be operated on, by using
  1436. backslashes or quotes to tell the shell not to do the name expansion.
  1437. In general, when zip encounters a name in the list of files to do, it
  1438. first looks for the name in the file system. If it finds it, it then
  1439. adds it to the list of files to do. If it does not find it, it looks
  1440. for the name in the zip archive being modified (if it exists), using
  1441. the pattern matching characters described above, if present. For each
  1442. match, it will add that name to the list of files to be processed,
  1443. unless this name matches one given with the -x option, or does not
  1444. match any name given with the -i option.
  1445. The pattern matching includes the path, and so patterns like \*.o match
  1446. names that end in ".o", no matter what the path prefix is. Note that
  1447. the backslash must precede every special character (i.e. ?*[]), or the
  1448. entire argument must be enclosed in double quotes ("").
  1449. In general, use backslashes or double quotes for paths that have wild-
  1450. cards to make zip do the pattern matching for file paths, and always
  1451. for paths and strings that have spaces or wildcards for -i, -x, -R, -d,
  1452. and -U and anywhere zip needs to process the wildcards.
  1453. ENVIRONMENT
  1454. The following environment variables are read and used by zip as
  1455. described.
  1456. ZIPOPT
  1457. contains default options that will be used when running zip.
  1458. The contents of this environment variable will get added to the
  1459. command line just after the zip command.
  1460. ZIP
  1461. [Not on RISC OS and VMS] see ZIPOPT
  1462. Zip$Options
  1463. [RISC OS] see ZIPOPT
  1464. Zip$Exts
  1465. [RISC OS] contains extensions separated by a : that will cause
  1466. native filenames with one of the specified extensions to be
  1467. added to the zip file with basename and extension swapped.
  1468. ZIP_OPTS
  1469. [VMS] see ZIPOPT
  1470. SEE ALSO
  1471. compress(1), shar(1L), tar(1), unzip(1L), gzip(1L)
  1472. DIAGNOSTICS
  1473. The exit status (or error level) approximates the exit codes defined by
  1474. PKWARE and takes on the following values, except under VMS:
  1475. 0 normal; no errors or warnings detected.
  1476. 2 unexpected end of zip file.
  1477. 3 a generic error in the zipfile format was detected. Pro-
  1478. cessing may have completed successfully anyway; some bro-
  1479. ken zipfiles created by other archivers have simple work-
  1480. arounds.
  1481. 4 zip was unable to allocate memory for one or more buffers
  1482. during program initialization.
  1483. 5 a severe error in the zipfile format was detected. Pro-
  1484. cessing probably failed immediately.
  1485. 6 entry too large to be processed (such as input files
  1486. larger than 2 GB when not using Zip64 or trying to read
  1487. an existing archive that is too large) or entry too large
  1488. to be split with zipsplit
  1489. 7 invalid comment format
  1490. 8 zip -T failed or out of memory
  1491. 9 the user aborted zip prematurely with control-C (or simi-
  1492. lar)
  1493. 10 zip encountered an error while using a temp file
  1494. 11 read or seek error
  1495. 12 zip has nothing to do
  1496. 13 missing or empty zip file
  1497. 14 error writing to a file
  1498. 15 zip was unable to create a file to write to
  1499. 16 bad command line parameters
  1500. 18 zip could not open a specified file to read
  1501. 19 zip was compiled with options not supported on this sys-
  1502. tem
  1503. VMS interprets standard Unix (or PC) return values as other, scarier-
  1504. looking things, so zip instead maps them into VMS-style status codes.
  1505. In general, zip sets VMS Facility = 1955 (0x07A3), Code = 2* Unix_sta-
  1506. tus, and an appropriate Severity (as specified in ziperr.h). More
  1507. details are included in the VMS-specific documentation. See
  1508. [.vms]NOTES.TXT and [.vms]vms_msg_gen.c.
  1509. BUGS
  1510. zip 3.0 is not compatible with PKUNZIP 1.10. Use zip 1.1 to produce zip
  1511. files which can be extracted by PKUNZIP 1.10.
  1512. zip files produced by zip 3.0 must not be updated by zip 1.1 or PKZIP
  1513. 1.10, if they contain encrypted members or if they have been produced
  1514. in a pipe or on a non-seekable device. The old versions of zip or PKZIP
  1515. would create an archive with an incorrect format. The old versions can
  1516. list the contents of the zip file but cannot extract it anyway (because
  1517. of the new compression algorithm). If you do not use encryption and
  1518. use regular disk files, you do not have to care about this problem.
  1519. Under VMS, not all of the odd file formats are treated properly. Only
  1520. stream-LF format zip files are expected to work with zip. Others can
  1521. be converted using Rahul Dhesi's BILF program. This version of zip
  1522. handles some of the conversion internally. When using Kermit to trans-
  1523. fer zip files from VMS to MSDOS, type "set file type block" on VMS.
  1524. When transfering from MSDOS to VMS, type "set file type fixed" on VMS.
  1525. In both cases, type "set file type binary" on MSDOS.
  1526. Under some older VMS versions, zip may hang for file specifications
  1527. that use DECnet syntax foo::*.*.
  1528. On OS/2, zip cannot match some names, such as those including an excla-
  1529. mation mark or a hash sign. This is a bug in OS/2 itself: the 32-bit
  1530. DosFindFirst/Next don't find such names. Other programs such as GNU
  1531. tar are also affected by this bug.
  1532. Under OS/2, the amount of Extended Attributes displayed by DIR is (for
  1533. compatibility) the amount returned by the 16-bit version of DosQuery-
  1534. PathInfo(). Otherwise OS/2 1.3 and 2.0 would report different EA sizes
  1535. when DIRing a file. However, the structure layout returned by the
  1536. 32-bit DosQueryPathInfo() is a bit different, it uses extra padding
  1537. bytes and link pointers (it's a linked list) to have all fields on
  1538. 4-byte boundaries for portability to future RISC OS/2 versions. There-
  1539. fore the value reported by zip (which uses this 32-bit-mode size) dif-
  1540. fers from that reported by DIR. zip stores the 32-bit format for
  1541. portability, even the 16-bit MS-C-compiled version running on OS/2 1.3,
  1542. so even this one shows the 32-bit-mode size.
  1543. AUTHORS
  1544. Copyright (C) 1997-2008 Info-ZIP.
  1545. Currently distributed under the Info-ZIP license.
  1546. Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,
  1547. Onno van der Linden, Kai Uwe Rommel, Igor Mandrichenko, John Bush and
  1548. Paul Kienitz.
  1549. Original copyright:
  1550. Permission is granted to any individual or institution to use, copy, or
  1551. redistribute this software so long as all of the original files are
  1552. included, that it is not sold for profit, and that this copyright
  1553. notice is retained.
  1554. LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES ARE
  1555. PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED
  1556. OR IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
  1557. DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE.
  1558. Please send bug reports and comments using the web page at: www.info-
  1559. zip.org. For bug reports, please include the version of zip (see
  1560. zip -h), the make options used to compile it (see zip -v), the machine
  1561. and operating system in use, and as much additional information as pos-
  1562. sible.
  1563. ACKNOWLEDGEMENTS
  1564. Thanks to R. P. Byrne for his Shrink.Pas program, which inspired this
  1565. project, and from which the shrink algorithm was stolen; to Phil Katz
  1566. for placing in the public domain the zip file format, compression for-
  1567. mat, and .ZIP filename extension, and for accepting minor changes to
  1568. the file format; to Steve Burg for clarifications on the deflate for-
  1569. mat; to Haruhiko Okumura and Leonid Broukhis for providing some useful
  1570. ideas for the compression algorithm; to Keith Petersen, Rich Wales,
  1571. Hunter Goatley and Mark Adler for providing a mailing list and ftp site
  1572. for the Info-ZIP group to use; and most importantly, to the Info-ZIP
  1573. group itself (listed in the file infozip.who) without whose tireless
  1574. testing and bug-fixing efforts a portable zip would not have been pos-
  1575. sible. Finally we should thank (blame) the first Info-ZIP moderator,
  1576. David Kirschbaum, for getting us into this mess in the first place.
  1577. The manual page was rewritten for Unix by R. P. C. Rodgers and updated
  1578. by E. Gordon for zip 3.0.
  1579. Info-ZIP 16 June 2008 (v3.0) ZIP(1L)