zip.1 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840
  1. .\" =========================================================================
  2. .\" Copyright (c) 1990-2008 Info-ZIP. All rights reserved.
  3. .\"
  4. .\" See the accompanying file LICENSE, version 2007-Mar-4 or later
  5. .\" (the contents of which are also included in zip.h) for terms of use.
  6. .\" If, for some reason, all these files are missing, the Info-ZIP license
  7. .\" also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  8. .\" ==========================================================================
  9. .\"
  10. .\" zip.1 by Mark Adler, Jean-loup Gailly and R. P. C. Rodgers
  11. .\" updated by E. Gordon for Zip 3.0 (8 May 2005, 24 December 2006,
  12. .\" 4 February 2007, 27 May 2007, 4 June 2007 by EG; 12 June 2007 by CS;
  13. .\" 30 August 2007, 27 April 2008, 25 May 2008, 27 May 2008 by EG,
  14. .\" 7 June 2008 by SMS and EG; 12 June 2008 by EG)
  15. .\"
  16. .TH ZIP 1L "16 June 2008 (v3.0)" Info-ZIP
  17. .SH NAME
  18. zip \- package and compress (archive) files
  19. .SH SYNOPSIS
  20. .B zip
  21. .RB [\- aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$ ]
  22. [\-\-longoption ...]
  23. .RB [\- b " path]"
  24. .RB [\- n " suffixes]"
  25. .RB [\- t " date]"
  26. .RB [\- tt " date]"
  27. [\fIzipfile\fR [\fIfile\fR \.\|.\|.]]
  28. [\fB-xi\fR list]
  29. .PP
  30. .B zipcloak
  31. (see separate man page)
  32. .PP
  33. .B zipnote
  34. (see separate man page)
  35. .PP
  36. .B zipsplit
  37. (see separate man page)
  38. .PP
  39. Note: Command line processing in
  40. .I zip
  41. has been changed to support long options and handle all
  42. options and arguments more consistently. Some old command
  43. lines that depend on command line inconsistencies may no longer
  44. work.
  45. .SH DESCRIPTION
  46. .I zip
  47. is a compression and file packaging utility for Unix, VMS, MSDOS,
  48. OS/2, Windows 9x/NT/XP, Minix, Atari, Macintosh, Amiga, and Acorn
  49. RISC OS. It is analogous to a combination of the Unix commands
  50. .IR tar (1)
  51. and
  52. .IR compress (1)
  53. and is compatible with PKZIP (Phil Katz's ZIP for MSDOS systems).
  54. .LP
  55. A companion program
  56. .RI ( unzip (1L))
  57. unpacks
  58. .I zip
  59. archives.
  60. The
  61. .I zip
  62. and
  63. .IR unzip (1L)
  64. programs can work with archives produced by PKZIP (supporting
  65. most PKZIP features up to PKZIP version 4.6),
  66. and PKZIP and PKUNZIP can work with archives produced by
  67. \fIzip\fP (with some exceptions, notably streamed archives,
  68. but recent changes in the zip file standard may facilitate
  69. better compatibility).
  70. .I zip
  71. version 3.0 is compatible with PKZIP 2.04 and also supports
  72. the Zip64 extensions of PKZIP 4.5 which allow archives
  73. as well as files to exceed the previous 2 GB limit (4 GB in
  74. some cases). \fIzip\fP also now supports \fBbzip2\fP compression
  75. if the \fBbzip2\fP library is included when \fIzip\fP is compiled.
  76. Note that PKUNZIP 1.10 cannot extract files produced by
  77. PKZIP 2.04 or
  78. \fIzip\ 3.0\fP. You must use PKUNZIP 2.04g or
  79. \fIunzip\ 5.0p1\fP (or later versions) to extract them.
  80. .PP
  81. See the \fBEXAMPLES\fP section at the bottom of this page
  82. for examples of some typical uses of \fIzip\fP.
  83. .PP
  84. \fBLarge\ Archives\ and\ Zip64.\fP
  85. .I zip
  86. automatically uses the Zip64 extensions when files larger than 4 GB are
  87. added to an archive, an archive containing Zip64 entries is updated
  88. (if the resulting archive still needs Zip64),
  89. the size of the archive will exceed 4 GB, or when the
  90. number of entries in the archive will exceed about 64K.
  91. Zip64 is also used for archives streamed from standard input as the size
  92. of such archives are not known in advance, but the option \fB\-fz\-\fP can
  93. be used to force \fIzip\fP to create PKZIP 2 compatible archives (as long
  94. as Zip64 extensions are not needed). You must use a PKZIP 4.5
  95. compatible unzip, such as \fIunzip\ 6.0\fP or later, to extract files
  96. using the Zip64 extensions.
  97. .PP
  98. In addition, streamed archives, entries encrypted with standard encryption,
  99. or split archives created with the pause option may not be compatible with
  100. PKZIP as data descriptors are used
  101. and PKZIP at the time of this writing does not support data descriptors
  102. (but recent changes in the PKWare published zip standard now include some
  103. support for the data descriptor format \fIzip\fP uses).
  104. .PP
  105. \fBMac OS X.\fP Though previous Mac versions had their own \fIzip\fP port,
  106. \fIzip\fP supports Mac OS X as part of the Unix port and most Unix features
  107. apply. References to "MacOS" below generally refer to MacOS versions older
  108. than OS X. Support for some Mac OS features in the Unix Mac OS X port, such
  109. as resource forks, is expected in the next \fIzip\fP release.
  110. .PP
  111. For a brief help on \fIzip\fP and \fIunzip\fP,
  112. run each without specifying any parameters on the command line.
  113. .SH "USE"
  114. .PP
  115. The program is useful for packaging a set of files for distribution;
  116. for archiving files;
  117. and for saving disk space by temporarily
  118. compressing unused files or directories.
  119. .LP
  120. The
  121. .I zip
  122. program puts one or more compressed files into a single
  123. .I zip
  124. archive,
  125. along with information about the files
  126. (name, path, date, time of last modification, protection,
  127. and check information to verify file integrity).
  128. An entire directory structure can be packed into a
  129. .I zip
  130. archive with a single command.
  131. Compression ratios of 2:1 to 3:1 are common for text files.
  132. .I zip
  133. has one compression method (deflation) and can also store files without
  134. compression. (If \fBbzip2\fP support is added, \fIzip\fP can also
  135. compress using \fBbzip2\fP compression, but such entries require a
  136. reasonably modern unzip to decompress. When \fBbzip2\fP compression
  137. is selected, it replaces deflation as the default method.)
  138. .I zip
  139. automatically chooses the better of the two (deflation or store or, if
  140. \fBbzip2\fP is selected, \fBbzip2\fP or store) for each file to be
  141. compressed.
  142. .LP
  143. \fBCommand\ format.\fP The basic command format is
  144. .IP
  145. \fBzip\fR options archive inpath inpath ...
  146. .LP
  147. where \fBarchive\fR is a new or existing \fIzip\fR archive
  148. and \fBinpath\fR is a directory or file path optionally including wildcards.
  149. When given the name of an existing
  150. .I zip
  151. archive,
  152. .I zip
  153. will replace identically named entries in the
  154. .I zip
  155. archive (matching the relative names as stored in
  156. the archive) or add entries for new names.
  157. For example,
  158. if
  159. .I foo.zip
  160. exists and contains
  161. .I foo/file1
  162. and
  163. .IR foo/file2 ,
  164. and the directory
  165. .I foo
  166. contains the files
  167. .I foo/file1
  168. and
  169. .IR foo/file3 ,
  170. then:
  171. .IP
  172. \fCzip -r foo.zip foo\fP
  173. .LP
  174. or more concisely
  175. .IP
  176. \fCzip -r foo foo\fP
  177. .LP
  178. will replace
  179. .I foo/file1
  180. in
  181. .I foo.zip
  182. and add
  183. .I foo/file3
  184. to
  185. .IR foo.zip .
  186. After this,
  187. .I foo.zip
  188. contains
  189. .IR foo/file1 ,
  190. .IR foo/file2 ,
  191. and
  192. .IR foo/file3 ,
  193. with
  194. .I foo/file2
  195. unchanged from before.
  196. .LP
  197. So if before the zip command is executed \fIfoo.zip\fP has:
  198. .IP
  199. \fC foo/file1 foo/file2
  200. .LP
  201. and directory foo has:
  202. .IP
  203. \fC file1 file3\fP
  204. .LP
  205. then \fIfoo.zip\fP will have:
  206. .IP
  207. \fC foo/file1 foo/file2 foo/file3\fP
  208. .LP
  209. where \fIfoo/file1\fP is replaced and
  210. \fIfoo/file3\fP is new.
  211. .LP
  212. \fB\-@\ file\ lists.\fP If a file list is specified as
  213. \fB\-@\fP
  214. [Not on MacOS],
  215. .I zip
  216. takes the list of input files from standard input instead of from
  217. the command line. For example,
  218. .IP
  219. \fCzip -@ foo\fP
  220. .LP
  221. will store the files listed one per line on stdin in \fIfoo.zip\fP.
  222. .LP
  223. Under Unix,
  224. this option can be used to powerful effect in conjunction with the
  225. \fIfind\fP\ (1)
  226. command.
  227. For example,
  228. to archive all the C source files in the current directory and
  229. its subdirectories:
  230. .IP
  231. \fCfind . -name "*.[ch]" -print | zip source -@\fP
  232. .LP
  233. (note that the pattern must be quoted to keep the shell from expanding it).
  234. .LP
  235. \fBStreaming\ input\ and\ output.\fP
  236. .I zip
  237. will also accept a single dash ("-") as the zip file name, in which case it
  238. will write the zip file to standard output, allowing the output to be piped
  239. to another program. For example:
  240. .IP
  241. \fCzip -r - . | dd of=/dev/nrst0 obs=16k\fP
  242. .LP
  243. would write the zip output directly to a tape with the specified block size
  244. for the purpose of backing up the current directory.
  245. .LP
  246. .I zip
  247. also accepts a single dash ("-") as the name of a file to be compressed, in
  248. which case it will read the file from standard input, allowing zip to take
  249. input from another program. For example:
  250. .IP
  251. \fCtar cf - . | zip backup -\fP
  252. .LP
  253. would compress the output of the tar command for the purpose of backing up
  254. the current directory. This generally produces better compression than
  255. the previous example using the -r option because
  256. .I zip
  257. can take advantage of redundancy between files. The backup can be restored
  258. using the command
  259. .IP
  260. \fCunzip -p backup | tar xf -\fP
  261. .LP
  262. When no zip file name is given and stdout is not a terminal,
  263. .I zip
  264. acts as a filter, compressing standard input to standard output.
  265. For example,
  266. .IP
  267. \fCtar cf - . | zip | dd of=/dev/nrst0 obs=16k\fP
  268. .LP
  269. is equivalent to
  270. .IP
  271. \fCtar cf - . | zip - - | dd of=/dev/nrst0 obs=16k\fP
  272. .LP
  273. .I zip
  274. archives created in this manner can be extracted with the program
  275. .I funzip
  276. which is provided in the
  277. .I unzip
  278. package, or by
  279. .I gunzip
  280. which is provided in the
  281. .I gzip
  282. package (but some
  283. .I gunzip
  284. may not support this if
  285. .I zip
  286. used the Zip64 extensions). For example:
  287. .IP
  288. \fPdd if=/dev/nrst0 ibs=16k | funzip | tar xvf -\fC
  289. .LP
  290. The stream can also be saved to a file and
  291. .I unzip
  292. used.
  293. .LP
  294. If Zip64 support for large files and archives is enabled and
  295. \fIzip\fR is used as a filter, \fIzip\fR creates a Zip64 archive
  296. that requires a PKZIP 4.5 or later compatible unzip to read it. This is
  297. to avoid amgibuities in the zip file structure as defined in the current
  298. zip standard (PKWARE AppNote) where the decision to use Zip64 needs to
  299. be made before data is written for the entry, but for a stream the size
  300. of the data is not known at that point. If the data is known to be smaller
  301. than 4 GB, the option \fB\-fz\-\fP can be used to prevent use of Zip64,
  302. but \fIzip\fP will exit with an error if Zip64 was in fact needed.
  303. \fIzip\ 3\fR and \fIunzip\ 6\fR and later can read archives with Zip64
  304. entries. Also, \fIzip\fP removes the Zip64 extensions if not needed
  305. when archive entries are copied (see the \fB\-U\fP (\fB\-\-copy\fP)
  306. option).
  307. .LP
  308. When directing the output to another file, note that all options should be
  309. before the redirection including \fB-x\fP. For example:
  310. .IP
  311. \fPzip archive "*.h" "*.c" -x donotinclude.h orthis.h > tofile\fC
  312. .LP
  313. \fBZip\ files.\fP When changing an existing
  314. .I zip
  315. archive,
  316. .I zip
  317. will write a temporary file with the new contents,
  318. and only replace the old one when the process of creating the new version
  319. has been completed without error.
  320. .LP
  321. If the name of the
  322. .I zip
  323. archive does not contain an extension, the extension
  324. \fB.zip\fP
  325. is added. If the name already contains an extension other than
  326. \fB.zip\fP,
  327. the existing extension is kept unchanged. However, split archives
  328. (archives split over multiple files) require the \fB.zip\fP extension
  329. on the last split.
  330. .PP
  331. \fBScanning\ and\ reading\ files.\fP
  332. When \fIzip\fP starts, it scans for files to process (if needed). If
  333. this scan takes longer than about 5 seconds, \fIzip\fP will display
  334. a "Scanning files" message and start displaying progress dots every 2 seconds
  335. or every so many entries processed, whichever takes longer. If there is more
  336. than 2 seconds between dots it could indicate that finding each file is taking
  337. time and could mean a slow network connection for example.
  338. (Actually the initial file scan is
  339. a two-step process where the directory scan is followed by a sort and these
  340. two steps are separated with a space in the dots. If updating an existing
  341. archive, a space also appears between the existing file scan and the new
  342. file scan.) The scanning files dots are not controlled by the \fB\-ds\fP
  343. dot size option, but the dots are turned off by the \fB\-q\fP quiet option. The
  344. \fB\-sf\fP show files option can be used to scan for files and get the list of
  345. files scanned without actually processing them.
  346. .LP
  347. If \fIzip\fR is not able to read a file, it
  348. issues a warning but
  349. continues. See the \fB\-MM\fP option below for more on how \fIzip\fP handles
  350. patterns that are not matched and files that are not readable.
  351. If some files were skipped, a
  352. warning is issued at the end of the zip operation noting how many files
  353. were read and how many skipped.
  354. .PP
  355. \fBCommand\ modes.\fP \fIzip\fP now supports two distinct types of command
  356. modes, \fBexternal\fP and \fBinternal\fP. The \fBexternal\fP modes
  357. (add, update, and freshen) read files from the file system (as well as from an
  358. existing archive) while the \fBinternal\fP modes (delete and copy) operate
  359. exclusively on entries in an existing archive.
  360. .LP
  361. .TP
  362. .BI add\ \ \ \ \ \
  363. Update existing entries and add new files. If the archive does not exist
  364. create it. This is the default mode.
  365. .TP
  366. .BI update\ \fP(\fB\-u\fP)
  367. Update existing entries if newer on the file system and add new files. If
  368. the archive does not exist issue warning then create a new archive.
  369. .TP
  370. .BI freshen\ \fP(\fB\-f\fP)
  371. Update existing entries of an archive if newer on the file system.
  372. Does not add new files to the archive.
  373. .TP
  374. .BI delete\ \fP(\fB\-d\fP)
  375. Select entries in an existing archive and delete them.
  376. .TP
  377. .BI copy\ \fP(\fB\-U\fP)
  378. Select entries in an existing archive and copy them to a new archive.
  379. This new mode is similar to \fBupdate\fP but command line patterns
  380. select entries in the existing archive rather than files from
  381. the file system and it uses the \fB\-\-out\fP option to write the
  382. resulting archive to a new file rather than update the existing
  383. archive, leaving the original archive unchanged.
  384. .LP
  385. The new File Sync option (\fB\-FS\fP) is also considered a new mode,
  386. though it is similar to \fBupdate\fP. This mode synchronizes the
  387. archive with the files on the OS, only replacing files in the
  388. archive if the file time or size of the OS file is different, adding
  389. new files, and deleting entries from the archive where there is
  390. no matching file. As this mode can delete entries from the archive,
  391. consider making a backup copy of the archive.
  392. Also see \fB\-DF\fP for creating difference archives.
  393. See each option description below for details and the \fBEXAMPLES\fP section
  394. below for examples.
  395. .PP
  396. \fBSplit\ archives.\fP \fIzip\fP version 3.0 and later can create split
  397. archives. A
  398. \fBsplit archive\fP is a standard zip archive split over multiple
  399. files. (Note that split archives are not just archives split in to
  400. pieces, as the offsets of entries are now based on the start of each
  401. split. Concatenating the pieces together will invalidate these offsets,
  402. but \fIunzip\fP can usually deal with it. \fIzip\fP will usually refuse
  403. to process such a spliced archive unless the \fB\-FF\fP fix option is
  404. used to fix the offsets.)
  405. .LP
  406. One use of split archives is storing a large archive on multiple
  407. removable media.
  408. For a split archive with 20 split files the files are typically named (replace
  409. ARCHIVE with the name of your archive) ARCHIVE.z01, ARCHIVE.z02, ..., ARCHIVE.z19,
  410. ARCHIVE.zip. Note that the last file is the \fB.zip\fP file. In contrast,
  411. \fBspanned archives\fP are the original multi-disk archive generally requiring
  412. floppy disks and using volume labels to store disk numbers. \fIzip\fP supports
  413. split archives but not spanned archives, though a procedure exists for converting
  414. split archives of the right size to spanned archives. The reverse is also true,
  415. where each file of a spanned archive can be copied in order to files with the
  416. above names to create a split archive.
  417. .LP
  418. Use \fB\-s\fP to set the split size and create a split archive. The size is
  419. given as a number followed optionally by one of k (kB), m (MB), g (GB), or t (TB)
  420. (the default is m). The \fB\-sp\fP option can be used to pause \fIzip\fP between
  421. splits to allow changing removable media, for example, but read the descriptions
  422. and warnings for both \fB\-s\fP and \fB\-sp\fP below.
  423. .LP
  424. Though \fIzip\fP does not update split archives, \fIzip\fP provides the new
  425. option \fB\-O\fP (\fB\-\-output\-file\fP or \fB\-\-out\fP) to allow split archives
  426. to be updated and saved in a new archive. For example,
  427. .IP
  428. \fCzip inarchive.zip foo.c bar.c \-\-out outarchive.zip\fP
  429. .LP
  430. reads archive \fBinarchive.zip\fP, even if split, adds the files \fBfoo.c\fP and
  431. \fBbar.c\fP, and writes the resulting archive to \fBoutarchive.zip\fP. If
  432. \fBinarchive.zip\fP is split then \fBoutarchive.zip\fP defaults to the same
  433. split size. Be aware that if \fBoutarchive.zip\fP and any split files that are
  434. created with it already exist, these are always overwritten as needed without
  435. warning. This may be changed in the future.
  436. .PP
  437. \fBUnicode.\fP Though the zip standard requires storing paths in an archive using
  438. a specific character set, in practice zips have stored paths in archives in whatever
  439. the local character set is. This creates problems when an archive is created or
  440. updated on a system using one character set and then extracted on another system
  441. using a different character set. When compiled with Unicode support enabled on
  442. platforms that support wide characters, \fIzip\fP now stores, in addition to the
  443. standard local path for backward compatibility, the UTF-8 translation of the path.
  444. This provides a common universal character set for storing paths that allows these
  445. paths to be fully extracted on other systems that support Unicode and to match as
  446. close as possible on systems that don't.
  447. On Win32 systems where paths are internally stored as Unicode but represented in
  448. the local character set, it's possible that some paths will be skipped during a
  449. local character set directory scan. \fIzip\fP with Unicode support now can read
  450. and store these paths. Note that Win 9x systems and FAT file systems don't fully
  451. support Unicode.
  452. Be aware that console windows on Win32 and Unix, for example, sometimes don't
  453. accurately show all characters due to how each operating system switches in
  454. character sets for display. However, directory navigation tools should show the
  455. correct paths if the needed fonts are loaded.
  456. .PP
  457. \fBCommand line format.\fP This version of
  458. .I zip
  459. has updated command line processing and support for long options.
  460. .PP
  461. Short options take the form
  462. .IP
  463. \fC-s[-][s[-]...][value][=value][\ value]\fP
  464. .LP
  465. where s is a one or two character short option. A short option
  466. that takes a value is last in an argument and anything after it is
  467. taken as the value. If the option can be negated and "-" immediately
  468. follows the option, the option is negated.
  469. Short options can also be given as separate arguments
  470. .IP
  471. \fC-s[-][value][=value][\ value]\ -s[-][value][=value][\ value]\ ...\fP
  472. .LP
  473. Short options in general take values either as part of the same
  474. argument or as the following argument. An optional = is also supported.
  475. So
  476. .IP
  477. \fC-ttmmddyyyy\fP
  478. .LP
  479. and
  480. .IP
  481. \fC-tt=mmddyyyy\fP
  482. .LP
  483. and
  484. .IP
  485. \fC-tt mmddyyyy\fP
  486. .LP
  487. all work. The \fB\-x\fP and \fB\-i\fP options accept lists of values
  488. and use a slightly different format described below. See the
  489. \fB\-x\fP and \fB\-i\fP options.
  490. .PP
  491. Long options take the form
  492. .IP
  493. \fC--longoption[-][=value][ value]\fP
  494. .LP
  495. where the option starts with --, has a multicharacter name, can
  496. include a trailing dash to negate the option (if the option
  497. supports it), and can have a value (option argument) specified by
  498. preceeding it with = (no spaces). Values can also follow the
  499. argument. So
  500. .IP
  501. \fC--before-date=mmddyyyy\fP
  502. .LP
  503. and
  504. .IP
  505. \fC--before-date mmddyyyy\fP
  506. .LP
  507. both work.
  508. Long option names can be shortened to the shortest unique
  509. abbreviation. See the option descriptions below for which
  510. support long options. To avoid confusion, avoid abbreviating
  511. a negatable option with an embedded dash ("-") at the dash
  512. if you plan to negate it (the parser would consider
  513. a trailing dash, such as for the option \fB\-\-some\-option\fP using
  514. \fB\-\-some\-\fP as the option, as part of the name rather
  515. than a negating dash). This may be changed to force the last
  516. dash in \fB\-\-some\-\fP to be negating in the future.
  517. .SH "OPTIONS"
  518. .TP
  519. .PD 0
  520. .BI \-a
  521. .TP
  522. .PD
  523. .B \-\-ascii
  524. [Systems using EBCDIC] Translate file to ASCII format.
  525. .TP
  526. .PD 0
  527. .B \-A
  528. .TP
  529. .PD
  530. .B \-\-adjust-sfx
  531. Adjust self-extracting executable archive.
  532. A self-extracting executable archive is created by prepending
  533. the SFX stub to an existing archive. The
  534. .B \-A
  535. option tells
  536. .I zip
  537. to adjust the entry offsets stored
  538. in the archive to take into account this "preamble" data.
  539. .LP
  540. Note: self-extracting archives for the Amiga are a special case.
  541. At present, only the Amiga port of \fIzip\fP is capable of adjusting
  542. or updating these without corrupting them. -J can be used to remove
  543. the SFX stub if other updates need to be made.
  544. .TP
  545. .PD 0
  546. .B \-AC
  547. .TP
  548. .PD
  549. .B \-\-archive-clear
  550. [WIN32] Once archive is created (and tested if \fB\-T\fP is used,
  551. which is recommended), clear the archive bits of files processed. WARNING:
  552. Once the bits are cleared they are cleared. You may want to use the
  553. \fB\-sf\fP show files option to store the list of files processed in case
  554. the archive operation must be repeated. Also consider using
  555. the \fB\-MM\fP must match option. Be sure to check out \fB\-DF\fP as a
  556. possibly better way to do incremental backups.
  557. .TP
  558. .PD 0
  559. .B \-AS
  560. .TP
  561. .PD
  562. .B \-\-archive-set
  563. [WIN32] Only include files that have the archive bit set. Directories
  564. are not stored when \fB\-AS\fP is used, though by default the paths
  565. of entries, including directories, are stored as usual and can be used
  566. by most unzips to recreate directories.
  567. The archive bit is set by the operating system when a file is modified
  568. and, if used with \fB\-AC\fP, \fB\-AS\fP can provide an
  569. incremental backup capability. However, other applications can
  570. modify the archive bit and it may not be a reliable indicator of
  571. which files have changed since the last archive operation. Alternative
  572. ways to create incremental backups are using \fB\-t\fP to use file dates,
  573. though this won't catch old files copied to directories being archived,
  574. and \fB\-DF\fP to create a differential archive.
  575. .TP
  576. .PD 0
  577. .B \-B
  578. .TP
  579. .PD
  580. .B \-\-binary
  581. [VM/CMS and MVS] force file to be read binary (default is text).
  582. .TP
  583. .B \-B\fRn
  584. [TANDEM] set Edit/Enscribe formatting options with n defined as
  585. .RS
  586. bit 0: Don't add delimiter (Edit/Enscribe)
  587. .RE
  588. .RS
  589. bit 1: Use LF rather than CR/LF as delimiter (Edit/Enscribe)
  590. .RE
  591. .RS
  592. bit 2: Space fill record to maximum record length (Enscribe)
  593. .RE
  594. .RS
  595. bit 3: Trim trailing space (Enscribe)
  596. .RE
  597. .RS
  598. bit 8: Force 30K (Expand) large read for unstructured files
  599. .RE
  600. .TP
  601. .PD 0
  602. .BI \-b\ \fRpath
  603. .TP
  604. .PD
  605. .B \-\-temp-path\ \fRpath
  606. Use the specified
  607. .I path
  608. for the temporary
  609. .I zip
  610. archive. For example:
  611. .RS
  612. .IP
  613. \fCzip -b /tmp stuff *\fP
  614. .RE
  615. .IP
  616. will put the temporary
  617. .I zip
  618. archive in the directory
  619. .IR /tmp ,
  620. copying over
  621. .I stuff.zip
  622. to the current directory when done. This option is useful when
  623. updating an existing archive and the file system containing this
  624. old archive does not have enough space to hold both old and new archives
  625. at the same time. It may also be useful when streaming in some
  626. cases to avoid the need for data descriptors. Note that using
  627. this option may require \fIzip\fP take additional time to copy
  628. the archive file when done to the destination file system.
  629. .TP
  630. .PD 0
  631. .B \-c
  632. .TP
  633. .PD
  634. .B \-\-entry-comments
  635. Add one-line comments for each file.
  636. File operations (adding, updating) are done first,
  637. and the user is then prompted for a one-line comment for each file.
  638. Enter the comment followed by return, or just return for no comment.
  639. .TP
  640. .PD 0
  641. .B \-C
  642. .TP
  643. .PD
  644. .B \-\-preserve-case
  645. [VMS] Preserve case all on VMS. Negating this option
  646. (\fB\-C-\fP) downcases.
  647. .TP
  648. .PD 0
  649. .B \-C2
  650. .TP
  651. .PD
  652. .BI \-\-preserve-case-2
  653. [VMS] Preserve case ODS2 on VMS. Negating this option
  654. (\fB\-C2-\fP) downcases.
  655. .TP
  656. .PD 0
  657. .B \-C5
  658. .TP
  659. .PD
  660. .B \-\-preserve-case-5
  661. [VMS] Preserve case ODS5 on VMS. Negating this option
  662. (\fB\-C5-\fP) downcases.
  663. .TP
  664. .PD 0
  665. .B \-d
  666. .TP
  667. .PD
  668. .B \-\-delete
  669. Remove (delete) entries from a
  670. .I zip
  671. archive.
  672. For example:
  673. .RS
  674. .IP
  675. \fCzip -d foo foo/tom/junk foo/harry/\\* \\*.o\fP
  676. .RE
  677. .IP
  678. will remove the entry
  679. .IR foo/tom/junk ,
  680. all of the files that start with
  681. .IR foo/harry/ ,
  682. and all of the files that end with
  683. .B \&.o
  684. (in any path).
  685. Note that shell pathname expansion has been inhibited with backslashes,
  686. so that
  687. .I zip
  688. can see the asterisks,
  689. enabling
  690. .I zip
  691. to match on the contents of the
  692. .I zip
  693. archive instead of the contents of the current directory.
  694. (The backslashes are not used on MSDOS-based platforms.)
  695. Can also use quotes to escape the asterisks as in
  696. .RS
  697. .IP
  698. \fCzip -d foo foo/tom/junk "foo/harry/*" "*.o"\fP
  699. .RE
  700. .IP
  701. Not escaping the asterisks on a system where the shell expands
  702. wildcards could result in the asterisks being converted to a
  703. list of files in the current directory and that list used to
  704. delete entries from the archive.
  705. .IP
  706. Under MSDOS,
  707. .B \-d
  708. is case sensitive when it matches names in the
  709. .I zip
  710. archive.
  711. This requires that file names be entered in upper case if they were
  712. zipped by PKZIP on an MSDOS system. (We considered making this
  713. case insensitive on systems where paths were case insensitive,
  714. but it is possible the archive came from a system where case does
  715. matter and the archive could include both \fBBar\fP and \fBbar\fP
  716. as separate files in the archive.) But see the new option \fB\-ic\fP
  717. to ignore case in the archive.
  718. .TP
  719. .PD 0
  720. .B \-db
  721. .TP
  722. .PD
  723. .B \-\-display-bytes
  724. Display running byte counts showing the bytes zipped and the bytes to go.
  725. .TP
  726. .PD 0
  727. .B \-dc
  728. .TP
  729. .PD
  730. .B \-\-display-counts
  731. Display running count of entries zipped and entries to go.
  732. .TP
  733. .PD 0
  734. .B \-dd
  735. .TP
  736. .PD
  737. .B \-\-display-dots
  738. Display dots while each entry is zipped (except on ports that have their own
  739. progress indicator). See \fB-ds\fR below for setting dot size. The default is
  740. a dot every 10 MB of input file processed. The \fB-v\fR option
  741. also displays dots (previously at a much higher rate than this but now \fB\-v\fP
  742. also defaults to 10 MB) and this rate is also controlled by \fB-ds\fR.
  743. .TP
  744. .PD 0
  745. .B \-df
  746. .TP
  747. .PD
  748. .B \-\-datafork
  749. [MacOS] Include only data-fork of files zipped into the archive.
  750. Good for exporting files to foreign operating-systems.
  751. Resource-forks will be ignored at all.
  752. .TP
  753. .PD 0
  754. .B \-dg
  755. .TP
  756. .PD
  757. .B \-\-display-globaldots
  758. Display progress dots for the archive instead of for each file. The command
  759. .RS
  760. .IP
  761. zip -qdgds 10m
  762. .RE
  763. .IP
  764. will turn off most output except dots every 10 MB.
  765. .TP
  766. .PD 0
  767. .B \-ds\ \fRsize
  768. .TP
  769. .PD
  770. .B \-\-dot-size\ \fRsize
  771. Set amount of input file processed for each dot displayed. See \fB-dd\fR to
  772. enable displaying dots. Setting this option implies \fB-dd\fR. Size is
  773. in the format nm where n is a number and m is a multiplier. Currently m can
  774. be k (KB), m (MB), g (GB), or t (TB), so if n is 100 and m is k, size would be
  775. 100k which is 100 KB. The default is 10 MB.
  776. .IP
  777. The \fB-v\fR option also displays dots and now defaults to
  778. 10 MB also. This rate is also controlled by this option. A size of 0 turns dots off.
  779. .IP
  780. This option does not control the dots from the "Scanning files" message as
  781. \fIzip\fP scans for input files. The dot size for that is fixed at 2 seconds
  782. or a fixed number of entries, whichever is longer.
  783. .TP
  784. .PD 0
  785. .B \-du
  786. .TP
  787. .PD
  788. .B \-\-display-usize
  789. Display the uncompressed size of each entry.
  790. .TP
  791. .PD 0
  792. .B \-dv
  793. .TP
  794. .PD
  795. .B \-\-display-volume
  796. Display the volume (disk) number each entry is being read from,
  797. if reading an existing archive, and being written to.
  798. .TP
  799. .PD 0
  800. .B \-D
  801. .TP
  802. .PD
  803. .B \-\-no-dir-entries
  804. Do not create entries in the
  805. .I zip
  806. archive for directories. Directory entries are created by default so that
  807. their attributes can be saved in the zip archive.
  808. The environment variable ZIPOPT can be used to change the default options. For
  809. example under Unix with sh:
  810. .RS
  811. .IP
  812. ZIPOPT="-D"; export ZIPOPT
  813. .RE
  814. .IP
  815. (The variable ZIPOPT can be used for any option, including \fB\-i\fP and \fB\-x\fP
  816. using a new option format detailed below, and can include several options.) The option
  817. .B \-D
  818. is a shorthand
  819. for
  820. .B \-x
  821. "*/" but the latter previously could not be set as default in the ZIPOPT
  822. environment variable as the contents of ZIPOPT gets inserted near the beginning
  823. of the command line and the file list had to end at the end of the line.
  824. .IP
  825. This version of
  826. .I zip
  827. does allow
  828. .B \-x
  829. and
  830. .B \-i
  831. options in ZIPOPT if the form
  832. .IP
  833. \fC
  834. .BR \-x \ file\ file\ ... \ @\fP
  835. .IP
  836. is used, where the @ (an argument that is just @) terminates
  837. the list.
  838. .TP
  839. .PD 0
  840. .B \-DF
  841. .TP
  842. .PD
  843. .B \-\-difference-archive
  844. Create an archive that contains all new and changed files since
  845. the original archive was created. For this to work, the input
  846. file list and current directory must be the same as during the
  847. original \fIzip\fP operation.
  848. .IP
  849. For example, if the existing archive was created using
  850. .RS
  851. .IP
  852. \fCzip -r foofull .
  853. .RE
  854. .IP
  855. from the \fIbar\fP directory, then the command
  856. .RS
  857. .IP
  858. \fCzip -r foofull . -DF --out foonew
  859. .RE
  860. .IP
  861. also from the \fIbar\fP directory creates the archive \fIfoonew\fP
  862. with just the files not in \fIfoofull\fP and the files where
  863. the size or file time of the files do not match those in \fIfoofull\fP.
  864. Note that the timezone environment variable TZ should be set according to
  865. the local timezone in order for this option to work correctly. A
  866. change in timezone since the original archive was created could
  867. result in no times matching and all files being included.
  868. A possible approach to backing up a directory might be to create
  869. a normal archive of the contents of the directory as a full
  870. backup, then use this option to create incremental backups.
  871. .TP
  872. .PD 0
  873. .B \-e
  874. .TP
  875. .PD
  876. .B \-\-encrypt
  877. Encrypt the contents of the
  878. .I zip
  879. archive using a password which is entered on the terminal in response
  880. to a prompt
  881. (this will not be echoed; if standard error is not a tty,
  882. .I zip
  883. will exit with an error).
  884. The password prompt is repeated to save the user from typing errors.
  885. .TP
  886. .PD 0
  887. .B \-E
  888. .TP
  889. .PD
  890. .B \-\-longnames
  891. [OS/2] Use the .LONGNAME Extended Attribute (if found) as filename.
  892. .TP
  893. .PD 0
  894. .B \-f
  895. .TP
  896. .PD
  897. .B \-\-freshen
  898. Replace (freshen) an existing entry in the
  899. .I zip
  900. archive only if it has been modified more recently than the
  901. version already in the
  902. .I zip
  903. archive;
  904. unlike the update option
  905. .RB ( \-u )
  906. this will not add files that are not already in the
  907. .I zip
  908. archive.
  909. For example:
  910. .RS
  911. .IP
  912. \fCzip -f foo\fP
  913. .RE
  914. .IP
  915. This command should be run from the same directory from which the original
  916. .I zip
  917. command was run, since paths stored in
  918. .I zip
  919. archives are always relative.
  920. .IP
  921. Note that the timezone environment variable TZ should be set according to
  922. the local timezone in order for the
  923. \fB\-f\fP, \fB\-u\fP and \fB\-o\fP
  924. options to work correctly.
  925. .IP
  926. The reasons behind this are somewhat subtle but have to do with the differences
  927. between the Unix-format file times (always in GMT) and most of the other
  928. operating systems (always local time) and the necessity to compare the two.
  929. A typical TZ value is ``MET-1MEST'' (Middle European time with automatic
  930. adjustment for ``summertime'' or Daylight Savings Time).
  931. .IP
  932. The format is TTThhDDD, where TTT is the time zone such as MET, hh is the
  933. difference between GMT and local time such as -1 above, and DDD is
  934. the time zone when daylight savings time is in effect. Leave off
  935. the DDD if there is no daylight savings time. For the US Eastern
  936. time zone EST5EDT.
  937. .TP
  938. .PD 0
  939. .B \-F
  940. .TP
  941. .B \-\-fix\ \ \ \ \ \
  942. .TP
  943. .B \-FF
  944. .TP
  945. .PD
  946. .B \-\-fixfix\ \
  947. Fix the
  948. .I zip
  949. archive. The \fB\-F\fP option can be used if some portions of the archive
  950. are missing, but requires a reasonably intact central directory.
  951. The input archive is scanned as usual, but \fIzip\fP will ignore
  952. some problems. The resulting archive should be valid, but any
  953. inconsistent entries will be left out.
  954. .IP
  955. When doubled as in
  956. \fB\-FF\fP,
  957. the archive is scanned from the beginning and \fIzip\fP scans for special
  958. signatures to identify the limits between the archive members. The
  959. single
  960. .B \-F
  961. is more reliable if the archive is not too much damaged, so try this
  962. option first.
  963. .IP
  964. If the archive is too damaged or the end has been truncated, you
  965. must use \fB\-FF\fP. This is a change from \fIzip\ 2.32\fP, where
  966. the \fB\-F\fP option is able to read a truncated archive. The
  967. \fB\-F\fP option now more reliably fixes archives with minor
  968. damage and the \fB\-FF\fP option is needed to fix archives where
  969. \fB\-F\fP might have been sufficient before.
  970. .IP
  971. Neither option will recover archives that have been incorrectly
  972. transferred in ascii mode instead of binary. After the repair, the
  973. .B \-t
  974. option of
  975. .I unzip
  976. may show that some files have a bad CRC. Such files cannot be recovered;
  977. you can remove them from the archive using the
  978. .B \-d
  979. option of
  980. \fIzip\fP.
  981. .IP
  982. Note that \fB\-FF\fP may have trouble fixing archives that include an
  983. embedded zip archive that was stored (without compression) in the archive
  984. and, depending on the damage, it may find the entries in the embedded
  985. archive rather than the archive itself. Try \fB\-F\fP first as it
  986. does not have this problem.
  987. .IP
  988. The format of the fix commands have changed. For example, to fix
  989. the damaged archive \fIfoo.zip\fP,
  990. .RS
  991. .IP
  992. \fCzip -F foo --out foofix
  993. .RE
  994. .IP
  995. tries to read the entries normally, copying good entries to the
  996. new archive \fIfoofix.zip\fP. If this doesn't work, as when the
  997. archive is truncated, or if some entries you know are in the archive
  998. are missed, then try
  999. .RS
  1000. .IP
  1001. \fCzip -FF foo --out foofixfix
  1002. .RE
  1003. .IP
  1004. and compare the resulting archive to the archive created by \fB\-F\fP. The
  1005. \fB\-FF\fP option may create an inconsistent archive. Depending on
  1006. what is damaged, you can then use the \fB\-F\fP option to fix that archive.
  1007. .IP
  1008. A split archive with missing split files can be fixed using
  1009. \fB\-F\fP if you have the last split of the archive (the \fB\.zip\fP file).
  1010. If this file is missing, you must use \fB\-FF\fP to fix the archive,
  1011. which will prompt you for the splits you have.
  1012. .IP
  1013. Currently the fix options can't recover entries that have a bad checksum
  1014. or are otherwise damaged.
  1015. .TP
  1016. .PD 0
  1017. .B \-FI
  1018. .TP
  1019. .PD
  1020. .B \-\-fifo
  1021. [Unix] Normally \fIzip\fP skips reading any FIFOs (named pipes) encountered, as
  1022. \fIzip\fP can hang if the FIFO is not being fed. This option tells \fIzip\fP to
  1023. read the contents of any FIFO it finds.
  1024. .TP
  1025. .PD 0
  1026. .B \-FS
  1027. .TP
  1028. .PD
  1029. .B \-\-filesync
  1030. Synchronize the contents of an archive with the files on the OS.
  1031. Normally when an archive is updated, new files are added and changed
  1032. files are updated but files that no longer exist on the OS are not
  1033. deleted from the archive. This option enables a new mode that checks
  1034. entries in the archive against the file system. If the file time and
  1035. file size of the entry matches that of the OS file, the entry is
  1036. copied from the old archive instead of being read from the file system
  1037. and compressed. If the OS file has changed, the entry is read and
  1038. compressed as usual. If the entry in the archive does not match a
  1039. file on the OS, the entry is deleted. Enabling this option should
  1040. create archives that are the same as new archives, but since existing
  1041. entries are copied instead of compressed, updating an existing archive
  1042. with \fB\-FS\fP can be much faster than creating a new archive. Also
  1043. consider using \fB\-u\fP for updating an archive.
  1044. .IP
  1045. For this option to work, the archive should be updated from the same
  1046. directory it was created in so the relative paths match. If few files
  1047. are being copied from the old archive, it may be faster to create a
  1048. new archive instead.
  1049. .IP
  1050. Note that the timezone environment variable TZ should be set according to
  1051. the local timezone in order for this option to work correctly. A
  1052. change in timezone since the original archive was created could
  1053. result in no times matching and recompression of all files.
  1054. .IP
  1055. This option deletes files from the archive. If you need to preserve
  1056. the original archive, make a copy of the archive first or use the
  1057. \fB\-\-out\fP option to output the updated archive to a new file.
  1058. Even though it may be slower, creating a new archive with a new archive
  1059. name is safer, avoids mismatches between archive and OS paths, and
  1060. is preferred.
  1061. .TP
  1062. .PD 0
  1063. .B \-g
  1064. .TP
  1065. .PD
  1066. .B \-\-grow \ \ \ \ \ \
  1067. Grow (append to) the specified
  1068. .I zip
  1069. archive, instead of creating a new one. If this operation fails,
  1070. .I zip
  1071. attempts to restore the archive to its original state. If the restoration
  1072. fails, the archive might become corrupted. This option is ignored when
  1073. there's no existing archive or when at least one archive member must be
  1074. updated or deleted.
  1075. .TP
  1076. .PD 0
  1077. .B \-h
  1078. .TP
  1079. .PD 0
  1080. .B \-?
  1081. .TP
  1082. .PD
  1083. .B \-\-help \ \ \ \ \ \
  1084. Display the
  1085. .I zip
  1086. help information (this also appears if
  1087. .I zip
  1088. is run with no arguments).
  1089. .TP
  1090. .PD 0
  1091. .B \-h2
  1092. .TP
  1093. .PD
  1094. .B \-\-more-help
  1095. Display extended help including more on command line format, pattern matching, and
  1096. more obscure options.
  1097. .TP
  1098. .PD 0
  1099. .B \-i\ \fRfiles
  1100. .TP
  1101. .PD
  1102. .B \-\-include\ \fRfiles
  1103. Include only the specified files, as in:
  1104. .RS
  1105. .IP
  1106. \fCzip -r foo . -i \\*.c\fP
  1107. .RE
  1108. .IP
  1109. which will include only the files that end in
  1110. .IR \& .c
  1111. in the current directory and its subdirectories. (Note for PKZIP
  1112. users: the equivalent command is
  1113. .RS
  1114. .IP
  1115. \fCpkzip -rP foo *.c\fP
  1116. .RE
  1117. .IP
  1118. PKZIP does not allow recursion in directories other than the current one.)
  1119. The backslash avoids the shell filename substitution, so that the
  1120. name matching is performed by
  1121. .I zip
  1122. at all directory levels.
  1123. [This is for Unix and other systems where \\ escapes the
  1124. next character. For other systems where the shell does not
  1125. process * do not use \\ and the above is
  1126. .RS
  1127. .IP
  1128. \fCzip -r foo . -i *.c\fP
  1129. .RE
  1130. .IP
  1131. Examples are for Unix unless otherwise specified.] So to include dir,
  1132. a directory directly under the current directory, use
  1133. .RS
  1134. .IP
  1135. \fCzip -r foo . -i dir/\\*
  1136. .RE
  1137. .IP
  1138. or
  1139. .RS
  1140. .IP
  1141. \fCzip -r foo . -i "dir/*"
  1142. .RE
  1143. .IP
  1144. to match paths such as dir/a and dir/b/file.c [on
  1145. ports without wildcard expansion in the shell such as MSDOS and Windows
  1146. .RS
  1147. .IP
  1148. \fCzip -r foo . -i dir/*
  1149. .RE
  1150. .IP
  1151. is used.] Note that currently the trailing / is needed
  1152. for directories (as in
  1153. .RS
  1154. .IP
  1155. \fCzip -r foo . -i dir/
  1156. .RE
  1157. .IP
  1158. to include directory dir).
  1159. .IP
  1160. The long option form of the first example is
  1161. .RS
  1162. .IP
  1163. \fCzip -r foo . --include \\*.c
  1164. .RE
  1165. .IP
  1166. and does the same thing as the short option form.
  1167. .IP
  1168. Though the command syntax used to require \fB-i\fR at
  1169. the end of the command line, this version actually
  1170. allows \fB\-i\fP (or \fB\-\-include\fP) anywhere. The
  1171. list of files terminates at the next argument starting
  1172. with \fB-\fR, the end of the command line, or the list
  1173. terminator \fB@\fR (an argument that is just @). So
  1174. the above can be given as
  1175. .RS
  1176. .IP
  1177. zip -i \\*.c @ -r foo .\fP
  1178. .RE
  1179. .IP
  1180. for example. There must be a space between
  1181. the option and the first file of a list. For just
  1182. one file you can use the single value form
  1183. .RS
  1184. .IP
  1185. \fCzip -i\\*.c -r foo .\fP
  1186. .RE
  1187. .IP
  1188. (no space between option and value) or
  1189. .RS
  1190. .IP
  1191. \fCzip --include=\\*.c -r foo .\fP
  1192. .RE
  1193. .IP
  1194. as additional examples. The single value forms are
  1195. not recommended because they can be confusing and,
  1196. in particular, the \fB\-ifile\fP format can cause
  1197. problems if the first letter of \fBfile\fP combines with
  1198. \fBi\fP to form a two-letter option starting with
  1199. \fBi\fP. Use \fB\-sc\fP to see how your command line
  1200. will be parsed.
  1201. .IP
  1202. Also possible:
  1203. .RS
  1204. .IP
  1205. \fCzip -r foo . -i@include.lst\fP
  1206. .RE
  1207. .IP
  1208. which will only include the files in the current directory and its
  1209. subdirectories that match the patterns in the file include.lst.
  1210. .IP
  1211. Files to \fB\-i\fR and \fB\-x\fR are patterns matching internal archive paths. See
  1212. \fB-R\fR for more on patterns.
  1213. .TP
  1214. .PD 0
  1215. .B \-I
  1216. .TP
  1217. .PD
  1218. .B \-\-no-image
  1219. [Acorn RISC OS] Don't scan through Image files. When used, \fIzip\fP will not
  1220. consider Image files (eg. DOS partitions or Spark archives when SparkFS
  1221. is loaded) as directories but will store them as single files.
  1222. For example, if you have SparkFS loaded, zipping a Spark archive will result
  1223. in a zipfile containing a directory (and its content) while using the 'I'
  1224. option will result in a zipfile containing a Spark archive. Obviously this
  1225. second case will also be obtained (without the 'I' option) if SparkFS isn't
  1226. loaded.
  1227. .TP
  1228. .PD 0
  1229. .B \-ic
  1230. .TP
  1231. .PD
  1232. .B \-\-ignore-case
  1233. [VMS, WIN32] Ignore case when matching archive entries. This option is
  1234. only available on systems where the case of files is ignored. On systems
  1235. with case-insensitive file systems, case is normally ignored when matching files
  1236. on the file system but is not ignored for -f (freshen), -d (delete), -U (copy),
  1237. and similar modes when matching against archive entries (currently -f
  1238. ignores case on VMS) because archive entries can be from systems where
  1239. case does matter and names that are the same except for case can exist
  1240. in an archive. The \fB\-ic\fR option makes all matching case insensitive.
  1241. This can result in multiple archive entries matching a command line pattern.
  1242. .TP
  1243. .PD 0
  1244. .B \-j
  1245. .TP
  1246. .PD
  1247. .B \-\-junk-paths
  1248. Store just the name of a saved file (junk the path), and do not store
  1249. directory names. By default,
  1250. .I zip
  1251. will store the full path (relative to the current directory).
  1252. .TP
  1253. .PD 0
  1254. .B \-jj
  1255. .TP
  1256. .PD
  1257. .B \-\-absolute-path
  1258. [MacOS] record Fullpath (+ Volname). The complete path including
  1259. volume will be stored. By default the relative path will be stored.
  1260. .TP
  1261. .PD 0
  1262. .B \-J
  1263. .TP
  1264. .PD
  1265. .B \-\-junk-sfx
  1266. Strip any prepended data (e.g. a SFX stub) from the archive.
  1267. .TP
  1268. .PD 0
  1269. .B \-k
  1270. .TP
  1271. .PD
  1272. .B \-\-DOS-names
  1273. Attempt to convert the names and paths to conform to MSDOS,
  1274. store only the MSDOS attribute (just the user write attribute from Unix),
  1275. and mark the entry as made under MSDOS (even though it was not);
  1276. for compatibility with PKUNZIP under MSDOS which cannot handle certain
  1277. names such as those with two dots.
  1278. .TP
  1279. .PD 0
  1280. .B \-l
  1281. .TP
  1282. .PD
  1283. .B \-\-to-crlf
  1284. Translate the Unix end-of-line character LF into the
  1285. MSDOS convention CR LF. This option should not be used on binary files.
  1286. This option can be used on Unix if the zip file is intended for PKUNZIP
  1287. under MSDOS. If the input files already contain CR LF, this option adds
  1288. an extra CR. This is to ensure that
  1289. \fBunzip -a\fP
  1290. on Unix will get back an exact copy of the original file,
  1291. to undo the effect of
  1292. \fBzip -l\fP. See \fB-ll\fR for how binary files are handled.
  1293. .TP
  1294. .PD 0
  1295. .B \-la
  1296. .TP
  1297. .PD
  1298. .B \-\-log-append
  1299. Append to existing logfile. Default is to overwrite.
  1300. .TP
  1301. .PD 0
  1302. .B \-lf\ \fPlogfilepath
  1303. .TP
  1304. .PD
  1305. .B \-\-logfile-path\ \fPlogfilepath
  1306. Open a logfile at the given path. By default any existing file at that location
  1307. is overwritten, but the \fB\-la\fP option will result in an existing file being
  1308. opened and the new log information appended to any existing information.
  1309. Only warnings and errors are written to the log unless the \fB\-li\fP option is
  1310. also given, then all information messages are also written to the log.
  1311. .TP
  1312. .PD 0
  1313. .B \-li
  1314. .TP
  1315. .PD
  1316. .B \-\-log-info
  1317. Include information messages, such as file names being zipped, in the log.
  1318. The default is to only include the command line, any warnings and errors, and
  1319. the final status.
  1320. .TP
  1321. .PD 0
  1322. .B \-ll
  1323. .TP
  1324. .PD
  1325. .B \-\-from-crlf
  1326. Translate the MSDOS end-of-line CR LF into Unix LF.
  1327. This option should not be used on binary files.
  1328. This option can be used on MSDOS if the zip file is intended for unzip
  1329. under Unix. If the file is converted and the file is later determined
  1330. to be binary a warning is issued and the file is probably
  1331. corrupted. In this release if \fB-ll\fR detects binary in the first buffer
  1332. read from a file, \fIzip\fR now issues a warning and skips line end
  1333. conversion on the file. This check seems to catch all binary files
  1334. tested, but the original check remains and if a converted file is
  1335. later determined to be binary that warning is still issued. A new algorithm
  1336. is now being used for binary detection that should allow line end conversion
  1337. of text files in \fBUTF-8\fR and similar encodings.
  1338. .TP
  1339. .PD 0
  1340. .B \-L
  1341. .TP
  1342. .PD
  1343. .B \-\-license
  1344. Display the
  1345. .I zip
  1346. license.
  1347. .TP
  1348. .PD 0
  1349. .B \-m
  1350. .TP
  1351. .PD
  1352. .B \-\-move \ \ \
  1353. Move the specified files into the
  1354. .I zip
  1355. archive; actually,
  1356. this deletes the target directories/files after making the specified
  1357. .I zip
  1358. archive. If a directory becomes empty after removal of the files, the
  1359. directory is also removed. No deletions are done until
  1360. .I zip
  1361. has created the archive without error.
  1362. This is useful for conserving disk space,
  1363. but is potentially dangerous so it is recommended to use it in
  1364. combination with
  1365. .B \-T
  1366. to test the archive before removing all input files.
  1367. .TP
  1368. .PD 0
  1369. .B \-MM
  1370. .TP
  1371. .PD
  1372. .B \-\-must-match
  1373. All input patterns must match at least one file and all input files
  1374. found must be readable. Normally when an input pattern does not match
  1375. a file the "name not matched" warning is issued and when an input file
  1376. has been found but later is missing or not readable a missing or not
  1377. readable warning is issued. In either case
  1378. .I zip
  1379. continues creating the archive, with missing or unreadable new files
  1380. being skipped and files already in the archive remaining unchanged.
  1381. After the archive is created, if any files were not readable
  1382. .I zip
  1383. returns the OPEN error code (18 on most systems) instead of the normal
  1384. success return (0 on most systems). With \fB\-MM\fP set,
  1385. .I zip
  1386. exits as soon as an input pattern is not matched (whenever the
  1387. "name not matched" warning would be issued) or when an input file is
  1388. not readable. In either case \fIzip\fR exits with an OPEN error
  1389. and no archive is created.
  1390. .IP
  1391. This option is useful when a known list of files is to be zipped so
  1392. any missing or unreadable files will result in an error. It is less
  1393. useful when used with wildcards, but \fIzip\fR will still exit with an
  1394. error if any input pattern doesn't match at least one file and if any
  1395. matched files are unreadable. If you want to create the archive
  1396. anyway and only need to know if files were skipped, don't use
  1397. .B \-MM
  1398. and just check the return code. Also \fB\-lf\fP could be useful.
  1399. .TP
  1400. .PD 0
  1401. .BI \-n\ \fRsuffixes
  1402. .TP
  1403. .PD
  1404. .B \-\-suffixes\ \fRsuffixes
  1405. Do not attempt to compress files named with the given
  1406. \fBsuffixes\fR.
  1407. Such files are simply stored (0% compression) in the output zip file,
  1408. so that
  1409. .I zip
  1410. doesn't waste its time trying to compress them.
  1411. The suffixes are separated by
  1412. either colons or semicolons. For example:
  1413. .RS
  1414. .IP
  1415. \fCzip -rn .Z:.zip:.tiff:.gif:.snd foo foo\fP
  1416. .RE
  1417. .IP
  1418. will copy everything from
  1419. .I foo
  1420. into
  1421. .IR foo.zip ,
  1422. but will store any files that end in
  1423. .IR .Z ,
  1424. .IR .zip ,
  1425. .IR .tiff ,
  1426. .IR .gif ,
  1427. or
  1428. .I .snd
  1429. without trying to compress them
  1430. (image and sound files often have their own specialized compression methods).
  1431. By default,
  1432. .I zip
  1433. does not compress files with extensions in the list
  1434. .I .Z:.zip:.zoo:.arc:.lzh:.arj.
  1435. Such files are stored directly in the output archive.
  1436. The environment variable ZIPOPT can be used to change the default options. For
  1437. example under Unix with csh:
  1438. .RS
  1439. .IP
  1440. setenv ZIPOPT "-n .gif:.zip"
  1441. .RE
  1442. .IP
  1443. To attempt compression on all files, use:
  1444. .RS
  1445. .IP
  1446. zip -n : foo
  1447. .RE
  1448. .IP
  1449. The maximum compression option
  1450. .B \-9
  1451. also attempts compression on all files regardless of extension.
  1452. .IP
  1453. On Acorn RISC OS systems the suffixes are actually filetypes (3 hex digit
  1454. format). By default, \fIzip\fP does not compress files with filetypes in the list
  1455. DDC:D96:68E (i.e. Archives, CFS files and PackDir files).
  1456. .TP
  1457. .PD 0
  1458. .B \-nw
  1459. .TP
  1460. .PD
  1461. .B \-\-no-wild
  1462. Do not perform internal wildcard processing (shell processing of wildcards is still done
  1463. by the shell unless the arguments are escaped). Useful if a list of paths is being
  1464. read and no wildcard substitution is desired.
  1465. .TP
  1466. .PD 0
  1467. .B \-N
  1468. .TP
  1469. .PD
  1470. .B \-\-notes
  1471. [Amiga, MacOS] Save Amiga or MacOS filenotes as zipfile comments. They can be
  1472. restored by using the -N option of \fIunzip\fP. If -c is used also, you are
  1473. prompted for comments only for those files that do not have filenotes.
  1474. .TP
  1475. .PD 0
  1476. .B \-o
  1477. .TP
  1478. .PD
  1479. .B \-\-latest-time
  1480. Set the "last modified" time of the
  1481. .I zip
  1482. archive to the latest (oldest) "last modified" time
  1483. found among the entries in the
  1484. .I zip
  1485. archive.
  1486. This can be used without any other operations, if desired.
  1487. For example:
  1488. .IP
  1489. \fCzip -o foo\fP
  1490. .IP
  1491. will change the last modified time of
  1492. \fBfoo.zip\fP
  1493. to the latest time of the entries in
  1494. .BR foo.zip .
  1495. .TP
  1496. .PD 0
  1497. .B \-O \fPoutput-file
  1498. .TP
  1499. .PD
  1500. .B \-\-output-file \fPoutput-file
  1501. Process the archive changes as usual, but instead of updating the existing archive,
  1502. output the new archive to output-file. Useful for updating an archive
  1503. without changing the existing archive and the input archive must be a different file
  1504. than the output archive.
  1505. This option can be used to create updated split archives.
  1506. It can also be used with \fB\-U\fP to copy entries from an existing archive to a new
  1507. archive. See the \fBEXAMPLES\fP section below.
  1508. Another use is converting \fIzip\fP files from one split size to another. For instance,
  1509. to convert an archive with 700 MB CD splits to one with 2 GB DVD splits, can use:
  1510. .RS
  1511. .IP
  1512. zip -s 2g cd-split.zip --out dvd-split.zip
  1513. .RE
  1514. .IP
  1515. which uses copy mode. See \fB\-U\fP below. Also:
  1516. .RS
  1517. .IP
  1518. zip -s 0 split.zip --out unsplit.zip
  1519. .RE
  1520. .IP
  1521. will convert a split archive to a single-file archive.
  1522. Copy mode will convert stream entries (using data descriptors and which
  1523. should be compatible with most unzips) to normal entries (which should
  1524. be compatible
  1525. with all unzips), except if standard encryption was used. For archives
  1526. with encrypted entries, \fIzipcloak\fP will decrypt the entries and convert
  1527. them to normal entries.
  1528. .TP
  1529. .PD 0
  1530. .B \-p
  1531. .TP
  1532. .PD
  1533. .B \-\-paths
  1534. Include relative file paths as part of the names of files stored in the archive.
  1535. This is the default. The \fB\-j\fP option junks the paths and just stores the
  1536. names of the files.
  1537. .TP
  1538. .PD 0
  1539. .B \-P\ \fRpassword
  1540. .TP
  1541. .PD
  1542. .B \-\-password\ \fRpassword
  1543. Use \fIpassword\fP to encrypt zipfile entries (if any). \fBTHIS IS
  1544. INSECURE!\fP Many multi-user operating systems provide ways for any user to
  1545. see the current command line of any other user; even on stand-alone systems
  1546. there is always the threat of over-the-shoulder peeking. Storing the plaintext
  1547. password as part of a command line in an automated script is even worse.
  1548. Whenever possible, use the non-echoing, interactive prompt to enter passwords.
  1549. (And where security is truly important, use strong encryption such as Pretty
  1550. Good Privacy instead of the relatively weak standard encryption provided by
  1551. zipfile utilities.)
  1552. .TP
  1553. .PD 0
  1554. .B \-q
  1555. .TP
  1556. .PD
  1557. .B \-\-quiet
  1558. Quiet mode;
  1559. eliminate informational messages and comment prompts.
  1560. (Useful, for example, in shell scripts and background tasks).
  1561. .TP
  1562. .PD 0
  1563. .BI \-Q\fRn
  1564. .TP
  1565. .PD
  1566. .B \-\-Q\-flag\ \fRn
  1567. [QDOS] store information about the file in the file header with n defined as
  1568. .RS
  1569. bit 0: Don't add headers for any file
  1570. .RE
  1571. .RS
  1572. bit 1: Add headers for all files
  1573. .RE
  1574. .RS
  1575. bit 2: Don't wait for interactive key press on exit
  1576. .RE
  1577. .TP
  1578. .PD 0
  1579. .B \-r
  1580. .TP
  1581. .PD
  1582. .B \-\-recurse\-paths
  1583. Travel the directory structure recursively;
  1584. for example:
  1585. .RS
  1586. .IP
  1587. zip -r foo.zip foo
  1588. .RE
  1589. .IP
  1590. or more concisely
  1591. .RS
  1592. .IP
  1593. zip -r foo foo
  1594. .RE
  1595. .IP
  1596. In this case, all the files and directories in
  1597. .B foo
  1598. are saved in a
  1599. .I zip
  1600. archive named \fBfoo.zip\fP,
  1601. including files with names starting with \fB"."\fP,
  1602. since the recursion does not use the shell's file-name substitution mechanism.
  1603. If you wish to include only a specific subset of the files in directory
  1604. \fBfoo\fP
  1605. and its subdirectories, use the
  1606. \fB\-i\fP
  1607. option to specify the pattern of files to be included.
  1608. You should not use
  1609. \fB\-r\fP
  1610. with the name \fB".*"\fP,
  1611. since that matches \fB".."\fP
  1612. which will attempt to zip up the parent directory
  1613. (probably not what was intended).
  1614. .IP
  1615. Multiple source directories are allowed as in
  1616. .RS
  1617. .IP
  1618. \fCzip -r foo foo1 foo2\fP
  1619. .RE
  1620. .IP
  1621. which first zips up \fBfoo1\fP and then \fBfoo2\fP, going down each directory.
  1622. .IP
  1623. Note that while wildcards to \fB-r\fR are typically resolved while recursing down
  1624. directories in the file system, any \fB-R\fN, \fB-x\fR, and \fB-i\fR wildcards
  1625. are applied to internal archive pathnames once the directories are scanned.
  1626. To have wildcards apply to files in subdirectories when recursing on
  1627. Unix and similar systems where the shell does wildcard substitution, either
  1628. escape all wildcards or put all arguments with wildcards in quotes. This lets
  1629. \fIzip\fR see the wildcards and match files in subdirectories using them as
  1630. it recurses.
  1631. .TP
  1632. .PD 0
  1633. .B \-R
  1634. .TP
  1635. .PD
  1636. .B \-\-recurse\-patterns
  1637. Travel the directory structure recursively starting at the
  1638. current directory;
  1639. for example:
  1640. .RS
  1641. .IP
  1642. \fCzip -R foo "*.c"\fP
  1643. .RE
  1644. .IP
  1645. In this case, all the files matching \fB*.c\fP in the tree starting at the
  1646. current directory are stored into a
  1647. .I zip
  1648. archive named
  1649. \fBfoo.zip\fP.
  1650. Note that \fB*.c\fP will match \fBfile.c\fP, \fBa/file.c\fP
  1651. and \fBa/b/.c\fP. More than one pattern can be listed as separate
  1652. arguments.
  1653. Note for PKZIP users: the equivalent command is
  1654. .RS
  1655. .IP
  1656. \fCpkzip -rP foo *.c\fP
  1657. .RE
  1658. .IP
  1659. Patterns are relative file paths as they appear in the archive, or will after
  1660. zipping, and can have optional wildcards in them. For example, given
  1661. the current directory is \fBfoo\fP and under it are directories \fBfoo1\fP and \fBfoo2\fP
  1662. and in \fBfoo1\fP is the file \fBbar.c\fP,
  1663. .RS
  1664. .IP
  1665. \fCzip -R foo/*\fP
  1666. .RE
  1667. .IP
  1668. will zip up \fBfoo\fP, \fBfoo/foo1\fP, \fBfoo/foo1/bar.c\fP, and \fBfoo/foo2\fP.
  1669. .RS
  1670. .IP
  1671. \fCzip -R */bar.c\fP
  1672. .RE
  1673. .IP
  1674. will zip up \fBfoo/foo1/bar.c\fP. See the note for \fB-r\fR on escaping wildcards.
  1675. .TP
  1676. .PD 0
  1677. .B \-RE
  1678. .TP
  1679. .PD
  1680. .B \-\-regex
  1681. [WIN32] Before \fIzip\fP \fI3.0\fP, regular expression list matching was
  1682. enabled by default on Windows platforms. Because of confusion resulting
  1683. from the need to escape "[" and "]" in names, it is now off by default for
  1684. Windows so "[" and "]" are just normal characters in names. This option
  1685. enables [] matching again.
  1686. .TP
  1687. .PD 0
  1688. .B \-s\ \fPsplitsize
  1689. .TP
  1690. .PD
  1691. .B \-\-split\-size\ \fPsplitsize
  1692. Enable creating a split archive and set the split size. A split archive is an archive
  1693. that could be split over many files. As the archive is created, if the size of the
  1694. archive reaches the specified split size, that split is closed and the next split
  1695. opened. In general all splits but the last will be the split size and the last
  1696. will be whatever is left. If the entire archive is smaller than the split size a
  1697. single-file archive is created.
  1698. Split archives are stored in numbered files. For example, if the output
  1699. archive is named \fBarchive\fP and three splits are required, the resulting
  1700. archive will be in the three files \fBarchive.z01\fP, \fBarchive.z02\fP, and
  1701. \fBarchive.zip\fP. Do not change the numbering of these files or the archive
  1702. will not be readable as these are used to determine the order the splits are read.
  1703. Split size is a number optionally followed by a multiplier. Currently the
  1704. number must be an integer. The multiplier can currently be one of
  1705. \fBk\fP (kilobytes), \fBm\fP (megabytes), \fBg\fP (gigabytes), or \fBt\fP
  1706. (terabytes). As 64k is the minimum split size, numbers without multipliers
  1707. default to megabytes. For example, to create a split archive called \fBfoo\fP
  1708. with the contents of the \fBbar\fP directory with splits of 670 MB that might
  1709. be useful for burning on CDs, the command:
  1710. .RS
  1711. .IP
  1712. zip -s 670m -r foo bar
  1713. .RE
  1714. .IP
  1715. could be used.
  1716. Currently the old splits of a split archive are not excluded from a new
  1717. archive, but they can be specifically excluded. If possible, keep
  1718. the input and output archives out of the path being zipped when creating
  1719. split archives.
  1720. Using \fB\-s\fP without \fB\-sp\fP as above creates all the splits where
  1721. \fBfoo\fP is being written, in this case the current directory. This split
  1722. mode updates the splits as the archive is being created, requiring all
  1723. splits to remain writable, but creates split archives that are readable by
  1724. any unzip that supports split archives. See \fB\-sp\fP below for enabling
  1725. split pause mode which allows splits to be written directly to removable
  1726. media.
  1727. The option \fB\-sv\fP can be used to enable verbose splitting and provide details of
  1728. how the splitting is being done. The \fB\-sb\fP option can be used to ring the bell
  1729. when \fIzip\fP pauses for the next split destination.
  1730. Split archives cannot be updated, but see the \fB\-O\fP (\fB\-\-out\fP) option for
  1731. how a split archive can be updated as it is copied to a new archive.
  1732. A split archive can also be converted into a single-file archive using a
  1733. split size of 0 or negating the \fB\-s\fP option:
  1734. .RS
  1735. .IP
  1736. zip -s 0 split.zip --out single.zip
  1737. .RE
  1738. .IP
  1739. Also see \fB\-U\fP (\fB\-\-copy\fP) for more on using copy mode.
  1740. .TP
  1741. .PD 0
  1742. .B \-sb
  1743. .TP
  1744. .PD
  1745. .B \-\-split\-bell
  1746. If splitting and using split pause mode, ring the bell when \fIzip\fP pauses
  1747. for each split destination.
  1748. .TP
  1749. .PD 0
  1750. .B \-sc
  1751. .TP
  1752. .PD
  1753. .B \-\-show\-command
  1754. Show the command line starting \fIzip\fP as processed and exit. The new command parser
  1755. permutes the arguments, putting all options and any values associated with them
  1756. before any non-option arguments. This allows an option to appear anywhere in the
  1757. command line as long as any values that go with the option go with it. This option
  1758. displays the command line as \fIzip\fP sees it, including any arguments from
  1759. the environment such as from the \fBZIPOPT\fP variable. Where allowed, options later
  1760. in the command line can override options earlier in the command line.
  1761. .TP
  1762. .PD 0
  1763. .B \-sf
  1764. .TP
  1765. .PD
  1766. .B \-\-show\-files
  1767. Show the files that would be operated on, then exit. For instance, if creating
  1768. a new archive, this will list the files that would be added. If the option is
  1769. negated, \fB\-sf\-\fP, output only to an open log file. Screen display is
  1770. not recommended for large lists.
  1771. .TP
  1772. .PD 0
  1773. .B \-so
  1774. .TP
  1775. .PD
  1776. .B \-\-show\-options
  1777. Show all available options supported by \fIzip\fP as compiled on the current system.
  1778. As this command reads the option table, it should include all options. Each line
  1779. includes the short option (if defined), the long option (if defined), the format
  1780. of any value that goes with the option, if the option can be negated, and a
  1781. small description. The value format can be no value, required value, optional
  1782. value, single character value, number value, or a list of values. The output of
  1783. this option is not intended to show how to use any option but only
  1784. show what options are available.
  1785. .TP
  1786. .PD 0
  1787. .B \-sp
  1788. .TP
  1789. .PD
  1790. .B \-\-split\-pause
  1791. If splitting is enabled with \fB\-s\fP, enable split pause mode. This
  1792. creates split archives as \fB\-s\fP does, but stream writing is used so each
  1793. split can be closed as soon as it is written and \fIzip\fP will pause between each
  1794. split to allow changing split destination or media.
  1795. Though this split mode allows writing splits directly to removable media, it
  1796. uses stream archive format that may not be readable by some unzips. Before
  1797. relying on splits created with \fB\-sp\fP, test a split archive with the unzip
  1798. you will be using.
  1799. To convert a stream split archive (created with \fB\-sp\fP) to a standard archive
  1800. see the \fB\-\-out\fP option.
  1801. .TP
  1802. .PD 0
  1803. .B \-su
  1804. .TP
  1805. .PD
  1806. .B \-\-show\-unicode
  1807. As \fB\-sf\fP, but also show Unicode version of the path if exists.
  1808. .TP
  1809. .PD 0
  1810. .B \-sU
  1811. .TP
  1812. .PD
  1813. .B \-\-show\-just\-unicode
  1814. As \fB\-sf\fP, but only show Unicode version of the path if exists, otherwise show
  1815. the standard version of the path.
  1816. .TP
  1817. .PD 0
  1818. .B \-sv
  1819. .TP
  1820. .PD
  1821. .B \-\-split\-verbose
  1822. Enable various verbose messages while splitting, showing how the splitting is being
  1823. done.
  1824. .TP
  1825. .PD 0
  1826. .B \-S
  1827. .TP
  1828. .PD
  1829. .B \-\-system-hidden
  1830. [MSDOS, OS/2, WIN32 and ATARI] Include system and hidden files.
  1831. .RS
  1832. [MacOS] Includes finder invisible files, which are ignored otherwise.
  1833. .RE
  1834. .TP
  1835. .PD 0
  1836. .BI \-t\ \fRmmddyyyy
  1837. .TP
  1838. .PD
  1839. .B \-\-from\-date\ \fRmmddyyyy
  1840. Do not operate on files modified prior to the specified date,
  1841. where
  1842. .B mm
  1843. is the month (00-12),
  1844. .B dd
  1845. is the day of the month (01-31),
  1846. and
  1847. .B yyyy
  1848. is the year.
  1849. The
  1850. .I ISO\ 8601
  1851. date format
  1852. .B yyyy\-mm\-dd
  1853. is also accepted.
  1854. For example:
  1855. .RS
  1856. .IP
  1857. \fCzip -rt 12071991 infamy foo\fP
  1858. \fCzip -rt 1991-12-07 infamy foo\fP
  1859. .RE
  1860. .IP
  1861. will add all the files in
  1862. .B foo
  1863. and its subdirectories that were last modified on or after 7 December 1991,
  1864. to the
  1865. .I zip
  1866. archive
  1867. .BR infamy.zip .
  1868. .TP
  1869. .PD 0
  1870. .BI \-tt\ \fRmmddyyyy
  1871. .TP
  1872. .PD
  1873. .B \-\-before\-date\ \fRmmddyyyy
  1874. Do not operate on files modified after or at the specified date,
  1875. where
  1876. .B mm
  1877. is the month (00-12),
  1878. .B dd
  1879. is the day of the month (01-31),
  1880. and
  1881. .B yyyy
  1882. is the year.
  1883. The
  1884. .I ISO\ 8601
  1885. date format
  1886. .B yyyy\-mm\-dd
  1887. is also accepted.
  1888. For example:
  1889. .RS
  1890. .IP
  1891. \fCzip -rtt 11301995 infamy foo\fP
  1892. \fCzip -rtt 1995-11-30 infamy foo\fP
  1893. .RE
  1894. .IP
  1895. will add all the files in
  1896. .B foo
  1897. and its subdirectories that were last modified before 30 November 1995,
  1898. to the
  1899. .I zip
  1900. archive
  1901. .BR infamy.zip .
  1902. .TP
  1903. .PD 0
  1904. .B \-T
  1905. .TP
  1906. .PD
  1907. .B \-\-test\ \ \ \
  1908. Test the integrity of the new zip file. If the check fails, the old zip file
  1909. is unchanged and (with the
  1910. .B -m
  1911. option) no input files are removed.
  1912. .TP
  1913. .PD 0
  1914. .B \-TT\ \fPcmd
  1915. .TP
  1916. .PD
  1917. .B \-\-unzip-command\ \fPcmd
  1918. Use command cmd instead of 'unzip -tqq' to test an archive when the \fB\-T\fP
  1919. option is used. On Unix, to use a copy of unzip in the current directory instead
  1920. of the standard system unzip, could use:
  1921. .IP
  1922. \fC zip archive file1 file2 -T -TT "./unzip -tqq"\fP
  1923. .IP
  1924. In cmd, {} is replaced by the name of the temporary archive, otherwise the name
  1925. of the archive is appended to the end of the command.
  1926. The return code is checked for success (0 on Unix).
  1927. .TP
  1928. .PD 0
  1929. .B \-u
  1930. .TP
  1931. .PD
  1932. .B \-\-update
  1933. Replace (update) an existing entry in the
  1934. .I zip
  1935. archive only if it has been modified more recently
  1936. than the version already in the
  1937. .I zip
  1938. archive.
  1939. For example:
  1940. .RS
  1941. .IP
  1942. \fCzip -u stuff *\fP
  1943. .RE
  1944. .IP
  1945. will add any new files in the current directory,
  1946. and update any files which have been modified since the
  1947. .I zip
  1948. archive
  1949. .I stuff.zip
  1950. was last created/modified (note that
  1951. .I zip
  1952. will not try to pack
  1953. .I stuff.zip
  1954. into itself when you do this).
  1955. .IP
  1956. Note that the
  1957. .B \-u
  1958. option with no input file arguments acts like the
  1959. .B \-f
  1960. (freshen) option.
  1961. .TP
  1962. .PD 0
  1963. .B \-U
  1964. .TP
  1965. .PD
  1966. .B \-\-copy\-entries
  1967. Copy entries from one archive to another. Requires the \fB\-\-out\fP
  1968. option to specify a different output file than the input archive. Copy
  1969. mode is the reverse of \fB\-d\fP delete. When delete is being used
  1970. with \fB\-\-out\fP, the selected entries are deleted from the archive
  1971. and all other entries are copied to the new archive, while copy mode
  1972. selects the files to include in the new archive. Unlike \fB\-u\fP
  1973. update, input patterns on the command line are matched against archive
  1974. entries only and not the file system files. For instance,
  1975. .RS
  1976. .IP
  1977. \fCzip inarchive "*.c" --copy --out outarchive\fP
  1978. .RE
  1979. .IP
  1980. copies entries with names ending in \fB\.c\fP from \fBinarchive\fP
  1981. to \fBoutarchive\fP. The wildcard must be escaped on some systems
  1982. to prevent the shell from substituting names of files from the
  1983. file system which may have no relevance to the entries in the archive.
  1984. If no input files appear on the command line and \fB\-\-out\fP is
  1985. used, copy mode is assumed:
  1986. .RS
  1987. .IP
  1988. \fCzip inarchive --out outarchive\fP
  1989. .RE
  1990. .IP
  1991. This is useful for changing split size for instance. Encrypting
  1992. and decrypting entries is not yet supported using copy mode. Use
  1993. \fIzipcloak\fP for that.
  1994. .TP
  1995. .PD 0
  1996. .B \-UN\ \fRv
  1997. .TP
  1998. .PD
  1999. .B \-\-unicode\ \fRv
  2000. Determine what \fIzip\fP should do with Unicode file names.
  2001. \fIzip\ 3.0\fP, in addition to the standard file path, now
  2002. includes the UTF\-8 translation of the path if the entry path
  2003. is not entirely 7-bit ASCII. When an entry
  2004. is missing the Unicode path, \fIzip\fP reverts back to the
  2005. standard file path. The problem with using the standard path
  2006. is this path is in the local character set of the zip that created
  2007. the entry, which may contain characters that are not valid in
  2008. the character set being used by the unzip. When \fIzip\fP is
  2009. reading an archive, if an entry also has a Unicode path,
  2010. \fIzip\fP now defaults to using the Unicode path to recreate
  2011. the standard path using the current local character set.
  2012. This option can be used to determine what \fIzip\fP should do
  2013. with this path if there is a mismatch between the stored standard path
  2014. and the stored UTF-8 path (which can happen if the standard path was
  2015. updated). In all cases, if there is a mismatch it is
  2016. assumed that the standard path is more current and
  2017. \fIzip\fP uses that. Values for \fBv\fP are
  2018. .RS
  2019. .IP
  2020. q \- quit if paths do not match
  2021. .IP
  2022. w \- warn, continue with standard path
  2023. .IP
  2024. i \- ignore, continue with standard path
  2025. .IP
  2026. n \- no Unicode, do not use Unicode paths
  2027. .RE
  2028. .IP
  2029. The default is to warn and continue.
  2030. Characters that are not valid in the current character set are
  2031. escaped as \fB#Uxxxx\fP and \fB#Lxxxxxx\fP, where x is an
  2032. ASCII character for a hex digit. The first is used if a 16-bit
  2033. character number is sufficient to represent the Unicode character
  2034. and the second if the character needs more than 16 bits to
  2035. represent it's Unicode character code. Setting \fB\-UN\fP to
  2036. .RS
  2037. .IP
  2038. e \- escape
  2039. .RE
  2040. .IP
  2041. as in
  2042. .RS
  2043. .IP
  2044. \fCzip archive -sU -UN=e\fP
  2045. .RE
  2046. .IP
  2047. forces \fIzip\fP to escape all characters that are not printable 7-bit
  2048. ASCII.
  2049. Normally \fIzip\fP stores UTF\-8 directly in the standard path field
  2050. on systems where UTF\-8 is the current character set and stores the
  2051. UTF\-8 in the new extra fields otherwise. The option
  2052. .RS
  2053. .IP
  2054. u \- UTF\-8
  2055. .RE
  2056. .IP
  2057. as in
  2058. .RS
  2059. .IP
  2060. \fCzip archive dir -r -UN=UTF8\fP
  2061. .RE
  2062. .IP
  2063. forces \fIzip\fP to store UTF\-8 as native in the archive. Note that
  2064. storing UTF\-8 directly is the default on Unix systems that support it.
  2065. This option could be useful on Windows systems where the escaped
  2066. path is too large to be a valid path and the UTF\-8 version of the
  2067. path is smaller, but native UTF\-8 is not backward compatible on
  2068. Windows systems.
  2069. .TP
  2070. .PD 0
  2071. .B \-v
  2072. .TP
  2073. .PD
  2074. .B \-\-verbose
  2075. Verbose mode or print diagnostic version info.
  2076. .IP
  2077. Normally, when applied to real operations, this option enables the display of a
  2078. progress indicator during compression (see \fB-dd\fR for more on dots) and
  2079. requests verbose diagnostic info about zipfile structure oddities.
  2080. .IP
  2081. However, when
  2082. .B \-v
  2083. is the only command line argument a diagnostic screen is printed instead. This
  2084. should now work even if stdout is redirected to a file, allowing easy saving
  2085. of the information for sending with bug reports to Info-ZIP. The version
  2086. screen provides the help screen header with program name, version, and release
  2087. date, some pointers to the Info-ZIP home and distribution sites, and shows
  2088. information about the target environment (compiler type and version, OS
  2089. version, compilation date and the enabled optional features used to create the
  2090. .I zip
  2091. executable).
  2092. .TP
  2093. .PD 0
  2094. .B \-V
  2095. .TP
  2096. .PD
  2097. .B \-\-VMS\-portable
  2098. [VMS] Save VMS file attributes.
  2099. (Files are truncated at EOF.) When a -V archive is unpacked on a
  2100. non-VMS system, some file types (notably Stream_LF
  2101. text files and pure binary files like fixed-512)
  2102. should be extracted intact. Indexed files and file
  2103. types with embedded record sizes (notably variable-length record types)
  2104. will probably be seen as corrupt elsewhere.
  2105. .TP
  2106. .PD 0
  2107. .B \-VV
  2108. .TP
  2109. .PD
  2110. .B \-\-VMS\-specific
  2111. [VMS] Save VMS file attributes, and all allocated
  2112. blocks in a file, including any data beyond EOF.
  2113. Useful for moving ill-formed files among VMS systems. When a -VV archive is
  2114. unpacked on a non-VMS system, almost all files will appear corrupt.
  2115. .TP
  2116. .PD 0
  2117. .B \-w
  2118. .TP
  2119. .PD
  2120. .B \-\-VMS\-versions
  2121. [VMS] Append the version number of the files to the name,
  2122. including multiple versions of files. Default is to use only
  2123. the most recent version of a specified file.
  2124. .TP
  2125. .PD 0
  2126. .B \-ww
  2127. .TP
  2128. .PD
  2129. .B \-\-VMS\-dot\-versions
  2130. [VMS] Append the version number of the files to the name,
  2131. including multiple versions of files, using the \.nnn format.
  2132. Default is to use only the most recent version of a specified
  2133. file.
  2134. .TP
  2135. .PD 0
  2136. .BI \-ws
  2137. .TP
  2138. .PD
  2139. .B \-\-wild\-stop\-dirs
  2140. Wildcards match only at a directory level. Normally \fIzip\fP handles
  2141. paths as strings and given the paths
  2142. .RS
  2143. .IP
  2144. /foo/bar/dir/file1.c
  2145. .IP
  2146. /foo/bar/file2.c
  2147. .RE
  2148. .IP
  2149. an input pattern such as
  2150. .RS
  2151. .IP
  2152. /foo/bar/*
  2153. .RE
  2154. .IP
  2155. normally would match both paths, the * matching \fBdir/file1.c\fP
  2156. and \fBfile2.c\fP. Note that in the first case a directory
  2157. boundary (/) was crossed in the match. With \fB\-ws\fP no
  2158. directory bounds will be included in the match, making
  2159. wildcards local to a specific directory level. So, with
  2160. \fB\-ws\fP enabled, only the second path would be matched.
  2161. When using \fB\-ws\fP, use ** to match across directory boundaries as
  2162. * does normally.
  2163. .TP
  2164. .PD 0
  2165. .BI \-x\ \fRfiles
  2166. .TP
  2167. .PD
  2168. .B \-\-exclude\ \fRfiles
  2169. Explicitly exclude the specified files, as in:
  2170. .RS
  2171. .IP
  2172. \fCzip -r foo foo -x \\*.o\fP
  2173. .RE
  2174. .IP
  2175. which will include the contents of
  2176. .B foo
  2177. in
  2178. .B foo.zip
  2179. while excluding all the files that end in
  2180. \fB.o\fP.
  2181. The backslash avoids the shell filename substitution, so that the
  2182. name matching is performed by
  2183. .I zip
  2184. at all directory levels.
  2185. .IP
  2186. Also possible:
  2187. .RS
  2188. .IP
  2189. \fCzip -r foo foo -x@exclude.lst\fP
  2190. .RE
  2191. .IP
  2192. which will include the contents of
  2193. .B foo
  2194. in
  2195. .B foo.zip
  2196. while excluding all the files that match the patterns in the file
  2197. \fBexclude.lst\fP.
  2198. .IP
  2199. The long option forms of the above are
  2200. .RS
  2201. .IP
  2202. \fCzip -r foo foo --exclude \\*.o\fP
  2203. .RE
  2204. .IP
  2205. and
  2206. .RS
  2207. .IP
  2208. \fCzip -r foo foo --exclude @exclude.lst\fP
  2209. .RE
  2210. .IP
  2211. Multiple patterns can be specified, as in:
  2212. .RS
  2213. .IP
  2214. \fCzip -r foo foo -x \\*.o \\*.c\fP
  2215. .RE
  2216. .IP
  2217. If there is no space between \fB\-x\fP and
  2218. the pattern, just one value is assumed (no list):
  2219. .RS
  2220. .IP
  2221. \fCzip -r foo foo -x\\*.o\fP
  2222. .RE
  2223. .IP
  2224. .IP
  2225. See \fB-i\fR for more on include and exclude.
  2226. .TP
  2227. .PD 0
  2228. .B \-X
  2229. .TP
  2230. .PD
  2231. .B \-\-no\-extra
  2232. Do not save extra file attributes (Extended Attributes on OS/2, uid/gid
  2233. and file times on Unix). The zip format uses extra fields to include
  2234. additional information for each entry. Some extra fields are specific
  2235. to particular systems while others are applicable to all systems.
  2236. Normally when \fIzip\fP reads entries from an existing archive, it
  2237. reads the extra fields it knows, strips the rest, and adds
  2238. the extra fields applicable to that system. With \fB\-X\fP, \fIzip\fP strips
  2239. all old fields and only includes the Unicode and Zip64 extra fields
  2240. (currently these two extra fields cannot be disabled).
  2241. Negating this option, \fB\-X\-\fP, includes all the default extra fields,
  2242. but also copies over any unrecognized extra fields.
  2243. .TP
  2244. .PD 0
  2245. .B \-y
  2246. .TP
  2247. .PD
  2248. .B \-\-symlinks
  2249. For UNIX and VMS (V8.3 and later), store symbolic links as such in the
  2250. .I zip
  2251. archive, instead of compressing and storing the file referred to by
  2252. the link. This can avoid multiple copies of files being included in
  2253. the archive as \fIzip\fP recurses the directory trees and accesses
  2254. files directly and by links.
  2255. .TP
  2256. .PD 0
  2257. .B \-z
  2258. .TP
  2259. .PD
  2260. .B \-\-archive\-comment
  2261. Prompt for a multi-line comment for the entire
  2262. .I zip
  2263. archive.
  2264. The comment is ended by a line containing just a period,
  2265. or an end of file condition (^D on Unix, ^Z on MSDOS, OS/2, and VMS).
  2266. The comment can be taken from a file:
  2267. .RS
  2268. .IP
  2269. \fCzip -z foo < foowhat\fP
  2270. .RE
  2271. .TP
  2272. .PD 0
  2273. .B \-Z\ \fRcm
  2274. .TP
  2275. .PD
  2276. .B \-\-compression\-method\ \fRcm
  2277. Set the default compression method. Currently the main methods supported
  2278. by \fIzip\fP are \fBstore\fP and \fBdeflate\fP. Compression method
  2279. can be set to:
  2280. \fBstore\fP \- Setting the compression method to \fBstore\fP forces
  2281. \fIzip\fP to store entries with no compression. This is generally
  2282. faster than compressing entries, but results in no space savings.
  2283. This is the same as using \fB\-0\fP (compression level zero).
  2284. \fBdeflate\fP \- This is the default method for \fIzip\fP. If \fIzip\fP
  2285. determines that storing is better than deflation, the entry will be
  2286. stored instead.
  2287. \fBbzip2\fP \- If \fBbzip2\fP support is compiled in, this compression
  2288. method also becomes available. Only some modern unzips currently support
  2289. the \fBbzip2\fP compression method, so test the unzip you will be using
  2290. before relying on archives using this method (compression method 12).
  2291. For example, to add \fBbar.c\fP to archive \fBfoo\fP using \fBbzip2\fP
  2292. compression:
  2293. .RS
  2294. .IP
  2295. zip -Z bzip2 foo bar.c
  2296. .RE
  2297. .IP
  2298. The compression method can be abbreviated:
  2299. .RS
  2300. .IP
  2301. zip -Zb foo bar.c
  2302. .RE
  2303. .IP
  2304. .TP
  2305. .PD 0
  2306. .BI \-#
  2307. .TP
  2308. .PD
  2309. .B (\-0, \-1, \-2, \-3, \-4, \-5, \-6, \-7, \-8, \-9)
  2310. Regulate the speed of compression using the specified digit
  2311. .BR # ,
  2312. where
  2313. .B \-0
  2314. indicates no compression (store all files),
  2315. .B \-1
  2316. indicates the fastest compression speed (less compression)
  2317. and
  2318. .B \-9
  2319. indicates the slowest compression speed (optimal compression, ignores
  2320. the suffix list). The default compression level is
  2321. .BR \-6.
  2322. Though still being worked, the intention is this setting will control
  2323. compression speed for all compression methods. Currently only
  2324. deflation is controlled.
  2325. .TP
  2326. .PD 0
  2327. .B \-!
  2328. .TP
  2329. .PD
  2330. .B \-\-use\-privileges
  2331. [WIN32] Use priviliges (if granted) to obtain all aspects of WinNT security.
  2332. .TP
  2333. .PD 0
  2334. .B \-@
  2335. .TP
  2336. .PD
  2337. .B \-\-names\-stdin
  2338. Take the list of input files from standard input. Only one filename per line.
  2339. .TP
  2340. .PD 0
  2341. .B \-$
  2342. .TP
  2343. .PD
  2344. .B \-\-volume\-label
  2345. [MSDOS, OS/2, WIN32] Include the volume label for the drive holding
  2346. the first file to be compressed. If you want to include only the volume
  2347. label or to force a specific drive, use the drive name as first file name,
  2348. as in:
  2349. .RS
  2350. .IP
  2351. \fCzip -$ foo a: c:bar\fP
  2352. .RE
  2353. .IP
  2354. .SH "EXAMPLES"
  2355. The simplest example:
  2356. .IP
  2357. \fCzip stuff *\fP
  2358. .LP
  2359. creates the archive
  2360. .I stuff.zip
  2361. (assuming it does not exist)
  2362. and puts all the files in the current directory in it, in compressed form
  2363. (the
  2364. \fB\&.zip\fP
  2365. suffix is added automatically, unless the archive name contains
  2366. a dot already;
  2367. this allows the explicit specification of other suffixes).
  2368. .LP
  2369. Because of the way the shell on Unix does filename substitution,
  2370. files starting with "." are not included;
  2371. to include these as well:
  2372. .IP
  2373. \fCzip stuff .* *\fP
  2374. .LP
  2375. Even this will not include any subdirectories from the current directory.
  2376. .LP
  2377. To zip up an entire directory, the command:
  2378. .IP
  2379. \fCzip -r foo foo\fP
  2380. .LP
  2381. creates the archive
  2382. .IR foo.zip ,
  2383. containing all the files and directories in the directory
  2384. .I foo
  2385. that is contained within the current directory.
  2386. .LP
  2387. You may want to make a
  2388. .I zip
  2389. archive that contains the files in
  2390. .IR foo ,
  2391. without recording the directory name,
  2392. .IR foo .
  2393. You can use the
  2394. .B \-j
  2395. option to leave off the paths,
  2396. as in:
  2397. .IP
  2398. \fCzip -j foo foo/*\fP
  2399. .LP
  2400. If you are short on disk space,
  2401. you might not have enough room to hold both the original directory
  2402. and the corresponding compressed
  2403. .I zip
  2404. archive.
  2405. In this case, you can create the archive in steps using the
  2406. .B \-m
  2407. option.
  2408. If
  2409. .I foo
  2410. contains the subdirectories
  2411. .IR tom ,
  2412. .IR dick ,
  2413. and
  2414. .IR harry ,
  2415. you can:
  2416. .IP
  2417. \fCzip -rm foo foo/tom\fP
  2418. .br
  2419. \fCzip -rm foo foo/dick\fP
  2420. .br
  2421. \fCzip -rm foo foo/harry\fP
  2422. .LP
  2423. where the first command creates
  2424. .IR foo.zip ,
  2425. and the next two add to it.
  2426. At the completion of each
  2427. .I zip
  2428. command,
  2429. the last created archive is deleted,
  2430. making room for the next
  2431. .I zip
  2432. command to function.
  2433. .LP
  2434. Use \fB\-s\fP to set the split size and create a split archive. The size is given as
  2435. a number followed optionally by one of k (kB), m (MB), g (GB), or t (TB).
  2436. The command
  2437. .IP
  2438. \fCzip -s 2g -r split.zip foo\fP
  2439. .LP
  2440. creates a split archive of the directory foo with splits no bigger than 2\ GB each. If
  2441. foo contained 5\ GB of contents and the contents were stored in the split archive without
  2442. compression (to make this example simple), this would create three splits, split.z01 at 2\ GB,
  2443. split.z02 at 2\ GB, and split.zip at a little over 1\ GB.
  2444. .LP
  2445. The \fB\-sp\fP option can be used to pause \fIzip\fP between splits to allow changing
  2446. removable media, for example, but read the descriptions and warnings for both \fB\-s\fP
  2447. and \fB\-sp\fP below.
  2448. .LP
  2449. Though \fIzip\fP does not update split archives, \fIzip\fP provides the new option \fB\-O\fP
  2450. (\fB\-\-output\-file\fP) to allow split archives to be updated and saved in a new archive. For example,
  2451. .IP
  2452. \fCzip inarchive.zip foo.c bar.c \-\-out outarchive.zip\fP
  2453. .LP
  2454. reads archive \fBinarchive.zip\fP, even if split, adds the files \fBfoo.c\fP and
  2455. \fBbar.c\fP, and writes the resulting archive to \fBoutarchive.zip\fP. If
  2456. \fBinarchive.zip\fP is split then \fBoutarchive.zip\fP defaults
  2457. to the same split size. Be aware that \fBoutarchive.zip\fP and any split files
  2458. that are created with it are always overwritten without warning. This may be changed
  2459. in the future.
  2460. .SH "PATTERN MATCHING"
  2461. This section applies only to Unix.
  2462. Watch this space for details on MSDOS and VMS operation.
  2463. However, the special wildcard characters \fB*\fR and \fB[]\fR below apply
  2464. to at least MSDOS also.
  2465. .LP
  2466. The Unix shells (\fIsh\fP, \fIcsh\fP, \fIbash\fP, and others) normally
  2467. do filename substitution (also called "globbing") on command arguments.
  2468. Generally the special characters are:
  2469. .TP
  2470. .B ?
  2471. match any single character
  2472. .TP
  2473. .B *
  2474. match any number of characters (including none)
  2475. .TP
  2476. .B []
  2477. match any character in the range indicated within the brackets
  2478. (example: [a\-f], [0\-9]). This form of wildcard matching
  2479. allows a user to specify a list of characters between square brackets and
  2480. if any of the characters match the expression matches. For example:
  2481. .RS
  2482. .IP
  2483. \fCzip archive "*.[hc]"\fP
  2484. .RE
  2485. .IP
  2486. would archive all files in the current directory that end in
  2487. \fB.h\fP or \fB.c\fP.
  2488. Ranges of characters are supported:
  2489. .RS
  2490. .IP
  2491. \fCzip archive "[a\-f]*"\fP
  2492. .RE
  2493. .IP
  2494. would add to the archive all files starting with "a" through "f".
  2495. Negation is also supported, where any character in that position not in
  2496. the list matches. Negation is supported by adding \fB!\fP or \fB^\fP
  2497. to the beginning of the list:
  2498. .RS
  2499. .IP
  2500. \fCzip archive "*.[!o]"\fP
  2501. .RE
  2502. .IP
  2503. matches files that don't end in ".o".
  2504. On WIN32, [] matching needs to be turned on with the -RE option to avoid
  2505. the confusion that names with [ or ] have caused.
  2506. .LP
  2507. When these characters are encountered
  2508. (without being escaped with a backslash or quotes),
  2509. the shell will look for files relative to the current path
  2510. that match the pattern,
  2511. and replace the argument with a list of the names that matched.
  2512. .LP
  2513. The
  2514. .I zip
  2515. program can do the same matching on names that are in the
  2516. .I zip
  2517. archive being modified or,
  2518. in the case of the
  2519. .B \-x
  2520. (exclude) or
  2521. .B \-i
  2522. (include) options, on the list of files to be operated on, by using
  2523. backslashes or quotes to tell the shell not to do the name expansion.
  2524. In general, when
  2525. .I zip
  2526. encounters a name in the list of files to do, it first looks for the name in
  2527. the file system. If it finds it, it then adds it to the list of files to do.
  2528. If it does not find it, it looks for the name in the
  2529. .I zip
  2530. archive being modified (if it exists), using the pattern matching characters
  2531. described above, if present. For each match, it will add that name to the
  2532. list of files to be processed, unless this name matches one given
  2533. with the
  2534. .B \-x
  2535. option, or does not match any name given with the
  2536. .B \-i
  2537. option.
  2538. .LP
  2539. The pattern matching includes the path,
  2540. and so patterns like \\*.o match names that end in ".o",
  2541. no matter what the path prefix is.
  2542. Note that the backslash must precede every special character (i.e. ?*[]),
  2543. or the entire argument must be enclosed in double quotes ("").
  2544. .LP
  2545. In general, use backslashes or double quotes for paths
  2546. that have wildcards to make
  2547. .I zip
  2548. do the pattern matching for file paths, and always for
  2549. paths and strings that have spaces or wildcards for
  2550. \fB\-\i\fP, \fB\-x\fP, \fB\-R\fP, \fB\-d\fP, and \fB\-U\fP
  2551. and anywhere \fIzip\fP needs to process the wildcards.
  2552. .SH "ENVIRONMENT"
  2553. .LP
  2554. The following environment variables are read and used by
  2555. .I zip
  2556. as described.
  2557. .TP
  2558. .B ZIPOPT\ \
  2559. contains default options that will be used when running
  2560. \fIzip\fR. The contents of this environment variable will get
  2561. added to the command line just after the \fBzip\fR command.
  2562. .TP
  2563. .B ZIP\ \ \ \ \
  2564. [Not on RISC OS and VMS] see ZIPOPT
  2565. .TP
  2566. .B Zip$Options
  2567. [RISC OS] see ZIPOPT
  2568. .TP
  2569. .B Zip$Exts
  2570. [RISC OS] contains extensions separated by a : that will cause
  2571. native filenames with one of the specified extensions to
  2572. be added to the zip file with basename and extension swapped.
  2573. .TP
  2574. .B ZIP_OPTS
  2575. [VMS] see ZIPOPT
  2576. .SH "SEE ALSO"
  2577. compress(1),
  2578. shar(1L),
  2579. tar(1),
  2580. unzip(1L),
  2581. gzip(1L)
  2582. .SH DIAGNOSTICS
  2583. The exit status (or error level) approximates the exit codes defined by PKWARE
  2584. and takes on the following values, except under VMS:
  2585. .RS
  2586. .IP 0
  2587. normal; no errors or warnings detected.
  2588. .IP 2
  2589. unexpected end of zip file.
  2590. .IP 3
  2591. a generic error in the zipfile format was detected. Processing may have
  2592. completed successfully anyway; some broken zipfiles created by other
  2593. archivers have simple work-arounds.
  2594. .IP 4
  2595. \fIzip\fP was unable to allocate memory for one or more buffers during
  2596. program initialization.
  2597. .IP 5
  2598. a severe error in the zipfile format was detected. Processing probably
  2599. failed immediately.
  2600. .IP 6
  2601. entry too large to be processed (such as input files larger than 2 GB when
  2602. not using Zip64 or trying to read an existing archive that is too large) or
  2603. entry too large to be split with \fIzipsplit\fP
  2604. .IP 7
  2605. invalid comment format
  2606. .IP 8
  2607. \fIzip\fP -T failed or out of memory
  2608. .IP 9
  2609. the user aborted \fIzip\fP prematurely with control-C (or similar)
  2610. .IP 10
  2611. \fIzip\fP encountered an error while using a temp file
  2612. .IP 11
  2613. read or seek error
  2614. .IP 12
  2615. \fIzip\fP has nothing to do
  2616. .IP 13
  2617. missing or empty zip file
  2618. .IP 14
  2619. error writing to a file
  2620. .IP 15
  2621. \fIzip\fP was unable to create a file to write to
  2622. .IP 16
  2623. bad command line parameters
  2624. .IP 18
  2625. \fIzip\fP could not open a specified file to read
  2626. .IP 19
  2627. \fIzip\fP was compiled with options not supported on this system
  2628. .RE
  2629. .PP
  2630. VMS interprets standard Unix (or PC) return values as other, scarier-looking
  2631. things, so \fIzip\fP instead maps them into VMS-style status codes. In
  2632. general, \fIzip\fP sets VMS Facility = 1955 (0x07A3), Code = 2* Unix_status,
  2633. and an appropriate Severity (as specified in ziperr.h). More details are
  2634. included in the VMS-specific documentation. See [.vms]NOTES.TXT and
  2635. [.vms]vms_msg_gen.c.
  2636. .PD
  2637. .SH BUGS
  2638. .I zip
  2639. 3.0 is not compatible with PKUNZIP 1.10. Use
  2640. .I zip
  2641. 1.1 to produce
  2642. .I zip
  2643. files which can be extracted by PKUNZIP 1.10.
  2644. .PP
  2645. .I zip
  2646. files produced by
  2647. .I zip
  2648. 3.0 must not be
  2649. .I updated
  2650. by
  2651. .I zip
  2652. 1.1 or PKZIP 1.10, if they contain
  2653. encrypted members or if they have been produced in a pipe or on a non-seekable
  2654. device. The old versions of
  2655. .I zip
  2656. or PKZIP would create an archive with an incorrect format.
  2657. The old versions can list the contents of the zip file
  2658. but cannot extract it anyway (because of the new compression algorithm).
  2659. If you do not use encryption and use regular disk files, you do
  2660. not have to care about this problem.
  2661. .LP
  2662. Under VMS,
  2663. not all of the odd file formats are treated properly.
  2664. Only stream-LF format
  2665. .I zip
  2666. files are expected to work with
  2667. .IR zip .
  2668. Others can be converted using Rahul Dhesi's BILF program.
  2669. This version of
  2670. .I zip
  2671. handles some of the conversion internally.
  2672. When using Kermit to transfer zip files from VMS to MSDOS, type "set
  2673. file type block" on VMS. When transfering from MSDOS to VMS, type
  2674. "set file type fixed" on VMS. In both cases, type "set file type
  2675. binary" on MSDOS.
  2676. .LP
  2677. Under some older VMS versions, \fIzip\fP may hang for file
  2678. specifications that use DECnet syntax
  2679. .I foo::*.*.
  2680. .LP
  2681. On OS/2, zip cannot match some names, such as those including an
  2682. exclamation mark or a hash sign. This is a bug in OS/2 itself: the
  2683. 32-bit DosFindFirst/Next don't find such names. Other programs such
  2684. as GNU tar are also affected by this bug.
  2685. .LP
  2686. Under OS/2, the amount of Extended Attributes displayed by DIR is (for
  2687. compatibility) the amount returned by the 16-bit version of
  2688. DosQueryPathInfo(). Otherwise OS/2 1.3 and 2.0 would report different
  2689. EA sizes when DIRing a file.
  2690. However, the structure layout returned by the 32-bit DosQueryPathInfo()
  2691. is a bit different, it uses extra padding bytes and link pointers (it's
  2692. a linked list) to have all fields on 4-byte boundaries for portability
  2693. to future RISC OS/2 versions. Therefore the value reported by
  2694. .I zip
  2695. (which uses this 32-bit-mode size) differs from that reported by DIR.
  2696. .I zip
  2697. stores the 32-bit format for portability, even the 16-bit
  2698. MS-C-compiled version running on OS/2 1.3, so even this one shows the
  2699. 32-bit-mode size.
  2700. .SH AUTHORS
  2701. Copyright (C) 1997-2008 Info-ZIP.
  2702. .LP
  2703. Currently distributed under the Info-ZIP license.
  2704. .LP
  2705. Copyright (C) 1990-1997 Mark Adler, Richard B. Wales, Jean-loup Gailly,
  2706. Onno van der Linden, Kai Uwe Rommel, Igor Mandrichenko, John Bush and
  2707. Paul Kienitz.
  2708. .LP
  2709. Original copyright:
  2710. .LP
  2711. Permission is granted to any individual or institution to use, copy, or
  2712. redistribute this software so long as all of the original files are included,
  2713. that it is not sold for profit, and that this copyright notice
  2714. is retained.
  2715. .LP
  2716. LIKE ANYTHING ELSE THAT'S FREE, ZIP AND ITS ASSOCIATED UTILITIES ARE
  2717. PROVIDED AS IS AND COME WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR
  2718. IMPLIED. IN NO EVENT WILL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES
  2719. RESULTING FROM THE USE OF THIS SOFTWARE.
  2720. .LP
  2721. Please send bug reports and comments using the web page at:
  2722. .IR www.info-zip.org .
  2723. For bug reports, please include the version of
  2724. .IR zip
  2725. (see \fIzip\ \-h\fR),
  2726. the make options used to compile it (see \fIzip\ \-v\fR),
  2727. the machine and operating system in use,
  2728. and as much additional information as possible.
  2729. .SH ACKNOWLEDGEMENTS
  2730. Thanks to R. P. Byrne for his
  2731. .I Shrink.Pas
  2732. program, which inspired this project,
  2733. and from which the shrink algorithm was stolen;
  2734. to Phil Katz for placing in the public domain the
  2735. .I zip
  2736. file format, compression format, and .ZIP filename extension, and for
  2737. accepting minor changes to the file format; to Steve Burg for
  2738. clarifications on the deflate format; to Haruhiko Okumura and Leonid
  2739. Broukhis for providing some useful ideas for the compression
  2740. algorithm; to Keith Petersen, Rich Wales, Hunter Goatley and Mark
  2741. Adler for providing a mailing list and
  2742. .I ftp
  2743. site for the Info-ZIP group to use; and most importantly, to the
  2744. Info-ZIP group itself (listed in the file
  2745. .IR infozip.who )
  2746. without whose tireless testing and bug-fixing efforts a portable
  2747. .I zip
  2748. would not have been possible.
  2749. Finally we should thank (blame) the first Info-ZIP moderator,
  2750. David Kirschbaum,
  2751. for getting us into this mess in the first place.
  2752. The manual page was rewritten for Unix by R. P. C. Rodgers and
  2753. updated by E. Gordon for \fIzip\fR 3.0.
  2754. .\" end of file