pax.1 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919
  1. '\" t
  2. .\" Copyright (c) 2004 Gunnar Ritter
  3. .\"
  4. .\" This software is provided 'as-is', without any express or implied
  5. .\" warranty. In no event will the authors be held liable for any damages
  6. .\" arising from the use of this software.
  7. .\"
  8. .\" Permission is granted to anyone to use this software for any purpose,
  9. .\" including commercial applications, and to alter it and redistribute
  10. .\" it freely, subject to the following restrictions:
  11. .\"
  12. .\" 1. The origin of this software must not be misrepresented; you must not
  13. .\" claim that you wrote the original software. If you use this software
  14. .\" in a product, an acknowledgment in the product documentation would be
  15. .\" appreciated but is not required.
  16. .\"
  17. .\" 2. Altered source versions must be plainly marked as such, and must not be
  18. .\" misrepresented as being the original software.
  19. .\"
  20. .\" 3. This notice may not be removed or altered from any source distribution.
  21. .\" Sccsid @(#)pax.1 1.38 (gritter) 8/13/09
  22. .TH PAX 1 "8/13/09" "Heirloom Toolchest" "User Commands"
  23. .SH NAME
  24. pax \- portable archive interchange
  25. .SH SYNOPSIS
  26. .PD 0
  27. .HP
  28. .nh
  29. .ad l
  30. \fBpax\fR [\fB\-cdnvK\fR] [\fB\-b\ \fIsize\fR]
  31. [\fB\-f\ \fIfile\fR] [\fB\-s\ \fIreplstr\fR]
  32. [\fB\-x\ \fIhdr\fR] [\fIpatterns\fR]
  33. .HP
  34. .ad l
  35. \fBpax\fR \fB\-r\fR[\fBcdiknuvK\fR] [\fB\-b\ \fIsize\fR]
  36. [\fB\-f\ \fIfile\fR]
  37. [\fB\-o\ \fIoptions\fR]
  38. [\fB\-p\ \fIpriv\fR] [\fB\-s\ \fIreplstr\fR]
  39. [\fB\-x\ \fIhdr\fR] [\fIpatterns\fR]
  40. .HP
  41. .ad l
  42. \fBpax\fR \fB\-w\fR[\fBadiHtuvLX\fR] [\fB\-b\ \fIsize\fR]
  43. [\fB\-f\ \fIfile\fR]
  44. [\fB\-o\ \fIoptions\fR]
  45. [\fB\-s\ \fIreplstr\fR]
  46. [\fB\-x\ \fIhdr\fR] [\fIfiles\fR]
  47. .HP
  48. .ad l
  49. \fBpax\fR \fB\-rw\fR[\fBdiHklntuvLX\fR]
  50. [\fB\-p\ \fIpriv\fR] [\fB\-s\ \fIreplstr\fR]
  51. [\fIfiles\fR] \fIdirectory\fR
  52. .br
  53. .ad b
  54. .hy 1
  55. .PD
  56. .SH DESCRIPTION
  57. .I Pax
  58. creates and extracts file archives and copies files.
  59. .PP
  60. If neither the
  61. .I \-r
  62. or
  63. .I \-w
  64. options are given,
  65. .I pax
  66. works in
  67. .I list
  68. mode
  69. and prints the contents of the archive.
  70. .PP
  71. With the
  72. .B \-r
  73. option,
  74. .I pax
  75. works in
  76. .RI ` read '
  77. mode and extracts files from a file archive.
  78. By default,
  79. the archive is read from standard input.
  80. Optional arguments are interpreted as
  81. .I patterns
  82. and restrict the set of extracted files
  83. to those matching any of the
  84. .IR patterns .
  85. The syntax is identical to that described in
  86. .IR glob (7),
  87. except that the slash character
  88. .RB ` / '
  89. is matched by
  90. meta-character constructs with
  91. .RB ` * ',
  92. .RB ` ? '
  93. and
  94. .RB ` [ '.
  95. Care must be taken to quote meta-characters appropriately from the shell.
  96. If a pattern matches the prefix name of a directory in the archive,
  97. all files below that directory are also extracted.
  98. File permissions are set to those in the archive;
  99. if the caller is the super-user,
  100. ownerships are restored as well.
  101. options are specified.
  102. Archives compressed with
  103. .IR bzip2 (1),
  104. .IR compress (1),
  105. .IR gzip (1),
  106. or
  107. .IR rpm (1)
  108. are transparently de\%compressed on input.
  109. .PP
  110. With
  111. .BR \-w ,
  112. .I pax
  113. works in
  114. .RI ` write '
  115. mode,
  116. creates archives
  117. and writes them to standard output per default.
  118. A list of filenames to be included in the archive is
  119. read from standard input;
  120. if the name of a directory appears,
  121. all its members and the directory itself are recursively
  122. included in the archive.
  123. The
  124. .IR find (1)
  125. utility is useful to generate a list of files
  126. (see also its
  127. .I \-cpio
  128. and
  129. .I \-ncpio
  130. operators).
  131. When producing a filename list for
  132. .IR pax ,
  133. find should always be invoked with
  134. .I \-depth
  135. since this makes it possible to extract write-protected directories
  136. for users other than the super-user.
  137. If
  138. .I files
  139. are given on the command line,
  140. they are included in the archive
  141. in the same manner as described above
  142. and standard input is not read.
  143. .PP
  144. The
  145. .B \-rw
  146. options selects
  147. .RI ` copy '
  148. mode;
  149. a list of
  150. .I files
  151. is read from standard input
  152. or taken from the command line
  153. as described for
  154. .IR \-w ;
  155. files are copied to the specified
  156. .IR directory ,
  157. preserving attributes as described for
  158. .IR \-r .
  159. Special files are re-created in the target hierarchy,
  160. and hard links between copied files are preserved.
  161. .PP
  162. When a premature end-of-file is detected with
  163. .I \-r
  164. and
  165. .I \-w
  166. and the archive is a block or character special file,
  167. the user is prompted for new media.
  168. .PP
  169. The following options alter the behavior of
  170. .IR pax :
  171. .TP
  172. .B \-a
  173. Append files to the archive.
  174. The archive must be seekable,
  175. such as a regular file or a block device,
  176. or a tape device capable of writing between filemarks.
  177. .TP
  178. \fB\-b\fI size\fR[\fBw\fR|\fBb\fR|\fBk\fR|\fBm\fR]
  179. Blocks input and output archives at
  180. .I size
  181. byte records.
  182. The optional suffix multiplies
  183. .I size
  184. by 2 for
  185. .BR w ,
  186. 512 for
  187. .BR b ,
  188. 1024 for
  189. .BR k ,
  190. and 1048576 for
  191. .BR m .
  192. .TP
  193. .B \-c
  194. Reverses the sense of patterns
  195. such that a file that does not match any of the patterns
  196. is selected.
  197. .TP
  198. .B \-d
  199. Causes
  200. .I pax
  201. to ignore files below directories.
  202. In read mode,
  203. patterns matching directories
  204. cause only the directory itself to extracted,
  205. files below will be ignored
  206. unless another pattern applies to them.
  207. In write mode,
  208. arguments or standard input lines referring to directories
  209. do not cause files below the respective directory
  210. to be archived.
  211. .TP
  212. \fB\-f\fI\ file\fR
  213. Selects a
  214. .I file
  215. that is read with the
  216. .I \-r
  217. option instead of standard input
  218. or written with the
  219. .I \-w
  220. option instead of standard output.
  221. .TP
  222. .B \-H
  223. Follow symbolic links given on the command line when reading files with
  224. .I \-w
  225. or
  226. .IR \-rw ,
  227. but do not follow symbolic links encountered during directory traversal.
  228. .TP
  229. .B \-i
  230. Rename files interactively.
  231. Before a file is extracted from the archive,
  232. its file name is printed on standard error
  233. and the user is prompted to specify a substitute file name.
  234. If the line read from the terminal is empty,
  235. the file is skipped;
  236. if the line consists of a single dot,
  237. the name is retained;
  238. otherwise,
  239. the line forms the new file name.
  240. .TP
  241. .B \-k
  242. Causes existing files not to be overwritten.
  243. .TP
  244. .B \-K
  245. Try to continue operation on read errors and invalid headers.
  246. If an archive contains another archive,
  247. files from either archive may be chosen.
  248. .TP
  249. .B \-l
  250. Link files instead of copying them with
  251. .I \-rw
  252. if possible.
  253. .TP
  254. .B \-L
  255. Follow symbolic links when reading files with
  256. .I \-w
  257. or
  258. .IR \-rw .
  259. .B /usr/posix2001/bin/pax
  260. terminates immediately when it
  261. detects a symbolic link loop with this option.
  262. .TP
  263. .B \-n
  264. If any
  265. .I pattern
  266. arguments are present,
  267. each pattern can match exactly one archive member;
  268. further members that could match the particular pattern are ignored.
  269. Without
  270. .I pattern
  271. arguments,
  272. only the first occurence of
  273. a file that occurs more than once in the archive
  274. is selected, the following are ignored.
  275. .TP
  276. \fB\-o\ \fIoption\fB,\fR[\fIoption\fB,\fR\|...]
  277. Specifies options as described for \fI\-x pax\fR.
  278. .TP
  279. \fB\-p\ \fIstring\fR
  280. Specifies which file modes are to be preserved or ignored.
  281. .I string
  282. may contain one or more of
  283. .RS
  284. .TP
  285. .B a
  286. Inhibits preservation of file access times.
  287. .TP
  288. .B e
  289. Causes preservation of every possible mode, ownership and time.
  290. .TP
  291. .B m
  292. Inhibits preservation of file modification times.
  293. .TP
  294. .B o
  295. Causes preservation of owner and group IDs.
  296. .TP
  297. .B p
  298. Causes preservation of file mode bits
  299. regardless of the umask
  300. (see
  301. .IR umask (2)).
  302. .RE
  303. .IP
  304. If file ownership is preserved,
  305. .I pax
  306. tries to set the group ownerships to those specified in the archive
  307. or the original hierarchy, respectively,
  308. regardless of the privilegues of the invoking user.
  309. .BR /usr/5bin/pax ,
  310. .BR /usr/5bin/s42/pax ,
  311. and
  312. .B /usr/5bin/posix/pax
  313. try to set the user ownerships only if invoked by the super-user;
  314. if invoked by regular users,
  315. .B /usr/5bin/posix2001/pax
  316. will produce an error for any file that is not owned by the invoking user.
  317. .TP
  318. \fB\-s\ /\fIregular expression\fB/\fIreplacement\fB/\fR[\fBgp\fR]
  319. Modifies file names in a manner similar to that described in
  320. .IR ed (1).
  321. The
  322. .I p
  323. flag causes each modified file name to printed.
  324. Any character can be used as delimiter instead of
  325. .RI ` / '.
  326. If a file name is empty after the replacement is done,
  327. the file is ignored.
  328. This option can be specified multiple times
  329. to execute multiple substitutions in the order specified.
  330. .TP
  331. .B \-t
  332. Resets the access times of files
  333. that were included in the archive with
  334. .IR \-r .
  335. .TP
  336. .B \-u
  337. In read mode,
  338. .I pax
  339. will not overwrite existing target files
  340. that were modified more recently than the file in the archive
  341. when this option is given.
  342. In write mode,
  343. .I pax
  344. will read the archive first.
  345. It will then only append those files to the archive
  346. that are not already included
  347. or were more recently modified.
  348. .TP
  349. .B \-v
  350. Prints the file names of archived or extracted files with
  351. .I \-r
  352. and
  353. .I \-w
  354. and a verbose output format
  355. if neither of them is given.
  356. .TP
  357. \fB\-x\fI header\fR
  358. Specifies the archive header format to be one of:
  359. .sp
  360. .in +6
  361. .TS
  362. lfB l.
  363. \fBnewc\fR SVR4 ASCII cpio format;\
  364. \fBcrc\fR SVR4 ASCII cpio format with checksum;\
  365. \fBsco\fR T{
  366. SCO UnixWare 7.1 ASCII cpio format;
  367. T}
  368. \fBscocrc\fR T{
  369. SCO UnixWare 7.1 ASCII cpio format with checksum;
  370. T}
  371. \fBodc\fR T{
  372. traditional ASCII cpio format, as standardized in IEEE Std. 1003.1, 1996;
  373. T}
  374. \fBcpio\fR T{
  375. same as \fIodc\fR;
  376. T}
  377. \fBbin\fR binary cpio format;
  378. \fBbbs\fR byte-swapped binary cpio format;
  379. \fBsgi\fR T{
  380. SGI IRIX extended binary cpio format;
  381. T}
  382. \fBcray\fR T{
  383. Cray UNICOS 9 cpio format;
  384. T}
  385. \fBcray5\fR T{
  386. Cray UNICOS 5 cpio format;
  387. T}
  388. \fBdec\fR T{
  389. Digital UNIX extended cpio format;
  390. T}
  391. \fBtar\fR tar format;
  392. \fBotar\fR old tar format;
  393. \fBustar\fR T{
  394. IEEE Std. 1003.1, 1996 tar format;
  395. T}
  396. .T&
  397. l s.
  398. \fBpax\fR[\fB:\fIoption\fB,\fR[\fIoption\fB,\fR\|...]]
  399. .T&
  400. l l.
  401. \& T{
  402. IEEE Std. 1003.1, 2001 pax format.
  403. Format-specific \fIoptions\fR are:
  404. .in +2n
  405. .ti 0
  406. .br
  407. \fBlinkdata\fR
  408. .br
  409. For a regular file which has multiple hard links,
  410. the file data is stored once for each link in the archive,
  411. instead of being stored for the first entry only.
  412. This option must be used with care
  413. since many implementations are unable
  414. to read the resulting archive.
  415. .ti 0
  416. .br
  417. \fBtimes\fR
  418. .br
  419. Causes the times of last access and last modification
  420. of each archived file
  421. to be stored in an extended \fIpax\fR header.
  422. This in particular allows the time of last access
  423. to be restored when the archive is read.
  424. .br
  425. .in -2n
  426. T}
  427. \fBsun\fR T{
  428. Sun Solaris 7 extended tar format;
  429. T}
  430. \fBbar\fR T{
  431. SunOS 4 bar format;
  432. T}
  433. \fBgnu\fR T{
  434. GNU tar format;
  435. T}
  436. \fBzip\fR[\fB:\fIcc\fR] T{
  437. zip format with optional compression method.
  438. If \fIcc\fR is one of
  439. \fBen\fR (normal, default),
  440. \fBex\fR (extra),
  441. \fBef\fR (fast),
  442. or
  443. \fBes\fR (super fast),
  444. the standard \fIdeflate\fR compression is used.
  445. \fBe0\fR selects no compression,
  446. and
  447. \fBbz2\fR selects \fIbzip2\fR compression.
  448. T}
  449. .TE
  450. .in -6
  451. .sp
  452. This option is ignored with
  453. .I \-r
  454. unless the
  455. .I \-K
  456. option is also present.
  457. The default for
  458. .I \-w
  459. is traditional ASCII cpio
  460. .I (odc)
  461. format.
  462. .PP
  463. .ne 38
  464. Characteristics of archive formats are as follows:
  465. .sp
  466. .TS
  467. allbox;
  468. l r r r l
  469. l1fB r2 n2 r2 c.
  470. T{
  471. .ad l
  472. maximum user/\%group id
  473. T} T{
  474. .ad l
  475. maximum file size
  476. T} T{
  477. .ad l
  478. maximum pathname length
  479. T} T{
  480. .ad l
  481. bits in dev_t (major/minor)
  482. T}
  483. \-x\ bin 65535 2 GB\ 256 \ 16
  484. \-x\ sgi 65535 9 EB\ 256 \ 14/18
  485. T{
  486. \-x\ odc
  487. T} 262143 8 GB\ 256 \ 18
  488. \-x\ dec 262143 8 GB\ 256 \ 24/24
  489. T{
  490. \-x\ newc,
  491. \-x\ crc
  492. T} 4.3e9 4 GB\ 1024 \ 32/32
  493. T{
  494. \-x\ sco, \-x\ scocrc
  495. T} 4.3e9 9 EB\ 1024 \ 32/32
  496. T{
  497. \-x\ cray, \-x\ cray5
  498. T} 1.8e19 9 EB\ 65535 \ 64
  499. \-x\ otar 2097151 8 GB\ 99 \ n/a
  500. T{
  501. \-x\ tar,
  502. \-x\ ustar
  503. T} 2097151 8 GB\ 256 (99) \ 21/21
  504. \-x\ pax 1.8e19 9 EB\ 65535 \ 21/21
  505. \-x\ sun 1.8e19 9 EB\ 65535 \ 63/63
  506. \-x\ gnu 1.8e19 9 EB\ 65535 \ 63/63
  507. \-x\ bar 2097151 8 GB\ 427 \ 21
  508. \-x\ zip 4.3e9 9 EB\ 60000 \ 32
  509. .TE
  510. .sp
  511. .PP
  512. The byte order of
  513. .B binary
  514. cpio archives
  515. depends on the machine
  516. on which the archive is created.
  517. Unlike some other implementations,
  518. .I pax
  519. fully supports
  520. archives of either byte order.
  521. .I \-x\ bbs
  522. can be used to create an archive
  523. with the byte order opposed to that of the current machine.
  524. .PP
  525. The
  526. .B sgi
  527. format extends the binary format
  528. to handle larger files and more device bits.
  529. If an archive does not contain any entries
  530. that actually need the extensions,
  531. it is identical to a binary archive.
  532. .I \-x\ sgi
  533. archives are always created in MSB order.
  534. .PP
  535. The
  536. .B odc
  537. format was introduced with System\ III
  538. and standardized with IEEE Std. 1003.1.
  539. All known
  540. .I cpio
  541. and
  542. .I pax
  543. implementations since around 1980 can read this format.
  544. .PP
  545. The
  546. .B dec
  547. format extends the
  548. .I odc
  549. format
  550. to support more device bits.
  551. Archives in this format are generally incompatible with
  552. .I odc
  553. archives
  554. and need special implementation support to be read.
  555. .PP
  556. The
  557. .B \-x\ newc
  558. format was introduced with System\ V Release\ 4.
  559. Except for the file size,
  560. it imposes no practical limitations
  561. on files archived.
  562. The original SVR4 implementation
  563. stores the contents of hard linked files
  564. only once and with the last archived link.
  565. This
  566. .I pax
  567. ensures compatibility with SVR4.
  568. With archives created by implementations that employ other methods
  569. for storing hard linked files,
  570. each file is extracted as a single link,
  571. and some of these files may be empty.
  572. Implementations that expect methods other than the original SVR4 one
  573. may extract no data for hard linked files at all.
  574. .PP
  575. The
  576. .B crc
  577. format is essentially the same as the
  578. .I \-x\ newc
  579. format
  580. but adds a simple checksum (not a CRC, despite its name)
  581. for the data of regular files.
  582. The checksum requires the implementation to read each file twice,
  583. which can considerably increase running time and system overhead.
  584. As not all implementations claiming to support this format
  585. handle the checksum correctly,
  586. it is of limited use.
  587. .PP
  588. The
  589. .B sco
  590. and
  591. .B scocrc
  592. formats are variants of the
  593. .I \-x\ newc
  594. and
  595. .I \-x\ crc
  596. formats, respectively,
  597. with extensions to support larger files.
  598. The extensions result in a different archive format
  599. only if files larger than slightly below 2\ GB occur.
  600. .PP
  601. The
  602. .B cray
  603. format extends all header fields to 64 bits.
  604. It thus imposes no practical limitations of any kind
  605. on archived files,
  606. but requires special implementation support
  607. to be read.
  608. Although it is originally a binary format,
  609. the byte order is always MSB as on Cray machines.
  610. The
  611. .B cray5
  612. format is an older variant
  613. that was used with UNICOS 5 and earlier.
  614. .PP
  615. The
  616. .B otar
  617. format was introduced with the Unix 7th Edition
  618. .I tar
  619. utility.
  620. Archives in this format
  621. can be read on all Unix systems since about 1980.
  622. It can only hold regular files
  623. (and, on more recent systems, symbolic links).
  624. For file names that contain characters with the most significant bit set
  625. (non-ASCII characters),
  626. implementations differ in the interpretation of the header checksum.
  627. .PP
  628. The
  629. .B ustar
  630. format was introduced with IEEE Std. 1003.1.
  631. It extends the old
  632. .I tar
  633. format
  634. with support for directories, device files,
  635. and longer file names.
  636. Pathnames of single-linked files can consist of up to 256 characters,
  637. dependent on the position of slashes.
  638. Files with multiple links can only be archived
  639. if the first link encountered is no longer than 100 characters.
  640. Due to implementation errors,
  641. file names longer than 99 characters
  642. can not considered to be generally portable.
  643. Another addition of the
  644. .I ustar
  645. format
  646. are fields for the symbolic user and group IDs.
  647. These fields are created by
  648. .IR pax ,
  649. but ignored when reading such archives.
  650. .PP
  651. With
  652. .BR "\-x tar" ,
  653. a variant of the
  654. .I ustar
  655. format is selected
  656. which stores file type bits in the mode field
  657. to work around common implementation problems.
  658. These bits are ignored by
  659. .I pax
  660. when reading archives.
  661. .PP
  662. The
  663. .B pax
  664. format is an extension to the
  665. .I ustar
  666. format.
  667. If attributes cannot be archived with
  668. .IR ustar ,
  669. an extended header is written.
  670. Unless the size of an entry is greater than 8\ GB,
  671. a
  672. .I pax
  673. archive should be readable by any implementation
  674. capable of reading
  675. .I ustar
  676. archives,
  677. although files may be extracted under wrong names
  678. and extended headers may be extracted as separate files.
  679. If a file name contains non-UTF-8 characters,
  680. it may not be archived or extracted correctly
  681. because of a problem of the
  682. .I pax
  683. format specification.
  684. .PP
  685. The
  686. .B sun
  687. format extends the
  688. .I ustar
  689. format similar as the
  690. .I pax
  691. format does.
  692. The extended headers in
  693. .I sun
  694. format archives are not understood
  695. by implementations that support only the
  696. .I pax
  697. format and vice-versa.
  698. The
  699. .I sun
  700. format has also problems with non-UTF-8 characters in file names.
  701. .PP
  702. The
  703. .B GNU
  704. .I tar
  705. format is mostly compatible with the other
  706. .I tar
  707. formats,
  708. unless an archive entry actually uses its extended features.
  709. There are no practical limitations on files archived with this format.
  710. The implementation of
  711. .I pax
  712. is limited to expanded numerical fields
  713. and long file names;
  714. in particular,
  715. there is no support for sparse files or incremental backups.
  716. If
  717. .I pax
  718. creates a multi-volume
  719. .I GNU
  720. archive,
  721. it just splits a single-volume archive in multiple parts,
  722. as with the other formats;
  723. .I GNU
  724. multi-volume archives are not supported.
  725. .PP
  726. The
  727. .B bar
  728. format is similar to the
  729. .I tar
  730. format, but can store longer file names.
  731. It requires special implementation support to be read.
  732. .PP
  733. The
  734. .B zip
  735. format can be read in many non-Unix environments.
  736. There are several restrictions on archives
  737. intended for data exchange:
  738. only regular files should be stored;
  739. file times, permissions and ownerships
  740. might be ignored by other implementations;
  741. there should be no more than 65536 files in the archive;
  742. the total archive size should not exceed 2 GB;
  743. only
  744. .I deflate
  745. compression should be used.
  746. Otherwise,
  747. .I pax
  748. stores all information available with other archive formats
  749. in extended
  750. .I zip
  751. file headers,
  752. so if archive portability is of no concern,
  753. the
  754. .I zip
  755. implementation in
  756. .I pax
  757. can archive complete Unix file hierarchies.
  758. .I Pax
  759. supports the
  760. .I zip64
  761. format extension for large files;
  762. it automatically writes
  763. .I zip64
  764. entries if necessary.
  765. .I Pax
  766. can extract all known
  767. .I zip
  768. format compression codes.
  769. It does not support
  770. .I zip
  771. encryption.
  772. Multi-volume
  773. .I zip
  774. archives are created as splitted single-volume archives,
  775. as with the other formats written by
  776. .IR pax ;
  777. generic multi-volume
  778. .I zip
  779. archives are not supported.
  780. .SH EXAMPLES
  781. Extract all files named
  782. .I Makefile
  783. or
  784. .I makefile
  785. from the archive stored on
  786. .IR /dev/rmt/c0s0 ,
  787. overwriting recent files:
  788. .RS 2
  789. .sp
  790. pax \-r \-f /dev/rmt/c0s0 \'[Mm]akefile\' \'*/[Mm]akefile\'
  791. .RE
  792. .PP
  793. List the files contained in a software distribution archive:
  794. .RS 2
  795. .sp
  796. pax \-v \-f distribution.tar.gz
  797. .RE
  798. .PP
  799. Write a
  800. .IR gzip (1)
  801. compressed
  802. .I ustar
  803. archive containing all files below the directory
  804. .I \%project
  805. to the file
  806. .IR \%project.tar.gz ,
  807. excluding all directories named
  808. .I CVS
  809. or
  810. .I SCCS
  811. and their contents:
  812. .RS 2
  813. .sp
  814. find project \-depth \-print | egrep \-v \'/(CVS|SCCS)(/|$)\' |
  815. .br
  816. pax \-wd \-x ustar | gzip \-c > project.tar.gz
  817. .RE
  818. .PP
  819. Copy the directory
  820. .I work
  821. and its contents
  822. to the directory
  823. .IR \%savedfiles ,
  824. preserving all file attributes:
  825. .RS 2
  826. .sp
  827. pax \-rw \-pe work savedfiles
  828. .RE
  829. .PP
  830. Self-extracting zip archives are not automatically recognized,
  831. but can normally be read using the
  832. .I \-K
  833. option, as with
  834. .RS 2
  835. .sp
  836. pax \-rK \-x zip \-f archive.exe
  837. .sp
  838. .RE
  839. .SH "ENVIRONMENT VARIABLES"
  840. .TP
  841. .BR LANG ", " LC_ALL
  842. See
  843. .IR locale (7).
  844. .TP
  845. .B LC_CTYPE
  846. Selects the mapping of bytes to characters
  847. used for matching patterns
  848. and regular expressions.
  849. .TP
  850. .B LC_TIME
  851. Sets the month names printed in list mode.
  852. .SH "SEE ALSO"
  853. cpio(1),
  854. find(1),
  855. tar(1)
  856. .SH DIAGNOSTICS
  857. .I Pax
  858. exits with
  859. .sp
  860. .TS
  861. l8fB l.
  862. 0 after successful operation;
  863. 1 on usage errors;
  864. 2 when operation was continued after minor errors;
  865. 3 on fatal error conditions.
  866. .TE
  867. .SH NOTES
  868. Device and inode numbers
  869. are used for hard link recognition
  870. with the various cpio formats.
  871. Since the header space cannot hold
  872. large numbers present in current file systems,
  873. devices and inode numbers are set on a per-archive basis.
  874. This enables hard link recognition with all cpio formats,
  875. but the link connection to files appended with
  876. .I \-a
  877. is not preserved.
  878. .PP
  879. If a numeric user or group id does not fit
  880. within the size of the header field in the selected format,
  881. files are stored with the user id (or group id, respectively)
  882. set to 60001.
  883. .PP
  884. Use of the
  885. .I \-a
  886. option with a
  887. .I zip
  888. format archive may cause data loss
  889. if the archive was not previously created by
  890. .I cpio
  891. or
  892. .I pax
  893. itself.
  894. .PP
  895. If the file names passed to
  896. .I "pax -w"
  897. begin with a slash character,
  898. absolute path names are stored in the archive
  899. and will be extracted to these path names later
  900. regardless of the current working directory.
  901. This is normally not advisable,
  902. and relative path names should be passed to
  903. .I pax
  904. only.
  905. The
  906. .I \-s
  907. option can be used to substitute relative for absolute path names
  908. and vice-versa.
  909. .PP
  910. .I Pax
  911. does not currently accept the
  912. \fB\-o delete\fR,
  913. \fB\-o exthdr.name\fR,
  914. \fB\-o globexthdr.name\fR,
  915. \fB\-o invalid\fR,
  916. \fB\-o listopt\fR,
  917. and
  918. \fB\-o keyword\fR
  919. options from POSIX.1-2001.