Fix typo in license headers
[oweals/cde.git] / cde / programs / dtksh / ksh93 / src / cmd / pax / pax.1.posix
1 \"
2 \" G. S. Fowler
3 \" AT&T Bell Laboratories
4 \"
5 \" @(#)pax.1 (ulysses!gsf) 08/08/88
6 \"
7 .TH PAX 1
8 .SH NAME
9 pax \- portable archive interchange
10 .SH SYNOPSIS
11 .B pax
12 [
13 .B \-rcimopuvy
14 ] [
15 .B \-f
16 .I archive
17 ] [
18 .B \-s
19 .RI / old / new /[gp]
20 ] [
21 .B \-t 
22 .I device
23 ] [
24 .I "pattern ..."
25 ]
26 .LP
27 .B pax
28 .B \-w
29 [
30 .B adimuvy
31 ] [
32 .B \-b
33 .I blocking
34 ] [
35 .B \-f
36 .I archive
37 ] [
38 .B \-s
39 .RI / old / new /[gp]
40 ] [
41 .B \-t 
42 .I device
43 ] [
44 .B \-x
45 .I format
46 ] [
47 .I "pathname ..."
48 ]
49 .LP
50 .B pax
51 .B \-rw
52 [
53 .B ilmopuvy
54 ] [
55 .B \-s
56 .RI / old / new /[gp]
57 ] [
58 .I "pathname ..."
59 ]
60 .I directory
61 .SH DESCRIPTION
62 .I pax
63 reads and writes archive files in the
64 .IR cpio (5)
65 and
66 .IR tar (5)
67 formats.
68 There are four operation modes controlled by combinations of the
69 .B \-r
70 and
71 .B \-w
72 options.
73 .PP
74 .B "pax \-w"
75 writes the files and directories named by the
76 .I pathname
77 arguments to the standard output together with
78 pathname and status information.
79 A directory
80 .I pathname
81 argument refers to the files and (recursively) subdirectories
82 of that directory.
83 If no
84 .I pathname
85 arguments are given then the standard input is read to get
86 a list of pathnames to copy, one pathname per line.
87 In this case only those pathnames appearing on the standard input are copied.
88 .PP
89 .B "pax \-r"
90 reads files from the standard input that is assumed
91 to be the result of a previous
92 .B "pax \-w"
93 command.
94 Only files with names that match any of the
95 .I pattern
96 arguments are selected.
97 A
98 .I pattern
99 is given in the name-generating notation of
100 .IR sh (1),
101 except that the
102 .B /
103 character is also matched.
104 The default if no
105 .I pattern
106 is given is
107 .BR * ,
108 which selects all files.
109 The selected files are conditionally created and copied relative
110 to the current directory tree, subject to the options described below.
111 By default the owner and group of selected files will be that of the
112 current user, and the permissions and modify times will be the same
113 as those in the archive.
114 If the
115 .B \-r
116 option is omitted then a table of contents of the selected files is
117 listed on the standard error.
118 .PP
119 .B "pax \-rw"
120 reads the files and directories named in the
121 .I pathname
122 arguments and copies them to the destination
123 .IR directory .
124 A directory
125 .I pathname
126 argument refers to the files and (recursively) subdirectories
127 of that directory.
128 If no
129 .I pathname
130 arguments are given then the standard input is read to get
131 a list of pathnames to copy, one pathname per line.
132 In this case only those pathnames appearing on the standard input are copied.
133 .I directory
134 must exist before the copy.
135 .PP
136 The standard archive formats are automatically detected on input.
137 The default output archive format is implementation defined,
138 but may be overridden by the
139 .B \-x
140 option described below.
141 .I pax
142 archives may be concatenated to combine multiple volumes on a single
143 tape or file.
144 This is accomplished by forcing any pad data to be null bytes.
145 .SS "Basic Options"
146 These options support basic archive operations.
147 .TP
148 .BI b " blocking"
149 Block the output at
150 .I blocking
151 bytes per record.
152 A
153 .B k
154 suffix multiplies
155 .I blocking
156 by 1024
157 and a
158 .B b
159 suffix multiplies
160 .I blocking
161 by 512.
162 .I blocking
163 is automatically determined on input and is ignored for
164 .BR \-rw .
165 The default
166 .I blocking
167 is
168 .B 10k
169 for block and character special archive files and
170 .B 1b
171 otherwise.
172 The minimum
173 .I blocking
174 is
175 .BR 1b .
176 .TP
177 .BI f " archive"
178 .I archive
179 is the pathname of the input or output archive, overriding the default
180 standard input for
181 .B \-r
182 or standard output for
183 .BR \-w .
184 .TP
185 .B m
186 File modification times are not retained.
187 .TP
188 .B o
189 Restore file ownership as specified in the archive.
190 The current user must have appropriate privileges.
191 .TP
192 \fBs\fP /\fIold\fP/\fInew\fP/[\fIgp\fP]
193 File names are mapped according
194 to the
195 .IR ed (1)
196 style substitution expression.
197 Any non-null character may be used as a delimiter
198 .RB ( /
199 shown here).
200 Multiple
201 .B \-s
202 expressions may be specified; the expressions are applied from left to right,
203 terminating with the first successful substitution.
204 The optional trailing
205 .B p
206 causes successful mappings to be listed on the standard error.
207 File names that substitute to the null string are ignored on
208 both input and output.
209 .TP
210 .B v
211 List file names as they are encountered.
212 Produces a verbose table of contents listing when both
213 .B \-r
214 and
215 .B \-w
216 are omitted.
217 .TP
218 .B x
219 Specifies the output archive
220 .IR format .
221 The input format, which must be one of the following,
222 is automatically determined.
223 The formats are:
224 .RS
225 .PD 0
226 .TP
227 .B cpio
228 The
229 .IR cpio (5)
230 character format.
231 .TP
232 .B tar
233 The
234 .IR tar (5)
235 format.
236 .TP
237 .B ustar
238 The proposed POSIX tar format.
239 .PD
240 .RE
241 .SS "Compatibility Options"
242 These options provide functional compatibility with the old
243 .IR cpio (1)
244 and
245 .IR tar (1)
246 commands.
247 .TP
248 .B a
249 For
250 .B \-w
251 append files to the end of the archive.
252 .TP
253 .B c
254 Complement the match sense of the
255 .I pattern
256 arguments.
257 .TP
258 .B d
259 Intermediate directories not explicitly listed in the archive
260 are not created.
261 .TP
262 .B i
263 Interactively
264 .I rename
265 files.
266 A file is skipped if a null line is entered and
267 .I pax
268 exits if
269 .B EOF
270 is encountered.
271 .TP
272 .B l
273 For
274 .BR \-rw ,
275 files are linked rather than copied when possible.
276 .TP
277 .B p
278 Preserve the access times of input files after they have been copied.
279 .TP
280 .BI t " device"
281 .I device
282 is an implementation defined identifier that names the
283 the input or output archive device, overriding the default
284 standard input for
285 .B \-r
286 or standard output for
287 .BR \-w .
288 .TP
289 .B u
290 Copy each file only if it is newer than a pre-existing file with the same name.
291 This option implies
292 .BR \-a .
293 .TP
294 .B y
295 Interactively prompt for the disposition of each file.
296 .B EOF
297 or an input line starting with
298 .B q
299 causes
300 .I pax
301 to exit.
302 Otherwise an input line starting with anything other than
303 .B y
304 causes the file to be ignored.
305 .SH DIAGNOSTICS
306 The number of files, blocks, and optionally the number of volumes and
307 media parts are listed on the standard error.
308 For
309 .B \-v
310 the input archive formats are also listed on the standard error.
311 .SH EXAMPLES
312 .TP
313 .B "pax \-w \-t 1m ."
314 Copies the contents of the current directory to tape drive 1, medium density.
315 .TP
316 .PD 0
317 .BI mkdir "  newdir"
318 .TP
319 .BI cd "  olddir"
320 .TP
321 .BI "pax  \-rw  ." "  newdir"
322 .PD
323 Copies the
324 .I olddir
325 directory hierarchy to
326 .IR newdir .
327 .SH "SEE ALSO"
328 ar(1), cpio(1), find(1), sh(1), tar(1), cpio(5), tar(5)
329 .SH BUGS
330 Special privileges may be required to copy special files.
331 .br
332 Each archive format has a hard upper limit on member pathname sizes.
333 .br
334 Device, user-id and group-id numbers larger than 65535 cause additional
335 header records to be output.
336 These records are ignored by old versions of
337 .IR cpio (1)
338 and
339 .IR tar (1).