1*fc8533a3Saaron.\" $OpenBSD: pax.1,v 1.12 1999/05/23 14:10:48 aaron Exp $ 2df930be7Sderaadt.\" $NetBSD: pax.1,v 1.3 1995/03/21 09:07:37 cgd Exp $ 3df930be7Sderaadt.\" 4df930be7Sderaadt.\" Copyright (c) 1992 Keith Muller. 5df930be7Sderaadt.\" Copyright (c) 1992, 1993 6df930be7Sderaadt.\" The Regents of the University of California. All rights reserved. 7df930be7Sderaadt.\" 8df930be7Sderaadt.\" This code is derived from software contributed to Berkeley by 9df930be7Sderaadt.\" Keith Muller of the University of California, San Diego. 10df930be7Sderaadt.\" 11df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without 12df930be7Sderaadt.\" modification, are permitted provided that the following conditions 13df930be7Sderaadt.\" are met: 14df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright 15df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer. 16df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright 17df930be7Sderaadt.\" notice, this list of conditions and the following disclaimer in the 18df930be7Sderaadt.\" documentation and/or other materials provided with the distribution. 19df930be7Sderaadt.\" 3. All advertising materials mentioning features or use of this software 20df930be7Sderaadt.\" must display the following acknowledgement: 21df930be7Sderaadt.\" This product includes software developed by the University of 22df930be7Sderaadt.\" California, Berkeley and its contributors. 23df930be7Sderaadt.\" 4. Neither the name of the University nor the names of its contributors 24df930be7Sderaadt.\" may be used to endorse or promote products derived from this software 25df930be7Sderaadt.\" without specific prior written permission. 26df930be7Sderaadt.\" 27df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 28df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 29df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30df930be7Sderaadt.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 31df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 33df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 34df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 36df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 37df930be7Sderaadt.\" SUCH DAMAGE. 38df930be7Sderaadt.\" 39df930be7Sderaadt.\" @(#)pax.1 8.4 (Berkeley) 4/18/94 40df930be7Sderaadt.\" 41df930be7Sderaadt.Dd April 18, 1994 42df930be7Sderaadt.Dt PAX 1 43*fc8533a3Saaron.Os 44df930be7Sderaadt.Sh NAME 45df930be7Sderaadt.Nm pax 46df930be7Sderaadt.Nd read and write file archives and copy directory hierarchies 47df930be7Sderaadt.Sh SYNOPSIS 48189213daSderaadt.Nm pax 4907ba6642Sderaadt.Op Fl cdnvz 50df930be7Sderaadt.Bk -words 51df930be7Sderaadt.Op Fl f Ar archive 52df930be7Sderaadt.Ek 53df930be7Sderaadt.Bk -words 54df930be7Sderaadt.Op Fl s Ar replstr 55df930be7Sderaadt.Ar ... 56df930be7Sderaadt.Ek 57df930be7Sderaadt.Bk -words 58df930be7Sderaadt.Op Fl U Ar user 59df930be7Sderaadt.Ar ... 60df930be7Sderaadt.Ek 61df930be7Sderaadt.Bk -words 62df930be7Sderaadt.Op Fl G Ar group 63df930be7Sderaadt.Ar ... 64df930be7Sderaadt.Ek 65df930be7Sderaadt.Bk -words 66df930be7Sderaadt.Oo 67df930be7Sderaadt.Fl T 68df930be7Sderaadt.Op Ar from_date 69df930be7Sderaadt.Op Ar ,to_date 70df930be7Sderaadt.Oc 71df930be7Sderaadt.Ar ... 72df930be7Sderaadt.Ek 73df930be7Sderaadt.Op Ar pattern ... 74189213daSderaadt.Nm pax 75df930be7Sderaadt.Fl r 7607ba6642Sderaadt.Op Fl cdiknuvzDYZ 77df930be7Sderaadt.Bk -words 78df930be7Sderaadt.Op Fl f Ar archive 79df930be7Sderaadt.Ek 80df930be7Sderaadt.Bk -words 81df930be7Sderaadt.Op Fl o Ar options 82df930be7Sderaadt.Ar ... 83df930be7Sderaadt.Ek 84df930be7Sderaadt.Bk -words 85df930be7Sderaadt.Op Fl p Ar string 86df930be7Sderaadt.Ar ... 87df930be7Sderaadt.Ek 88df930be7Sderaadt.Bk -words 89df930be7Sderaadt.Op Fl s Ar replstr 90df930be7Sderaadt.Ar ... 91df930be7Sderaadt.Ek 92df930be7Sderaadt.Op Fl E Ar limit 93df930be7Sderaadt.Bk -words 94df930be7Sderaadt.Op Fl U Ar user 95df930be7Sderaadt.Ar ... 96df930be7Sderaadt.Ek 97df930be7Sderaadt.Bk -words 98df930be7Sderaadt.Op Fl G Ar group 99df930be7Sderaadt.Ar ... 100df930be7Sderaadt.Ek 101df930be7Sderaadt.Bk -words 102df930be7Sderaadt.Oo 103df930be7Sderaadt.Fl T 104df930be7Sderaadt.Op Ar from_date 105df930be7Sderaadt.Op Ar ,to_date 106df930be7Sderaadt.Oc 107df930be7Sderaadt.Ar ... 108df930be7Sderaadt.Ek 109df930be7Sderaadt.Op Ar pattern ... 110189213daSderaadt.Nm pax 111df930be7Sderaadt.Fl w 11207ba6642Sderaadt.Op Fl dituvzHLPX 113df930be7Sderaadt.Bk -words 114df930be7Sderaadt.Op Fl b Ar blocksize 115df930be7Sderaadt.Ek 116df930be7Sderaadt.Oo 117df930be7Sderaadt.Op Fl a 118df930be7Sderaadt.Op Fl f Ar archive 119df930be7Sderaadt.Oc 120df930be7Sderaadt.Bk -words 121df930be7Sderaadt.Op Fl x Ar format 122df930be7Sderaadt.Ek 123df930be7Sderaadt.Bk -words 124df930be7Sderaadt.Op Fl s Ar replstr 125df930be7Sderaadt.Ar ... 126df930be7Sderaadt.Ek 127df930be7Sderaadt.Bk -words 128df930be7Sderaadt.Op Fl o Ar options 129df930be7Sderaadt.Ar ... 130df930be7Sderaadt.Ek 131df930be7Sderaadt.Bk -words 132df930be7Sderaadt.Op Fl U Ar user 133df930be7Sderaadt.Ar ... 134df930be7Sderaadt.Ek 135df930be7Sderaadt.Bk -words 136df930be7Sderaadt.Op Fl G Ar group 137df930be7Sderaadt.Ar ... 138df930be7Sderaadt.Ek 139df930be7Sderaadt.Bk -words 140df930be7Sderaadt.Op Fl B Ar bytes 141df930be7Sderaadt.Ek 142df930be7Sderaadt.Bk -words 143df930be7Sderaadt.Oo 144df930be7Sderaadt.Fl T 145df930be7Sderaadt.Op Ar from_date 146df930be7Sderaadt.Op Ar ,to_date 147df930be7Sderaadt.Op Ar /[c][m] 148df930be7Sderaadt.Oc 149df930be7Sderaadt.Ar ... 150df930be7Sderaadt.Ek 151df930be7Sderaadt.Op Ar file ... 152189213daSderaadt.Nm pax 153df930be7Sderaadt.Fl r 154df930be7Sderaadt.Fl w 155df930be7Sderaadt.Op Fl diklntuvDHLPXYZ 156df930be7Sderaadt.Bk -words 157df930be7Sderaadt.Op Fl p Ar string 158df930be7Sderaadt.Ar ... 159df930be7Sderaadt.Ek 160df930be7Sderaadt.Bk -words 161df930be7Sderaadt.Op Fl s Ar replstr 162df930be7Sderaadt.Ar ... 163df930be7Sderaadt.Ek 164df930be7Sderaadt.Bk -words 165df930be7Sderaadt.Op Fl U Ar user 166df930be7Sderaadt.Ar ... 167df930be7Sderaadt.Ek 168df930be7Sderaadt.Bk -words 169df930be7Sderaadt.Op Fl G Ar group 170df930be7Sderaadt.Ar ... 171df930be7Sderaadt.Ek 172df930be7Sderaadt.Bk -words 173df930be7Sderaadt.Oo 174df930be7Sderaadt.Fl T 175df930be7Sderaadt.Op Ar from_date 176df930be7Sderaadt.Op Ar ,to_date 177df930be7Sderaadt.Op Ar /[c][m] 178df930be7Sderaadt.Oc 179df930be7Sderaadt.Ar ... 180df930be7Sderaadt.Ek 181df930be7Sderaadt.Op Ar file ... 182df930be7Sderaadt.Ar directory 183df930be7Sderaadt.Sh DESCRIPTION 184f11c8a18Saaron.Nm 185df930be7Sderaadtwill read, write, and list the members of an archive file, 186df930be7Sderaadtand will copy directory hierarchies. 187f11c8a18Saaron.Nm 188df930be7Sderaadtoperation is independent of the specific archive format, 189df930be7Sderaadtand supports a wide variety of different archive formats. 190df930be7SderaadtA list of supported archive formats can be found under the description of the 191df930be7Sderaadt.Fl x 192df930be7Sderaadtoption. 193df930be7Sderaadt.Pp 194df930be7SderaadtThe presence of the 195df930be7Sderaadt.Fl r 196df930be7Sderaadtand the 197df930be7Sderaadt.Fl w 198df930be7Sderaadtoptions specifies which of the following functional modes 199f11c8a18Saaron.Nm 200df930be7Sderaadtwill operate under: 201df930be7Sderaadt.Em list , read , write , 202df930be7Sderaadtand 203df930be7Sderaadt.Em copy . 204df930be7Sderaadt.Bl -tag -width 6n 205df930be7Sderaadt.It <none> 206df930be7Sderaadt.Em List . 207f11c8a18Saaron.Nm 208df930be7Sderaadtwill write to 209df930be7Sderaadt.Dv standard output 210df930be7Sderaadta table of contents of the members of the archive file read from 211df930be7Sderaadt.Dv standard input , 212df930be7Sderaadtwhose pathnames match the specified 213df930be7Sderaadt.Ar patterns . 214df930be7SderaadtThe table of contents contains one filename per line 215df930be7Sderaadtand is written using single line buffering. 216df930be7Sderaadt.It Fl r 217df930be7Sderaadt.Em Read . 218f11c8a18Saaron.Nm 219df930be7Sderaadtextracts the members of the archive file read from the 220df930be7Sderaadt.Dv standard input , 221df930be7Sderaadtwith pathnames matching the specified 222df930be7Sderaadt.Ar patterns . 223df930be7SderaadtThe archive format and blocking is automatically determined on input. 224df930be7SderaadtWhen an extracted file is a directory, the entire file hierarchy 225df930be7Sderaadtrooted at that directory is extracted. 226df930be7SderaadtAll extracted files are created relative to the current file hierarchy. 227df930be7SderaadtThe setting of ownership, access and modification times, and file mode of 228df930be7Sderaadtthe extracted files are discussed in more detail under the 229df930be7Sderaadt.Fl p 230df930be7Sderaadtoption. 231df930be7Sderaadt.It Fl w 232df930be7Sderaadt.Em Write . 233f11c8a18Saaron.Nm 234df930be7Sderaadtwrites an archive containing the 235df930be7Sderaadt.Ar file 236df930be7Sderaadtoperands to 237df930be7Sderaadt.Dv standard output 238df930be7Sderaadtusing the specified archive format. 239df930be7SderaadtWhen no 240df930be7Sderaadt.Ar file 241df930be7Sderaadtoperands are specified, a list of files to copy with one per line is read from 242df930be7Sderaadt.Dv standard input . 243df930be7SderaadtWhen a 244df930be7Sderaadt.Ar file 245df930be7Sderaadtoperand is also a directory, the entire file hierarchy rooted 246df930be7Sderaadtat that directory will be included. 247df930be7Sderaadt.It Fl r Fl w 248df930be7Sderaadt.Em Copy . 249f11c8a18Saaron.Nm 250df930be7Sderaadtcopies the 251df930be7Sderaadt.Ar file 252df930be7Sderaadtoperands to the destination 253df930be7Sderaadt.Ar directory . 254df930be7SderaadtWhen no 255df930be7Sderaadt.Ar file 256df930be7Sderaadtoperands are specified, a list of files to copy with one per line is read from 257df930be7Sderaadtthe 258df930be7Sderaadt.Dv standard input . 259df930be7SderaadtWhen a 260df930be7Sderaadt.Ar file 261df930be7Sderaadtoperand is also a directory the entire file 262df930be7Sderaadthierarchy rooted at that directory will be included. 263df930be7SderaadtThe effect of the 264df930be7Sderaadt.Em copy 265df930be7Sderaadtis as if the copied files were written to an archive file and then 266df930be7Sderaadtsubsequently extracted, except that there may be hard links between 267df930be7Sderaadtthe original and the copied files (see the 268df930be7Sderaadt.Fl l 269df930be7Sderaadtoption below). 270df930be7Sderaadt.Pp 271df930be7Sderaadt.Em Warning : 272df930be7SderaadtThe destination 273df930be7Sderaadt.Ar directory 274df930be7Sderaadtmust not be one of the 275df930be7Sderaadt.Ar file 276df930be7Sderaadtoperands or a member of a file hierarchy rooted at one of the 277df930be7Sderaadt.Ar file 278df930be7Sderaadtoperands. 279df930be7SderaadtThe result of a 280df930be7Sderaadt.Em copy 281df930be7Sderaadtunder these conditions is unpredictable. 282df930be7Sderaadt.El 283df930be7Sderaadt.Pp 284df930be7SderaadtWhile processing a damaged archive during a 285df930be7Sderaadt.Em read 286df930be7Sderaadtor 287df930be7Sderaadt.Em list 288df930be7Sderaadtoperation, 289f11c8a18Saaron.Nm 290df930be7Sderaadtwill attempt to recover from media defects and will search through the archive 291df930be7Sderaadtto locate and process the largest number of archive members possible (see the 292df930be7Sderaadt.Fl E 293df930be7Sderaadtoption for more details on error handling). 294df930be7Sderaadt.Sh OPERANDS 295df930be7SderaadtThe 296df930be7Sderaadt.Ar directory 297df930be7Sderaadtoperand specifies a destination directory pathname. 298df930be7SderaadtIf the 299df930be7Sderaadt.Ar directory 300df930be7Sderaadtoperand does not exist, or it is not writable by the user, 301df930be7Sderaadtor it is not of type directory, 302f11c8a18Saaron.Nm 303df930be7Sderaadtwill exit with a non-zero exit status. 304df930be7Sderaadt.Pp 305df930be7SderaadtThe 306df930be7Sderaadt.Ar pattern 307df930be7Sderaadtoperand is used to select one or more pathnames of archive members. 308df930be7SderaadtArchive members are selected using the pattern matching notation described 309df930be7Sderaadtby 310df930be7Sderaadt.Xr fnmatch 3 . 311df930be7SderaadtWhen the 312df930be7Sderaadt.Ar pattern 313df930be7Sderaadtoperand is not supplied, all members of the archive will be selected. 314df930be7SderaadtWhen a 315df930be7Sderaadt.Ar pattern 316df930be7Sderaadtmatches a directory, the entire file hierarchy rooted at that directory will 317df930be7Sderaadtbe selected. 318df930be7SderaadtWhen a 319df930be7Sderaadt.Ar pattern 320df930be7Sderaadtoperand does not select at least one archive member, 321f11c8a18Saaron.Nm 322df930be7Sderaadtwill write these 323df930be7Sderaadt.Ar pattern 324df930be7Sderaadtoperands in a diagnostic message to 325df930be7Sderaadt.Dv standard error 326df930be7Sderaadtand then exit with a non-zero exit status. 327df930be7Sderaadt.Pp 328df930be7SderaadtThe 329df930be7Sderaadt.Ar file 330df930be7Sderaadtoperand specifies the pathname of a file to be copied or archived. 331df930be7SderaadtWhen a 332df930be7Sderaadt.Ar file 333df930be7Sderaadtoperand does not select at least one archive member, 334f11c8a18Saaron.Nm 335df930be7Sderaadtwill write these 336df930be7Sderaadt.Ar file 337df930be7Sderaadtoperand pathnames in a diagnostic message to 338df930be7Sderaadt.Dv standard error 339df930be7Sderaadtand then exit with a non-zero exit status. 340df930be7Sderaadt.Sh OPTIONS 341df930be7SderaadtThe following options are supported: 342df930be7Sderaadt.Bl -tag -width 4n 343df930be7Sderaadt.It Fl r 344df930be7SderaadtRead an archive file from 345df930be7Sderaadt.Dv standard input 346df930be7Sderaadtand extract the specified 347df930be7Sderaadt.Ar files . 348df930be7SderaadtIf any intermediate directories are needed in order to extract an archive 349df930be7Sderaadtmember, these directories will be created as if 350df930be7Sderaadt.Xr mkdir 2 351df930be7Sderaadtwas called with the bitwise inclusive 352df930be7Sderaadt.Dv OR 353df930be7Sderaadtof 354df930be7Sderaadt.Dv S_IRWXU , S_IRWXG , 355df930be7Sderaadtand 356df930be7Sderaadt.Dv S_IRWXO 357df930be7Sderaadtas the mode argument. 358df930be7SderaadtWhen the selected archive format supports the specification of linked 359df930be7Sderaadtfiles and these files cannot be linked while the archive is being extracted, 360f11c8a18Saaron.Nm 361df930be7Sderaadtwill write a diagnostic message to 362df930be7Sderaadt.Dv standard error 363df930be7Sderaadtand exit with a non-zero exit status at the completion of operation. 364df930be7Sderaadt.It Fl w 365df930be7SderaadtWrite files to the 366df930be7Sderaadt.Dv standard output 367df930be7Sderaadtin the specified archive format. 368df930be7SderaadtWhen no 369df930be7Sderaadt.Ar file 370df930be7Sderaadtoperands are specified, 371df930be7Sderaadt.Dv standard input 372df930be7Sderaadtis read for a list of pathnames with one per line without any leading or 373df930be7Sderaadttrailing 374df930be7Sderaadt.Aq blanks . 375df930be7Sderaadt.It Fl a 376df930be7SderaadtAppend 377df930be7Sderaadt.Ar files 378df930be7Sderaadtto the end of an archive that was previously written. 379df930be7SderaadtIf an archive format is not specified with a 380df930be7Sderaadt.Fl x 381df930be7Sderaadtoption, the format currently being used in the archive will be selected. 382df930be7SderaadtAny attempt to append to an archive in a format different from the 383df930be7Sderaadtformat already used in the archive will cause 384f11c8a18Saaron.Nm 385df930be7Sderaadtto exit immediately 386df930be7Sderaadtwith a non-zero exit status. 387df930be7SderaadtThe blocking size used in the archive volume where writing starts 388df930be7Sderaadtwill continue to be used for the remainder of that archive volume. 389df930be7Sderaadt.Pp 390df930be7Sderaadt.Em Warning : 391df930be7SderaadtMany storage devices are not able to support the operations necessary 392df930be7Sderaadtto perform an append operation. 393df930be7SderaadtAny attempt to append to an archive stored on such a device may damage the 394df930be7Sderaadtarchive or have other unpredictable results. 395df930be7SderaadtTape drives in particular are more likely to not support an append operation. 396df930be7SderaadtAn archive stored in a regular file system file or on a disk device will 397df930be7Sderaadtusually support an append operation. 398df930be7Sderaadt.It Fl b Ar blocksize 399df930be7SderaadtWhen 400df930be7Sderaadt.Em writing 401df930be7Sderaadtan archive, 402df930be7Sderaadtblock the output at a positive decimal integer number of 403df930be7Sderaadtbytes per write to the archive file. 404df930be7SderaadtThe 405df930be7Sderaadt.Ar blocksize 406ea4b1a1aSmillertmust be a multiple of 512 bytes with a maximum of 64512 bytes. 407ea4b1a1aSmillertArchives larger than 32256 bytes violate the 408ea4b1a1aSmillert.Tn POSIX 409ea4b1a1aSmillertstandard and will not be portable to all systems. 410df930be7SderaadtA 411df930be7Sderaadt.Ar blocksize 412df930be7Sderaadtcan end with 413f81d96dfSaaron.Sq Li k 414df930be7Sderaadtor 415f81d96dfSaaron.Sq Li b 416df930be7Sderaadtto specify multiplication by 1024 (1K) or 512, respectively. 417df930be7SderaadtA pair of 418df930be7Sderaadt.Ar blocksizes 419df930be7Sderaadtcan be separated by 420f81d96dfSaaron.Sq Li x 421df930be7Sderaadtto indicate a product. 422df930be7SderaadtA specific archive device may impose additional restrictions on the size 423df930be7Sderaadtof blocking it will support. 424df930be7SderaadtWhen blocking is not specified, the default 425df930be7Sderaadt.Ar blocksize 426df930be7Sderaadtis dependent on the specific archive format being used (see the 427df930be7Sderaadt.Fl x 428df930be7Sderaadtoption). 429df930be7Sderaadt.It Fl c 430df930be7SderaadtMatch all file or archive members 431df930be7Sderaadt.Em except 432df930be7Sderaadtthose specified by the 433df930be7Sderaadt.Ar pattern 434df930be7Sderaadtand 435df930be7Sderaadt.Ar file 436df930be7Sderaadtoperands. 437df930be7Sderaadt.It Fl d 438df930be7SderaadtCause files of type directory being copied or archived, or archive members of 439df930be7Sderaadttype directory being extracted, to match only the directory file or archive 440df930be7Sderaadtmember and not the file hierarchy rooted at the directory. 441df930be7Sderaadt.It Fl f Ar archive 442df930be7SderaadtSpecify 443df930be7Sderaadt.Ar archive 444df930be7Sderaadtas the pathname of the input or output archive, overriding the default 445df930be7Sderaadt.Dv standard input 446df930be7Sderaadt(for 447df930be7Sderaadt.Em list 448df930be7Sderaadtand 449df930be7Sderaadt.Em read ) 450df930be7Sderaadtor 451df930be7Sderaadt.Dv standard output 452df930be7Sderaadt(for 453df930be7Sderaadt.Em write ) . 454df930be7SderaadtA single archive may span multiple files and different archive devices. 455df930be7SderaadtWhen required, 456f11c8a18Saaron.Nm 457df930be7Sderaadtwill prompt for the pathname of the file or device of the next volume in the 458df930be7Sderaadtarchive. 459df930be7Sderaadt.It Fl i 460df930be7SderaadtInteractively rename files or archive members. 461df930be7SderaadtFor each archive member matching a 462df930be7Sderaadt.Ar pattern 463df930be7Sderaadtoperand or each file matching a 464df930be7Sderaadt.Ar file 465df930be7Sderaadtoperand, 466f11c8a18Saaron.Nm 467df930be7Sderaadtwill prompt to 468df930be7Sderaadt.Pa /dev/tty 469df930be7Sderaadtgiving the name of the file, its file mode and its modification time. 470f11c8a18Saaron.Nm 471df930be7Sderaadtwill then read a line from 472df930be7Sderaadt.Pa /dev/tty . 473df930be7SderaadtIf this line is blank, the file or archive member is skipped. 474df930be7SderaadtIf this line consists of a single period, the 475df930be7Sderaadtfile or archive member is processed with no modification to its name. 476df930be7SderaadtOtherwise, its name is replaced with the contents of the line. 477f11c8a18Saaron.Nm 478df930be7Sderaadtwill immediately exit with a non-zero exit status if 479df930be7Sderaadt.Dv <EOF> 480df930be7Sderaadtis encountered when reading a response or if 481df930be7Sderaadt.Pa /dev/tty 482df930be7Sderaadtcannot be opened for reading and writing. 483df930be7Sderaadt.It Fl k 484df930be7SderaadtDo not overwrite existing files. 485df930be7Sderaadt.It Fl l 486b3119326Saaron(The lowercase letter 487b3119326Saaron.Dq ell. Ns ) 488b3119326SaaronLink files. 489df930be7SderaadtIn the 490df930be7Sderaadt.Em copy 491f81d96dfSaaronmode 492f81d96dfSaaron.Pq Fl r Fl w , 493df930be7Sderaadthard links are made between the source and destination file hierarchies 494df930be7Sderaadtwhenever possible. 495df930be7Sderaadt.It Fl n 496df930be7SderaadtSelect the first archive member that matches each 497df930be7Sderaadt.Ar pattern 498df930be7Sderaadtoperand. 499df930be7SderaadtNo more than one archive member is matched for each 500df930be7Sderaadt.Ar pattern . 501df930be7SderaadtWhen members of type directory are matched, the file hierarchy rooted at that 502df930be7Sderaadtdirectory is also matched (unless 503df930be7Sderaadt.Fl d 504df930be7Sderaadtis also specified). 505df930be7Sderaadt.It Fl o Ar options 506df930be7SderaadtInformation to modify the algorithm for extracting or writing archive files 507df930be7Sderaadtwhich is specific to the archive format specified by 508df930be7Sderaadt.Fl x . 509df930be7SderaadtIn general, 510df930be7Sderaadt.Ar options 511df930be7Sderaadttake the form: 512f11c8a18Saaron.Ar name Ns No = Ns Ar value . 513df930be7Sderaadt.It Fl p Ar string 514df930be7SderaadtSpecify one or more file characteristic options (privileges). 515df930be7SderaadtThe 516df930be7Sderaadt.Ar string 517df930be7Sderaadtoption-argument is a string specifying file characteristics to be retained or 518df930be7Sderaadtdiscarded on extraction. 519df930be7SderaadtThe string consists of the specification characters 520df930be7Sderaadt.Cm a , e , m , o , 521df930be7Sderaadtand 522df930be7Sderaadt.Cm p . 523df930be7SderaadtMultiple characteristics can be concatenated within the same string 524df930be7Sderaadtand multiple 525df930be7Sderaadt.Fl p 526df930be7Sderaadtoptions can be specified. 527df930be7SderaadtThe meaning of the specification characters are as follows: 528df930be7Sderaadt.Bl -tag -width 2n 529df930be7Sderaadt.It Cm a 530df930be7SderaadtDo not preserve file access times. 531df930be7SderaadtBy default, file access times are preserved whenever possible. 532df930be7Sderaadt.It Cm e 533df930be7Sderaadt.Sq Preserve everything , 534df930be7Sderaadtthe user ID, group ID, file mode bits, 535df930be7Sderaadtfile access time, and file modification time. 536df930be7SderaadtThis is intended to be used by 537df930be7Sderaadt.Em root , 538df930be7Sderaadtsomeone with all the appropriate privileges, in order to preserve all 539df930be7Sderaadtaspects of the files as they are recorded in the archive. 540df930be7SderaadtThe 541df930be7Sderaadt.Cm e 542df930be7Sderaadtflag is the sum of the 543df930be7Sderaadt.Cm o 544df930be7Sderaadtand 545df930be7Sderaadt.Cm p 546df930be7Sderaadtflags. 547df930be7Sderaadt.It Cm m 548df930be7SderaadtDo not preserve file modification times. 549df930be7SderaadtBy default, file modification times are preserved whenever possible. 550df930be7Sderaadt.It Cm o 551df930be7SderaadtPreserve the user ID and group ID. 552df930be7Sderaadt.It Cm p 553df930be7Sderaadt.Sq Preserve 554df930be7Sderaadtthe file mode bits. 555df930be7SderaadtThis intended to be used by a 556df930be7Sderaadt.Em user 557df930be7Sderaadtwith regular privileges who wants to preserve all aspects of the file other 558df930be7Sderaadtthan the ownership. 559df930be7SderaadtThe file times are preserved by default, but two other flags are offered to 560df930be7Sderaadtdisable this and use the time of extraction instead. 561df930be7Sderaadt.El 562df930be7Sderaadt.Pp 563df930be7SderaadtIn the preceding list, 564df930be7Sderaadt.Sq preserve 565df930be7Sderaadtindicates that an attribute stored in the archive is given to the 566df930be7Sderaadtextracted file, subject to the permissions of the invoking 567df930be7Sderaadtprocess. 568df930be7SderaadtOtherwise the attribute of the extracted file is determined as 569df930be7Sderaadtpart of the normal file creation action. 570df930be7SderaadtIf neither the 571df930be7Sderaadt.Cm e 572df930be7Sderaadtnor the 573df930be7Sderaadt.Cm o 574df930be7Sderaadtspecification character is specified, or the user ID and group ID are not 575df930be7Sderaadtpreserved for any reason, 576f11c8a18Saaron.Nm 577df930be7Sderaadtwill not set the 578df930be7Sderaadt.Dv S_ISUID 579df930be7Sderaadt.Em ( setuid ) 580df930be7Sderaadtand 581df930be7Sderaadt.Dv S_ISGID 582df930be7Sderaadt.Em ( setgid ) 583df930be7Sderaadtbits of the file mode. 584df930be7SderaadtIf the preservation of any of these items fails for any reason, 585f11c8a18Saaron.Nm 586df930be7Sderaadtwill write a diagnostic message to 587df930be7Sderaadt.Dv standard error . 588df930be7SderaadtFailure to preserve these items will affect the final exit status, 589df930be7Sderaadtbut will not cause the extracted file to be deleted. 590df930be7SderaadtIf the file characteristic letters in any of the string option-arguments are 591df930be7Sderaadtduplicated or conflict with each other, the one(s) given last will take 592df930be7Sderaadtprecedence. 593df930be7SderaadtFor example, if 594df930be7Sderaadt.Dl Fl p Ar eme 595df930be7Sderaadtis specified, file modification times are still preserved. 596df930be7Sderaadt.It Fl s Ar replstr 597df930be7SderaadtModify the file or archive member names specified by the 598df930be7Sderaadt.Ar pattern 599df930be7Sderaadtor 600df930be7Sderaadt.Ar file 601df930be7Sderaadtoperands according to the substitution expression 602df930be7Sderaadt.Ar replstr , 603df930be7Sderaadtusing the syntax of the 604df930be7Sderaadt.Xr ed 1 605df930be7Sderaadtutility regular expressions. 606df930be7SderaadtThe format of these regular expressions are: 607df930be7Sderaadt.Dl /old/new/[gp] 608df930be7SderaadtAs in 609df930be7Sderaadt.Xr ed 1 , 610df930be7Sderaadt.Cm old 611df930be7Sderaadtis a basic regular expression and 612df930be7Sderaadt.Cm new 613df930be7Sderaadtcan contain an ampersand (&), \\n (where n is a digit) back-references, 614df930be7Sderaadtor subexpression matching. 615df930be7SderaadtThe 616df930be7Sderaadt.Cm old 617df930be7Sderaadtstring may also contain 618df930be7Sderaadt.Dv <newline> 619df930be7Sderaadtcharacters. 620df930be7SderaadtAny non-null character can be used as a delimiter (/ is shown here). 621df930be7SderaadtMultiple 622df930be7Sderaadt.Fl s 623df930be7Sderaadtexpressions can be specified. 624df930be7SderaadtThe expressions are applied in the order they are specified on the 625df930be7Sderaadtcommand line, terminating with the first successful substitution. 626df930be7SderaadtThe optional trailing 627df930be7Sderaadt.Cm g 628df930be7Sderaadtcontinues to apply the substitution expression to the pathname substring 629df930be7Sderaadtwhich starts with the first character following the end of the last successful 630df930be7Sderaadtsubstitution. The first unsuccessful substitution stops the operation of the 631df930be7Sderaadt.Cm g 632df930be7Sderaadtoption. 633df930be7SderaadtThe optional trailing 634df930be7Sderaadt.Cm p 635df930be7Sderaadtwill cause the final result of a successful substitution to be written to 636df930be7Sderaadt.Dv standard error 637df930be7Sderaadtin the following format: 638df930be7Sderaadt.Dl <original pathname> >> <new pathname> 639df930be7SderaadtFile or archive member names that substitute to the empty string 640df930be7Sderaadtare not selected and will be skipped. 641df930be7Sderaadt.It Fl t 642df930be7SderaadtReset the access times of any file or directory read or accessed by 643f11c8a18Saaron.Nm 644df930be7Sderaadtto be the same as they were before being read or accessed by 645df930be7Sderaadt.Nm pax . 646df930be7Sderaadt.It Fl u 647df930be7SderaadtIgnore files that are older (having a less recent file modification time) 648df930be7Sderaadtthan a pre-existing file or archive member with the same name. 649df930be7SderaadtDuring 650df930be7Sderaadt.Em read , 651df930be7Sderaadtan archive member with the same name as a file in the file system will be 652df930be7Sderaadtextracted if the archive member is newer than the file. 653df930be7SderaadtDuring 654df930be7Sderaadt.Em write , 655df930be7Sderaadta file system member with the same name as an archive member will be 656df930be7Sderaadtwritten to the archive if it is newer than the archive member. 657df930be7SderaadtDuring 658df930be7Sderaadt.Em copy , 659df930be7Sderaadtthe file in the destination hierarchy is replaced by the file in the source 660df930be7Sderaadthierarchy or by a link to the file in the source hierarchy if the file in 661df930be7Sderaadtthe source hierarchy is newer. 662df930be7Sderaadt.It Fl v 663df930be7SderaadtDuring a 664df930be7Sderaadt.Em list 665df930be7Sderaadtoperation, produce a verbose table of contents using the format of the 666df930be7Sderaadt.Xr ls 1 667df930be7Sderaadtutility with the 668df930be7Sderaadt.Fl l 669df930be7Sderaadtoption. 670df930be7SderaadtFor pathnames representing a hard link to a previous member of the archive, 671df930be7Sderaadtthe output has the format: 672df930be7Sderaadt.Dl <ls -l listing> == <link name> 673df930be7SderaadtFor pathnames representing a symbolic link, the output has the format: 674df930be7Sderaadt.Dl <ls -l listing> => <link name> 675df930be7SderaadtWhere <ls -l listing> is the output format specified by the 676df930be7Sderaadt.Xr ls 1 677df930be7Sderaadtutility when used with the 678df930be7Sderaadt.Fl l 679df930be7Sderaadtoption. 680f81d96dfSaaronOtherwise for all the other operational modes 681f81d96dfSaaron.Po Em read , write , Li and Em copy 682f81d96dfSaaron.Pc , 683df930be7Sderaadtpathnames are written and flushed to 684df930be7Sderaadt.Dv standard error 685df930be7Sderaadtwithout a trailing 686df930be7Sderaadt.Dv <newline> 687df930be7Sderaadtas soon as processing begins on that file or 688df930be7Sderaadtarchive member. 689df930be7SderaadtThe trailing 690df930be7Sderaadt.Dv <newline> , 691df930be7Sderaadtis not buffered, and is written only after the file has been read or written. 692df930be7Sderaadt.It Fl x Ar format 693df930be7SderaadtSpecify the output archive format, with the default format being 694df930be7Sderaadt.Ar ustar . 695f11c8a18Saaron.Nm 696df930be7Sderaadtcurrently supports the following formats: 697df930be7Sderaadt.Bl -tag -width "sv4cpio" 698df930be7Sderaadt.It Ar cpio 699df930be7SderaadtThe extended cpio interchange format specified in the 700df930be7Sderaadt.St -p1003.2 701df930be7Sderaadtstandard. 702df930be7SderaadtThe default blocksize for this format is 5120 bytes. 703df930be7SderaadtInode and device information about a file (used for detecting file hard links 704df930be7Sderaadtby this format) which may be truncated by this format is detected by 705f11c8a18Saaron.Nm 706df930be7Sderaadtand is repaired. 707df930be7Sderaadt.It Ar bcpio 708df930be7SderaadtThe old binary cpio format. 709df930be7SderaadtThe default blocksize for this format is 5120 bytes. 710df930be7SderaadtThis format is not very portable and should not be used when other formats 711df930be7Sderaadtare available. 712df930be7SderaadtInode and device information about a file (used for detecting file hard links 713df930be7Sderaadtby this format) which may be truncated by this format is detected by 714f11c8a18Saaron.Nm 715df930be7Sderaadtand is repaired. 716df930be7Sderaadt.It Ar sv4cpio 717df930be7SderaadtThe System V release 4 cpio. 718df930be7SderaadtThe default blocksize for this format is 5120 bytes. 719df930be7SderaadtInode and device information about a file (used for detecting file hard links 720df930be7Sderaadtby this format) which may be truncated by this format is detected by 721f11c8a18Saaron.Nm 722df930be7Sderaadtand is repaired. 723df930be7Sderaadt.It Ar sv4crc 724df930be7SderaadtThe System V release 4 cpio with file crc checksums. 725df930be7SderaadtThe default blocksize for this format is 5120 bytes. 726df930be7SderaadtInode and device information about a file (used for detecting file hard links 727df930be7Sderaadtby this format) which may be truncated by this format is detected by 728f11c8a18Saaron.Nm 729df930be7Sderaadtand is repaired. 730df930be7Sderaadt.It Ar tar 731df930be7SderaadtThe old BSD tar format as found in BSD4.3. 732df930be7SderaadtThe default blocksize for this format is 10240 bytes. 733df930be7SderaadtPathnames stored by this format must be 100 characters or less in length. 734df930be7SderaadtOnly 735df930be7Sderaadt.Em regular 736df930be7Sderaadtfiles, 737df930be7Sderaadt.Em hard links , soft links , 738df930be7Sderaadtand 739df930be7Sderaadt.Em directories 740df930be7Sderaadtwill be archived (other file system types are not supported). 741df930be7SderaadtFor backwards compatibility with even older tar formats, a 742df930be7Sderaadt.Fl o 743df930be7Sderaadtoption can be used when writing an archive to omit the storage of directories. 744df930be7SderaadtThis option takes the form: 745df930be7Sderaadt.Dl Fl o Cm write_opt=nodir 746df930be7Sderaadt.It Ar ustar 747df930be7SderaadtThe extended tar interchange format specified in the 748df930be7Sderaadt.St -p1003.2 749df930be7Sderaadtstandard. 750df930be7SderaadtThe default blocksize for this format is 10240 bytes. 751df930be7SderaadtPathnames stored by this format must be 250 characters or less in length. 752df930be7Sderaadt.El 753df930be7Sderaadt.Pp 754f11c8a18Saaron.Nm 755df930be7Sderaadtwill detect and report any file that it is unable to store or extract 756df930be7Sderaadtas the result of any specific archive format restrictions. 757df930be7SderaadtThe individual archive formats may impose additional restrictions on use. 758df930be7SderaadtTypical archive format restrictions include (but are not limited to): 759f81d96dfSaaronfile pathname length, file size, link pathname length, and the type of the 760f81d96dfSaaronfile. 76107ba6642Sderaadt.It Fl z 76207ba6642SderaadtUse 76307ba6642Sderaadt.Xr gzip 1 76407ba6642Sderaadtto compress (decompress) the archive while writing (reading). 76507ba6642SderaadtIncompatible with 76607ba6642Sderaadt.Fl a . 767df930be7Sderaadt.It Fl B Ar bytes 768df930be7SderaadtLimit the number of bytes written to a single archive volume to 769df930be7Sderaadt.Ar bytes . 770df930be7SderaadtThe 771df930be7Sderaadt.Ar bytes 772df930be7Sderaadtlimit can end with 773f81d96dfSaaron.Sq Li m , 774f81d96dfSaaron.Sq Li k , 775df930be7Sderaadtor 776f81d96dfSaaron.Sq Li b 777df930be7Sderaadtto specify multiplication by 1048576 (1M), 1024 (1K) or 512, respectively. 778df930be7SderaadtA pair of 779df930be7Sderaadt.Ar bytes 780df930be7Sderaadtlimits can be separated by 781f81d96dfSaaron.Sq Li x 782df930be7Sderaadtto indicate a product. 783df930be7Sderaadt.Pp 784df930be7Sderaadt.Em Warning : 785df930be7SderaadtOnly use this option when writing an archive to a device which supports 786df930be7Sderaadtan end of file read condition based on last (or largest) write offset 787df930be7Sderaadt(such as a regular file or a tape drive). 788df930be7SderaadtThe use of this option with a floppy or hard disk is not recommended. 789df930be7Sderaadt.It Fl D 790df930be7SderaadtThis option is the same as the 791df930be7Sderaadt.Fl u 792df930be7Sderaadtoption, except that the file inode change time is checked instead of the 793df930be7Sderaadtfile modification time. 794df930be7SderaadtThe file inode change time can be used to select files whose inode information 795f81d96dfSaaron(e.g. UID, GID, etc.) is newer than a copy of the file in the destination 796df930be7Sderaadt.Ar directory . 797df930be7Sderaadt.It Fl E Ar limit 798df930be7SderaadtLimit the number of consecutive read faults while trying to read a flawed 799f81d96dfSaaronarchive to 800df930be7Sderaadt.Ar limit . 801df930be7SderaadtWith a positive 802df930be7Sderaadt.Ar limit , 803f11c8a18Saaron.Nm 804df930be7Sderaadtwill attempt to recover from an archive read error and will 805df930be7Sderaadtcontinue processing starting with the next file stored in the archive. 806df930be7SderaadtA 807df930be7Sderaadt.Ar limit 808df930be7Sderaadtof 0 will cause 809f11c8a18Saaron.Nm 810df930be7Sderaadtto stop operation after the first read error is detected on an archive volume. 811df930be7SderaadtA 812df930be7Sderaadt.Ar limit 813df930be7Sderaadtof 814df930be7Sderaadt.Li NONE 815df930be7Sderaadtwill cause 816f11c8a18Saaron.Nm 817df930be7Sderaadtto attempt to recover from read errors forever. 818df930be7SderaadtThe default 819df930be7Sderaadt.Ar limit 820df930be7Sderaadtis a small positive number of retries. 821df930be7Sderaadt.Pp 822df930be7Sderaadt.Em Warning: 823df930be7SderaadtUsing this option with 824df930be7Sderaadt.Li NONE 825df930be7Sderaadtshould be used with extreme caution as 826f11c8a18Saaron.Nm 827df930be7Sderaadtmay get stuck in an infinite loop on a very badly flawed archive. 828df930be7Sderaadt.It Fl G Ar group 829df930be7SderaadtSelect a file based on its 830df930be7Sderaadt.Ar group 831df930be7Sderaadtname, or when starting with a 832df930be7Sderaadt.Cm # , 833df930be7Sderaadta numeric gid. 834df930be7SderaadtA '\\' can be used to escape the 835df930be7Sderaadt.Cm # . 836df930be7SderaadtMultiple 837df930be7Sderaadt.Fl G 838df930be7Sderaadtoptions may be supplied and checking stops with the first match. 839df930be7Sderaadt.It Fl H 840df930be7SderaadtFollow only command line symbolic links while performing a physical file 841df930be7Sderaadtsystem traversal. 842df930be7Sderaadt.It Fl L 843df930be7SderaadtFollow all symbolic links to perform a logical file system traversal. 844df930be7Sderaadt.It Fl P 845df930be7SderaadtDo not follow symbolic links, perform a physical file system traversal. 846df930be7SderaadtThis is the default mode. 847df930be7Sderaadt.It Fl T Ar [from_date][,to_date][/[c][m]] 848df930be7SderaadtAllow files to be selected based on a file modification or inode change 849df930be7Sderaadttime falling within a specified time range of 850df930be7Sderaadt.Ar from_date 851df930be7Sderaadtto 852df930be7Sderaadt.Ar to_date 853df930be7Sderaadt(the dates are inclusive). 854df930be7SderaadtIf only a 855df930be7Sderaadt.Ar from_date 856df930be7Sderaadtis supplied, all files with a modification or inode change time 857df930be7Sderaadtequal to or younger are selected. 858df930be7SderaadtIf only a 859df930be7Sderaadt.Ar to_date 860df930be7Sderaadtis supplied, all files with a modification or inode change time 861df930be7Sderaadtequal to or older will be selected. 862df930be7SderaadtWhen the 863df930be7Sderaadt.Ar from_date 864df930be7Sderaadtis equal to the 865df930be7Sderaadt.Ar to_date , 866df930be7Sderaadtonly files with a modification or inode change time of exactly that 867df930be7Sderaadttime will be selected. 868df930be7Sderaadt.Pp 869df930be7SderaadtWhen 870f11c8a18Saaron.Nm 871df930be7Sderaadtis in the 872df930be7Sderaadt.Em write 873df930be7Sderaadtor 874df930be7Sderaadt.Em copy 875df930be7Sderaadtmode, the optional trailing field 876df930be7Sderaadt.Ar [c][m] 877df930be7Sderaadtcan be used to determine which file time (inode change, file modification or 878df930be7Sderaadtboth) are used in the comparison. 879df930be7SderaadtIf neither is specified, the default is to use file modification time only. 880df930be7SderaadtThe 881df930be7Sderaadt.Ar m 882df930be7Sderaadtspecifies the comparison of file modification time (the time when 883df930be7Sderaadtthe file was last written). 884df930be7SderaadtThe 885df930be7Sderaadt.Ar c 886df930be7Sderaadtspecifies the comparison of inode change time (the time when the file 887df930be7Sderaadtinode was last changed; e.g. a change of owner, group, mode, etc). 888df930be7SderaadtWhen 889df930be7Sderaadt.Ar c 890df930be7Sderaadtand 891df930be7Sderaadt.Ar m 892df930be7Sderaadtare both specified, then the modification and inode change times are 893df930be7Sderaadtboth compared. 894df930be7SderaadtThe inode change time comparison is useful in selecting files whose 895df930be7Sderaadtattributes were recently changed or selecting files which were recently 896df930be7Sderaadtcreated and had their modification time reset to an older time (as what 897df930be7Sderaadthappens when a file is extracted from an archive and the modification time 898df930be7Sderaadtis preserved). 899df930be7SderaadtTime comparisons using both file times is useful when 900f11c8a18Saaron.Nm 901df930be7Sderaadtis used to create a time based incremental archive (only files that were 902df930be7Sderaadtchanged during a specified time range will be archived). 903df930be7Sderaadt.Pp 904df930be7SderaadtA time range is made up of six different fields and each field must contain two 905df930be7Sderaadtdigits. 906df930be7SderaadtThe format is: 907df930be7Sderaadt.Dl [yy[mm[dd[hh]]]]mm[.ss] 908df930be7SderaadtWhere 909df930be7Sderaadt.Cm yy 910df930be7Sderaadtis the last two digits of the year, 911df930be7Sderaadtthe first 912df930be7Sderaadt.Cm mm 913df930be7Sderaadtis the month (from 01 to 12), 914df930be7Sderaadt.Cm dd 915df930be7Sderaadtis the day of the month (from 01 to 31), 916df930be7Sderaadt.Cm hh 917df930be7Sderaadtis the hour of the day (from 00 to 23), 918df930be7Sderaadtthe second 919df930be7Sderaadt.Cm mm 920df930be7Sderaadtis the minute (from 00 to 59), 921df930be7Sderaadtand 922df930be7Sderaadt.Cm ss 923df930be7Sderaadtis the seconds (from 00 to 59). 924df930be7SderaadtThe minute field 925df930be7Sderaadt.Cm mm 926df930be7Sderaadtis required, while the other fields are optional and must be added in the 927df930be7Sderaadtfollowing order: 928df930be7Sderaadt.Dl Cm hh , dd , mm , yy . 929df930be7SderaadtThe 930df930be7Sderaadt.Cm ss 931df930be7Sderaadtfield may be added independently of the other fields. 932df930be7SderaadtTime ranges are relative to the current time, so 933df930be7Sderaadt.Dl Fl T Ar 1234/cm 934df930be7Sderaadtwould select all files with a modification or inode change time 935df930be7Sderaadtof 12:34 PM today or later. 936df930be7SderaadtMultiple 937df930be7Sderaadt.Fl T 938df930be7Sderaadttime range can be supplied and checking stops with the first match. 939df930be7Sderaadt.It Fl U Ar user 940df930be7SderaadtSelect a file based on its 941df930be7Sderaadt.Ar user 942df930be7Sderaadtname, or when starting with a 943df930be7Sderaadt.Cm # , 944f81d96dfSaarona numeric UID. 945df930be7SderaadtA '\\' can be used to escape the 946df930be7Sderaadt.Cm # . 947df930be7SderaadtMultiple 948df930be7Sderaadt.Fl U 949df930be7Sderaadtoptions may be supplied and checking stops with the first match. 950df930be7Sderaadt.It Fl X 951df930be7SderaadtWhen traversing the file hierarchy specified by a pathname, 952df930be7Sderaadtdo not descend into directories that have a different device ID. 953df930be7SderaadtSee the 954df930be7Sderaadt.Li st_dev 955df930be7Sderaadtfield as described in 956df930be7Sderaadt.Xr stat 2 957f81d96dfSaaronfor more information about device IDs. 958df930be7Sderaadt.It Fl Y 959df930be7SderaadtThis option is the same as the 960df930be7Sderaadt.Fl D 961df930be7Sderaadtoption, except that the inode change time is checked using the 962df930be7Sderaadtpathname created after all the file name modifications have completed. 963df930be7Sderaadt.It Fl Z 964df930be7SderaadtThis option is the same as the 965df930be7Sderaadt.Fl u 966df930be7Sderaadtoption, except that the modification time is checked using the 967df930be7Sderaadtpathname created after all the file name modifications have completed. 968df930be7Sderaadt.El 969df930be7Sderaadt.Pp 970f81d96dfSaaronThe options that operate on the names of files or archive members 971f81d96dfSaaron.Po Fl c , 972df930be7Sderaadt.Fl i , 973df930be7Sderaadt.Fl n , 974df930be7Sderaadt.Fl s , 975df930be7Sderaadt.Fl u , 976df930be7Sderaadt.Fl v , 977df930be7Sderaadt.Fl D , 978df930be7Sderaadt.Fl G , 979df930be7Sderaadt.Fl T , 980df930be7Sderaadt.Fl U , 981df930be7Sderaadt.Fl Y , 982df930be7Sderaadtand 983f81d96dfSaaron.Fl Z 984f81d96dfSaaron.Pc 985df930be7Sderaadtinteract as follows. 986df930be7Sderaadt.Pp 987df930be7SderaadtWhen extracting files during a 988df930be7Sderaadt.Em read 989df930be7Sderaadtoperation, archive members are 990df930be7Sderaadt.Sq selected , 991df930be7Sderaadtbased only on the user specified pattern operands as modified by the 992df930be7Sderaadt.Fl c , 993df930be7Sderaadt.Fl n , 994df930be7Sderaadt.Fl u , 995df930be7Sderaadt.Fl D , 996df930be7Sderaadt.Fl G , 997df930be7Sderaadt.Fl T , 998df930be7Sderaadt.Fl U 999df930be7Sderaadtoptions. 1000df930be7SderaadtThen any 1001df930be7Sderaadt.Fl s 1002df930be7Sderaadtand 1003df930be7Sderaadt.Fl i 1004df930be7Sderaadtoptions will modify in that order, the names of these selected files. 1005df930be7SderaadtThen the 1006df930be7Sderaadt.Fl Y 1007df930be7Sderaadtand 1008df930be7Sderaadt.Fl Z 1009df930be7Sderaadtoptions will be applied based on the final pathname. 1010f81d96dfSaaronFinally, the 1011df930be7Sderaadt.Fl v 1012df930be7Sderaadtoption will write the names resulting from these modifications. 1013df930be7Sderaadt.Pp 1014df930be7SderaadtWhen archiving files during a 1015df930be7Sderaadt.Em write 1016df930be7Sderaadtoperation, or copying files during a 1017df930be7Sderaadt.Em copy 1018df930be7Sderaadtoperation, archive members are 1019df930be7Sderaadt.Sq selected , 1020df930be7Sderaadtbased only on the user specified pathnames as modified by the 1021df930be7Sderaadt.Fl n , 1022df930be7Sderaadt.Fl u , 1023df930be7Sderaadt.Fl D , 1024df930be7Sderaadt.Fl G , 1025df930be7Sderaadt.Fl T , 1026df930be7Sderaadtand 1027df930be7Sderaadt.Fl U 1028df930be7Sderaadtoptions (the 1029df930be7Sderaadt.Fl D 1030df930be7Sderaadtoption only applies during a copy operation). 1031df930be7SderaadtThen any 1032df930be7Sderaadt.Fl s 1033df930be7Sderaadtand 1034df930be7Sderaadt.Fl i 1035df930be7Sderaadtoptions will modify in that order, the names of these selected files. 1036df930be7SderaadtThen during a 1037df930be7Sderaadt.Em copy 1038df930be7Sderaadtoperation the 1039df930be7Sderaadt.Fl Y 1040df930be7Sderaadtand the 1041df930be7Sderaadt.Fl Z 1042df930be7Sderaadtoptions will be applied based on the final pathname. 1043f81d96dfSaaronFinally, the 1044df930be7Sderaadt.Fl v 1045df930be7Sderaadtoption will write the names resulting from these modifications. 1046df930be7Sderaadt.Pp 1047df930be7SderaadtWhen one or both of the 1048df930be7Sderaadt.Fl u 1049df930be7Sderaadtor 1050df930be7Sderaadt.Fl D 1051df930be7Sderaadtoptions are specified along with the 1052df930be7Sderaadt.Fl n 1053df930be7Sderaadtoption, a file is not considered selected unless it is newer 1054df930be7Sderaadtthan the file to which it is compared. 1055df930be7Sderaadt.Sh EXAMPLES 1056df930be7SderaadtThe command: 1057df930be7Sderaadt.Dl pax -w -f /dev/rst0 .\ 1058df930be7Sderaadtcopies the contents of the current directory to the device 1059df930be7Sderaadt.Pa /dev/rst0 . 1060df930be7Sderaadt.Pp 1061df930be7SderaadtThe command: 1062fa67a890Stholo.Dl pax -v -f filename 1063df930be7Sderaadtgives the verbose table of contents for an archive stored in 1064df930be7Sderaadt.Pa filename . 1065df930be7Sderaadt.Pp 1066df930be7SderaadtThe following commands: 1067df930be7Sderaadt.Dl mkdir newdir 1068df930be7Sderaadt.Dl cd olddir 1069df930be7Sderaadt.Dl pax -rw .\ newdir 1070df930be7Sderaadtwill copy the entire 1071df930be7Sderaadt.Pa olddir 1072df930be7Sderaadtdirectory hierarchy to 1073df930be7Sderaadt.Pa newdir . 1074df930be7Sderaadt.Pp 1075df930be7SderaadtThe command: 1076df930be7Sderaadt.Dl pax -r -s ',^//*usr//*,,' -f a.pax 1077df930be7Sderaadtreads the archive 1078df930be7Sderaadt.Pa a.pax , 1079b3119326Saaronwith all files rooted in 1080b3119326Saaron.Pa /usr 1081b3119326Saaroninto the archive extracted relative to the 1082df930be7Sderaadtcurrent directory. 1083df930be7Sderaadt.Pp 1084df930be7SderaadtThe command: 1085df930be7Sderaadt.Dl pax -rw -i .\ dest_dir 1086df930be7Sderaadtcan be used to interactively select the files to copy from the current 1087df930be7Sderaadtdirectory to 1088df930be7Sderaadt.Pa dest_dir . 1089df930be7Sderaadt.Pp 1090df930be7SderaadtThe command: 1091df930be7Sderaadt.Dl pax -r -pe -U root -G bin -f a.pax 1092df930be7Sderaadtwill extract all files from the archive 1093df930be7Sderaadt.Pa a.pax 1094df930be7Sderaadtwhich are owned by 1095df930be7Sderaadt.Em root 1096df930be7Sderaadtwith group 1097df930be7Sderaadt.Em bin 1098df930be7Sderaadtand will preserve all file permissions. 1099df930be7Sderaadt.Pp 1100df930be7SderaadtThe command: 1101df930be7Sderaadt.Dl pax -r -w -v -Y -Z home /backup 1102df930be7Sderaadtwill update (and list) only those files in the destination directory 1103df930be7Sderaadt.Pa /backup 1104df930be7Sderaadtwhich are older (less recent inode change or file modification times) than 1105df930be7Sderaadtfiles with the same name found in the source file tree 1106df930be7Sderaadt.Pa home . 1107df930be7Sderaadt.Sh STANDARDS 1108df930be7SderaadtThe 1109f11c8a18Saaron.Nm 1110df930be7Sderaadtutility is a superset of the 1111df930be7Sderaadt.St -p1003.2 1112df930be7Sderaadtstandard. 1113df930be7SderaadtThe options 1114df930be7Sderaadt.Fl B , 1115df930be7Sderaadt.Fl D , 1116df930be7Sderaadt.Fl E , 1117df930be7Sderaadt.Fl G , 1118df930be7Sderaadt.Fl H , 1119df930be7Sderaadt.Fl L , 1120df930be7Sderaadt.Fl P , 1121df930be7Sderaadt.Fl T , 1122df930be7Sderaadt.Fl U , 1123df930be7Sderaadt.Fl Y , 1124df930be7Sderaadt.Fl Z , 1125df930be7Sderaadtthe archive formats 1126df930be7Sderaadt.Ar bcpio , 1127df930be7Sderaadt.Ar sv4cpio , 1128df930be7Sderaadt.Ar sv4crc , 1129df930be7Sderaadt.Ar tar , 1130df930be7Sderaadtand the flawed archive handling during 1131df930be7Sderaadt.Ar list 1132df930be7Sderaadtand 1133df930be7Sderaadt.Ar read 1134df930be7Sderaadtoperations are extensions to the 1135df930be7Sderaadt.Tn POSIX 1136df930be7Sderaadtstandard. 113719e7eef2Stholo.Sh SEE ALSO 1138ca961342Saaron.Xr cpio 1 , 1139ca961342Saaron.Xr tar 1 1140df930be7Sderaadt.Sh AUTHOR 1141f81d96dfSaaronKeith Muller at the University of California, San Diego. 1142df930be7Sderaadt.Sh ERRORS 1143f11c8a18Saaron.Nm 1144df930be7Sderaadtwill exit with one of the following values: 1145df930be7Sderaadt.Bl -tag -width 2n 1146df930be7Sderaadt.It 0 1147df930be7SderaadtAll files were processed successfully. 1148df930be7Sderaadt.It 1 1149df930be7SderaadtAn error occurred. 1150df930be7Sderaadt.El 1151df930be7Sderaadt.Pp 1152df930be7SderaadtWhenever 1153f11c8a18Saaron.Nm 1154df930be7Sderaadtcannot create a file or a link when reading an archive or cannot 1155df930be7Sderaadtfind a file when writing an archive, or cannot preserve the user ID, 1156df930be7Sderaadtgroup ID, or file mode when the 1157df930be7Sderaadt.Fl p 1158df930be7Sderaadtoption is specified, a diagnostic message is written to 1159df930be7Sderaadt.Dv standard error 1160df930be7Sderaadtand a non-zero exit status will be returned, but processing will continue. 1161f81d96dfSaaronIn the case where 1162f11c8a18Saaron.Nm 1163f81d96dfSaaroncannot create a link to a file, 1164f11c8a18Saaron.Nm 1165df930be7Sderaadtwill not create a second copy of the file. 1166df930be7Sderaadt.Pp 1167df930be7SderaadtIf the extraction of a file from an archive is prematurely terminated by 1168df930be7Sderaadta signal or error, 1169f11c8a18Saaron.Nm 1170df930be7Sderaadtmay have only partially extracted a file the user wanted. 1171df930be7SderaadtAdditionally, the file modes of extracted files and directories 1172df930be7Sderaadtmay have incorrect file bits, and the modification and access times may be 1173df930be7Sderaadtwrong. 1174df930be7Sderaadt.Pp 1175df930be7SderaadtIf the creation of an archive is prematurely terminated by a signal or error, 1176f11c8a18Saaron.Nm 1177df930be7Sderaadtmay have only partially created the archive which may violate the specific 1178df930be7Sderaadtarchive format specification. 1179df930be7Sderaadt.Pp 1180df930be7SderaadtIf while doing a 1181df930be7Sderaadt.Em copy , 1182f11c8a18Saaron.Nm 1183df930be7Sderaadtdetects a file is about to overwrite itself, the file is not copied, 1184df930be7Sderaadta diagnostic message is written to 1185df930be7Sderaadt.Dv standard error 1186df930be7Sderaadtand when 1187f11c8a18Saaron.Nm 1188df930be7Sderaadtcompletes it will exit with a non-zero exit status. 1189