| 1 |
.\" $MirOS: src/bin/pax/cpio.1,v 1.45 2024/01/05 02:08:48 tg Exp $ |
| 2 |
.\" $OpenBSD: cpio.1,v 1.35 2014/09/08 01:27:54 schwarze Exp $ |
| 3 |
.\" |
| 4 |
.\" Copyright © 2005, 2009, 2011, 2012, 2014, 2015, 2016, |
| 5 |
.\" 2017, 2018 |
| 6 |
.\" mirabilos <[email protected]> |
| 7 |
.\" Copyright (c) 1997 SigmaSoft, Th. Lockert |
| 8 |
.\" All rights reserved. |
| 9 |
.\" |
| 10 |
.\" Redistribution and use in source and binary forms, with or without |
| 11 |
.\" modification, are permitted provided that the following conditions |
| 12 |
.\" are met: |
| 13 |
.\" 1. Redistributions of source code must retain the above copyright |
| 14 |
.\" notice, this list of conditions and the following disclaimer. |
| 15 |
.\" 2. Redistributions in binary form must reproduce the above copyright |
| 16 |
.\" notice, this list of conditions and the following disclaimer in the |
| 17 |
.\" documentation and/or other materials provided with the distribution. |
| 18 |
.\" |
| 19 |
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 20 |
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 21 |
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 22 |
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 23 |
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 24 |
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 |
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 |
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 |
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 28 |
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 |
.\"- |
| 30 |
.\" $miros: contrib/samples/portmdoc,v 1.23 2024/01/04 22:52:50 tg Exp $ |
| 31 |
.\"- |
| 32 |
.\" Copyright © 2008, 2009, 2010, 2016, 2018, 2020, 2023 |
| 33 |
.\" mirabilos <[email protected]> |
| 34 |
.\" |
| 35 |
.\" Glue GNU groff (BSD and GNU mdoc both) to AT&T nroff (UCB mdoc). |
| 36 |
.\" * ` generates ‘ in gnroff, so use \` |
| 37 |
.\" * ' generates ’ in gnroff, \' generates ´, so use \*(aq |
| 38 |
.\" * - generates ‐ in gnroff, \- generates −, so .tr it to - |
| 39 |
.\" thus use - for hyphens and \- for minus signs and option dashes |
| 40 |
.\" * ~ is size-reduced and placed atop in groff, so use \*(TI |
| 41 |
.\" * ^ is size-reduced and placed atop in groff, so use \*(ha |
| 42 |
.\" * \(en does not work in nroff, so use \*(en for a solo en dash |
| 43 |
.\" * and \*(EM for a correctly spaced em dash |
| 44 |
.\" * <>| are problematic, so redefine and use \*(Lt\*(Gt\*(Ba |
| 45 |
.\" Also make sure to use \& *before* a punctuation char that is to not |
| 46 |
.\" be interpreted as punctuation, and especially with two-letter words |
| 47 |
.\" but also (after) a period that does not end a sentence (“e.g.\&”). |
| 48 |
.\"- |
| 49 |
.\" |
| 50 |
.\" Implement .Dd with the Mdocdate RCS keyword |
| 51 |
.\" |
| 52 |
.rn Dd xD |
| 53 |
.de Dd |
| 54 |
.ie \\$1$Mdocdate: \{\ |
| 55 |
. xD \\$2 \\$3, \\$4 |
| 56 |
.\} |
| 57 |
.el .xD \\$1 \\$2 \\$3 |
| 58 |
.. |
| 59 |
.\" |
| 60 |
.\" .Dd must come before most everything, because when called |
| 61 |
.\" with -mandoc it loads -mdoc via .so in .Dd (first macro). |
| 62 |
.\" |
| 63 |
.Dd $Mdocdate: January 5 2024 $ |
| 64 |
.\" |
| 65 |
.\" Check which macro package we use, and do other -mdoc setup. |
| 66 |
.\" |
| 67 |
.ie \n(.g \{\ |
| 68 |
. if n .ss \n[.ss] 0 |
| 69 |
. if \*[.T]ascii .tr \-\N'45' |
| 70 |
. if \*[.T]latin1 .tr \-\N'45' |
| 71 |
. if \*[.T]utf8 .tr \-\N'45' |
| 72 |
. if \*[.T]utf8 .tr \(la\*(Lt |
| 73 |
. if \*[.T]utf8 .tr \(ra\*(Gt |
| 74 |
. ds <= \(<= |
| 75 |
. ds >= \(>= |
| 76 |
. ds Rq \(rq |
| 77 |
. ds Lq \(lq |
| 78 |
. ds sL \(aq |
| 79 |
. ds sR \(aq |
| 80 |
. if \*[.T]utf8 .ds sL ` |
| 81 |
. if \*[.T]ps .ds sL ` |
| 82 |
. if \*[.T]utf8 .ds sR ' |
| 83 |
. if \*[.T]ps .ds sR ' |
| 84 |
. ds aq \(aq |
| 85 |
. ds TI \(ti |
| 86 |
. ds ha \(ha |
| 87 |
. ds en \(en |
| 88 |
. ie d volume-ds-1 .ds tT gnu |
| 89 |
. el .ie d doc-volume-ds-1 .ds tT gnp |
| 90 |
. el .ds tT bsd |
| 91 |
.\} |
| 92 |
.el \{\ |
| 93 |
. ds aq ' |
| 94 |
. ds TI ~ |
| 95 |
. ds ha ^ |
| 96 |
. ds en \(em |
| 97 |
. ds tT ucb |
| 98 |
.\} |
| 99 |
.ie n \{\ |
| 100 |
. ds EM \ \(em\ \& |
| 101 |
.\} |
| 102 |
.el \{\ |
| 103 |
. ds EM \f(TR\|\(em\|\fP |
| 104 |
.\} |
| 105 |
.\" |
| 106 |
.\" Add UCB mdoc compatibility to GNU mdoc |
| 107 |
.\" Implement .Mx (MirBSD) |
| 108 |
.\" |
| 109 |
.ie "\*(tT"gnu" \{\ |
| 110 |
. ds sP \s0 |
| 111 |
. ds tN \*[Tn-font-size] |
| 112 |
. eo |
| 113 |
. de Mx |
| 114 |
. nr curr-font \n[.f] |
| 115 |
. nr curr-size \n[.ps] |
| 116 |
. ds str-Mx \f[\n[curr-font]]\s[\n[curr-size]u] |
| 117 |
. ds str-Mx1 \*(tN\%MirBSD\*[str-Mx] |
| 118 |
. if !\n[arg-limit] \ |
| 119 |
. if \n[.$] \{\ |
| 120 |
. ds macro-name Mx |
| 121 |
. parse-args \$@ |
| 122 |
. \} |
| 123 |
. if (\n[arg-limit] > \n[arg-ptr]) \{\ |
| 124 |
. nr arg-ptr +1 |
| 125 |
. ie (\n[type\n[arg-ptr]] == 2) \ |
| 126 |
. ds str-Mx1 \*(tN\%MirBSD\~#\*[arg\n[arg-ptr]]\*[str-Mx] |
| 127 |
. el \ |
| 128 |
. nr arg-ptr -1 |
| 129 |
. \} |
| 130 |
. ds arg\n[arg-ptr] "\*[str-Mx1] |
| 131 |
. nr type\n[arg-ptr] 2 |
| 132 |
. ds space\n[arg-ptr] "\*[space] |
| 133 |
. nr num-args (\n[arg-limit] - \n[arg-ptr]) |
| 134 |
. nr arg-limit \n[arg-ptr] |
| 135 |
. if \n[num-args] \ |
| 136 |
. parse-space-vector |
| 137 |
. print-recursive |
| 138 |
.. |
| 139 |
. de Aq |
| 140 |
. if !\n[arg-limit] \ |
| 141 |
. ds macro-name Aq |
| 142 |
. ie \n[in-authors-section] \{\ |
| 143 |
. ds quote-left \*(Lt |
| 144 |
. ds quote-right \*(Gt |
| 145 |
. \} |
| 146 |
. el \{\ |
| 147 |
. ds quote-left \[la] |
| 148 |
. ds quote-right \[ra] |
| 149 |
. \} |
| 150 |
. enclose-string \$@ |
| 151 |
.. |
| 152 |
. ec |
| 153 |
.\} |
| 154 |
.el .ie "\*(tT"gnp" \{\ |
| 155 |
. ds sP \s0 |
| 156 |
. ie t .ds tN \s[(\n[.ps]u-1z)] |
| 157 |
. el .ds tN |
| 158 |
. eo |
| 159 |
. de Mx |
| 160 |
. nr doc-curr-font \n[.f] |
| 161 |
. nr doc-curr-size \n[.ps] |
| 162 |
. ds doc-str-Mx \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u] |
| 163 |
. ds doc-str-Mx1 \*(tN\%MirBSD\*[doc-str-Mx] |
| 164 |
. if !\n[doc-arg-limit] \ |
| 165 |
. if \n[.$] \{\ |
| 166 |
. ds doc-macro-name Mx |
| 167 |
. doc-parse-args \$@ |
| 168 |
. \} |
| 169 |
. if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\ |
| 170 |
. nr doc-arg-ptr +1 |
| 171 |
. ie (\n[doc-type\n[doc-arg-ptr]] == 2) \ |
| 172 |
. ds doc-str-Mx1 \*(tN\%MirBSD\~#\*[doc-arg\n[doc-arg-ptr]]\*[doc-str-Mx] |
| 173 |
. el \ |
| 174 |
. nr doc-arg-ptr -1 |
| 175 |
. \} |
| 176 |
. ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Mx1] |
| 177 |
. nr doc-type\n[doc-arg-ptr] 2 |
| 178 |
. ds doc-space\n[doc-arg-ptr] "\*[doc-space] |
| 179 |
. nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr]) |
| 180 |
. nr doc-arg-limit \n[doc-arg-ptr] |
| 181 |
. if \n[doc-num-args] \ |
| 182 |
. doc-parse-space-vector |
| 183 |
. doc-print-recursive |
| 184 |
.. |
| 185 |
. ec |
| 186 |
.\} |
| 187 |
.el \{\ |
| 188 |
. de Mx |
| 189 |
. nr cF \\n(.f |
| 190 |
. nr cZ \\n(.s |
| 191 |
. ds aa \&\f\\n(cF\s\\n(cZ |
| 192 |
. if \\n(aC==0 \{\ |
| 193 |
. ie \\n(.$==0 \&\\*(tNMirBSD\\*(aa |
| 194 |
. el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 |
| 195 |
. \} |
| 196 |
. if \\n(aC>\\n(aP \{\ |
| 197 |
. nr aP \\n(aP+1 |
| 198 |
. ie \\n(C\\n(aP==2 \{\ |
| 199 |
. nr xX 0 |
| 200 |
. nr xX 1+\\*(A\\n(aP |
| 201 |
. as b1 \&\\*(tNMirBSD\ \& |
| 202 |
. if \\n(xX>0 .as b1 #\& |
| 203 |
. as b1 \&\\*(A\\n(aP\\*(aa |
| 204 |
. rr xX |
| 205 |
. ie \\n(aC>\\n(aP \{\ |
| 206 |
. nr aP \\n(aP+1 |
| 207 |
. nR |
| 208 |
. \} |
| 209 |
. el .aZ |
| 210 |
. \} |
| 211 |
. el \{\ |
| 212 |
. as b1 \&\\*(tNMirBSD\\*(aa |
| 213 |
. nR |
| 214 |
. \} |
| 215 |
. \} |
| 216 |
.. |
| 217 |
.\} |
| 218 |
.\" </MirCVS://contrib/samples/portmdoc> |
| 219 |
.\"- |
| 220 |
.ie \ng==1 \{\ |
| 221 |
. ds nc mircpio |
| 222 |
. ds np mirpax |
| 223 |
. ds nt mirtar |
| 224 |
. ds nm mircpio |
| 225 |
. Dt MIRCPIO 1 |
| 226 |
.\} |
| 227 |
.el .ie \ng==2 \{\ |
| 228 |
. ds nc paxcpio |
| 229 |
. ds np pax |
| 230 |
. ds nt paxtar |
| 231 |
. ds nm paxcpio |
| 232 |
. Dt PAXCPIO 1 |
| 233 |
.\} |
| 234 |
.el \{\ |
| 235 |
. ds nc cpio |
| 236 |
. ds np pax |
| 237 |
. ds nt tar |
| 238 |
. ds nm cpio |
| 239 |
. Dt CPIO 1 |
| 240 |
.\} |
| 241 |
.\"- |
| 242 |
.Os MirBSD |
| 243 |
.Sh NAME |
| 244 |
.ie \ng==1 \{\ |
| 245 |
.Nm mircpio |
| 246 |
.Nd copy file archives in and out |
| 247 |
.\} |
| 248 |
.el .ie \ng==2 \{\ |
| 249 |
.Nm paxcpio |
| 250 |
.Nd copy file archives in and out |
| 251 |
.\} |
| 252 |
.el \{\ |
| 253 |
.Nm cpio |
| 254 |
.Nd copy file archives in and out |
| 255 |
.\} |
| 256 |
.Sh SYNOPSIS |
| 257 |
.Bk -words |
| 258 |
.Nm \*(nm |
| 259 |
.Fl o |
| 260 |
.Op Fl 0AaBcJjLVvZz |
| 261 |
.Op Fl C Ar bytes |
| 262 |
.Op Fl F Ar archive |
| 263 |
.Op Fl H Ar format |
| 264 |
.Op Fl M Ar flag |
| 265 |
.Op Fl O Ar archive |
| 266 |
.No \*(Lt Ar name-list |
| 267 |
.Op \*(Gt Ar archive |
| 268 |
.Nm \*(nm |
| 269 |
.Fl i |
| 270 |
.Op Fl 06BbcdfJjmrSstuVvZz |
| 271 |
.Op Fl C Ar bytes |
| 272 |
.Op Fl E Ar file |
| 273 |
.Op Fl F Ar archive |
| 274 |
.Op Fl H Ar format |
| 275 |
.Op Fl I Ar archive |
| 276 |
.Op Fl M Ar flag |
| 277 |
.Op Ar pattern ... |
| 278 |
.Op \*(Lt Ar archive |
| 279 |
.Nm \*(nm |
| 280 |
.Fl p |
| 281 |
.Op Fl 0adLlmuVv |
| 282 |
.Ar destination-directory |
| 283 |
.No \*(Lt Ar name-list |
| 284 |
.Ek |
| 285 |
.Sh DESCRIPTION |
| 286 |
The |
| 287 |
.Nm |
| 288 |
command copies files to and from a |
| 289 |
.Nm cpio |
| 290 |
archive. |
| 291 |
.Pp |
| 292 |
The options are as follows: |
| 293 |
.Bl -tag -width Ds |
| 294 |
.It Fl 0 |
| 295 |
Use the NUL |
| 296 |
.Pq Ql \e0 |
| 297 |
character as a pathname terminator, instead of newline |
| 298 |
.Pq Ql \en . |
| 299 |
This applies only to the pathnames read from standard input in |
| 300 |
the write and copy modes, |
| 301 |
and to the pathnames written to standard output in list mode. |
| 302 |
This option is expected to be used in concert with the |
| 303 |
.Fl print0 |
| 304 |
function in |
| 305 |
.Xr find 1 , |
| 306 |
the |
| 307 |
.Fl d Ar \*(aq\*(aq |
| 308 |
option to the |
| 309 |
.Ic read |
| 310 |
built-in utility of |
| 311 |
.Xr mksh 1 |
| 312 |
or the |
| 313 |
.Fl 0 |
| 314 |
flag in |
| 315 |
.Xr xargs 1 . |
| 316 |
.It Fl o |
| 317 |
Create an archive. |
| 318 |
Reads the list of files to store in the |
| 319 |
archive from standard input, and writes the archive on standard |
| 320 |
output. |
| 321 |
.Bl -tag -width Ds |
| 322 |
.It Fl A |
| 323 |
Append to the specified archive. |
| 324 |
.It Fl a |
| 325 |
Reset the access times on files that have been copied to the |
| 326 |
archive. |
| 327 |
.It Fl B |
| 328 |
Set block size of output to 5120 bytes. |
| 329 |
.It Fl C Ar bytes |
| 330 |
Set the block size of output to |
| 331 |
.Ar bytes . |
| 332 |
.It Fl c |
| 333 |
Use ASCII format for |
| 334 |
.Nm cpio |
| 335 |
header for portability. |
| 336 |
.It Fl F Ar archive |
| 337 |
Use the specified file as the input for the archive. |
| 338 |
.It Fl H Ar format |
| 339 |
Write the archive in the specified format. |
| 340 |
Recognised formats are: |
| 341 |
.Pp |
| 342 |
.Bl -tag -width sv4cpio -compact |
| 343 |
.It Ar ar |
| 344 |
Unix Archiver. |
| 345 |
.It Ar bcpio |
| 346 |
Old binary |
| 347 |
.Nm cpio |
| 348 |
format. |
| 349 |
Selected by |
| 350 |
.Fl 6 . |
| 351 |
.It Ar cpio |
| 352 |
Old octal character |
| 353 |
.Nm cpio |
| 354 |
format. |
| 355 |
Selected by |
| 356 |
.Fl c . |
| 357 |
.It Ar sv4cpio |
| 358 |
SVR4 hex |
| 359 |
.Nm cpio |
| 360 |
format. |
| 361 |
.It Ar sv4crc |
| 362 |
SVR4 hex |
| 363 |
.Nm cpio |
| 364 |
format with checksums. |
| 365 |
This is the default format for creating new archives. |
| 366 |
.It Ar tar |
| 367 |
Old tar format. |
| 368 |
.It Ar ustar |
| 369 |
POSIX ustar format. |
| 370 |
.It "\ " |
| 371 |
.It Ar bin |
| 372 |
These four formats...\& |
| 373 |
.It Ar crc |
| 374 |
\&...are supported...\& |
| 375 |
.It Ar newc |
| 376 |
\&...for backwards...\& |
| 377 |
.It Ar odc |
| 378 |
\&...compatibility only. |
| 379 |
.El |
| 380 |
.It Fl J |
| 381 |
Use the xz utility to compress the archive. |
| 382 |
.It Fl j |
| 383 |
Use the bzip2 utility to compress the archive. |
| 384 |
.It Fl L |
| 385 |
Follow symbolic links. |
| 386 |
.It Fl M Ar flag |
| 387 |
Configure the archive normaliser. |
| 388 |
.Ar flag |
| 389 |
is either a numeric value compatible to |
| 390 |
.Xr strtonum 3 |
| 391 |
which is directly stored in the flags word, or |
| 392 |
one of the following values, optionally prefixed with |
| 393 |
.Dq no\- |
| 394 |
to turn them off: |
| 395 |
.Pp |
| 396 |
.Bl -tag -width xxxxxx -compact |
| 397 |
.It Ar inodes |
| 398 |
0x0001: Serialise inodes, zero device info. |
| 399 |
.br |
| 400 |
(cpio, sv4cpio, sv4crc) |
| 401 |
.It Ar links |
| 402 |
0x0002: Store content of hard links only once. |
| 403 |
.br |
| 404 |
(cpio, sv4cpio, sv4crc) |
| 405 |
.It Ar mtime |
| 406 |
0x0004: Zero out the file modification time. |
| 407 |
.br |
| 408 |
(ar, cpio, sv4cpio, sv4crc, ustar) |
| 409 |
.It Ar uidgid |
| 410 |
0x0008: Set owner to 0:0 |
| 411 |
.Pq Li root Ns : Ns Li wheel . |
| 412 |
.br |
| 413 |
(ar, cpio, sv4cpio, sv4crc, ustar) |
| 414 |
.It Ar verb |
| 415 |
0x0010: Debug this option. |
| 416 |
.It Ar debug |
| 417 |
0x0020: Debug file header storage. |
| 418 |
.It Ar lncp |
| 419 |
0x0040: Extract hard links by copy if link fails. |
| 420 |
.It Ar numid |
| 421 |
0x0080: Use only numeric uid and gid values. |
| 422 |
.br |
| 423 |
(ustar) |
| 424 |
.It Ar gslash |
| 425 |
0x0100: Append a slash after directory names. |
| 426 |
.br |
| 427 |
(ustar) |
| 428 |
.It Ar set |
| 429 |
0x0003: Keep ownership and mtime intact. |
| 430 |
.It Ar dist |
| 431 |
0x008B: Clean everything except mtime. |
| 432 |
.It Ar norm |
| 433 |
0x008F: Clean everything. |
| 434 |
.It Ar root |
| 435 |
0x0089: Clean owner and device information. |
| 436 |
.El |
| 437 |
.Pp |
| 438 |
When creating an archive and verbosely listing output, these |
| 439 |
normalisation operations are not reflected in the output, |
| 440 |
because they are made only after the output has been shown. |
| 441 |
.Pp |
| 442 |
This option is only implemented for the ar, cpio, sv4cpio, |
| 443 |
sv4crc, and ustar file format writing routines. |
| 444 |
.It Fl O Ar archive |
| 445 |
Use the specified file name as the archive to write to. |
| 446 |
.It Fl V |
| 447 |
Print a dot |
| 448 |
.Pq Sq \&. |
| 449 |
for each file written to the archive. |
| 450 |
.It Fl v |
| 451 |
Be verbose about operations. |
| 452 |
List filenames as they are written to the archive. |
| 453 |
.It Fl Z |
| 454 |
Use the |
| 455 |
.Xr compress 1 |
| 456 |
utility to compress the archive. |
| 457 |
.It Fl z |
| 458 |
Use the |
| 459 |
.Xr gzip 1 |
| 460 |
utility to compress the archive. |
| 461 |
.El |
| 462 |
.It Fl i |
| 463 |
Restore files from an archive. |
| 464 |
Reads the archive file from |
| 465 |
standard input and extracts files matching the |
| 466 |
.Ar patterns |
| 467 |
that were specified on the command line. |
| 468 |
.Bl -tag -width Ds |
| 469 |
.It Fl 6 |
| 470 |
Process old-style |
| 471 |
.Nm cpio |
| 472 |
format archives. |
| 473 |
.It Fl B |
| 474 |
Set the block size of the archive being read to 5120 bytes. |
| 475 |
.It Fl b |
| 476 |
Do byte and word swapping after reading in data from the |
| 477 |
archive, for restoring archives created on systems with |
| 478 |
a different byte order. |
| 479 |
.It Fl C Ar bytes |
| 480 |
Read archive written with a block size of |
| 481 |
.Ar bytes . |
| 482 |
.It Fl c |
| 483 |
Expect the archive headers to be in ASCII format. |
| 484 |
.It Fl d |
| 485 |
Create any intermediate directories as needed during |
| 486 |
restore. |
| 487 |
.It Fl E Ar file |
| 488 |
Read list of file name patterns to extract or list from |
| 489 |
.Ar file . |
| 490 |
.It Fl F Ar archive , Fl I Ar archive |
| 491 |
Use the specified file as the input for the archive. |
| 492 |
.It Fl f |
| 493 |
Restore all files except those matching the |
| 494 |
.Ar patterns |
| 495 |
given on the command line. |
| 496 |
.It Fl H Ar format |
| 497 |
Read an archive of the specified format. |
| 498 |
Recognised formats are: |
| 499 |
.Pp |
| 500 |
.Bl -tag -width sv4cpio -compact |
| 501 |
.It Ar ar |
| 502 |
Unix Archiver. |
| 503 |
.It Ar bcpio |
| 504 |
Old binary |
| 505 |
.Nm cpio |
| 506 |
format. |
| 507 |
.It Ar cpio |
| 508 |
Old octal character |
| 509 |
.Nm cpio |
| 510 |
format. |
| 511 |
.It Ar sv4cpio |
| 512 |
SVR4 hex |
| 513 |
.Nm cpio |
| 514 |
format. |
| 515 |
.It Ar sv4crc |
| 516 |
SVR4 hex |
| 517 |
.Nm cpio |
| 518 |
format with checksums. |
| 519 |
.It Ar tar |
| 520 |
Old tar format. |
| 521 |
.It Ar ustar |
| 522 |
POSIX ustar format. |
| 523 |
.It "\ " |
| 524 |
.It Ar bin |
| 525 |
These four formats...\& |
| 526 |
.It Ar crc |
| 527 |
\&...are supported...\& |
| 528 |
.It Ar newc |
| 529 |
\&...for backwards...\& |
| 530 |
.It Ar odc |
| 531 |
\&...compatibility only. |
| 532 |
.El |
| 533 |
.It Fl J |
| 534 |
Use the xz utility to decompress the archive. |
| 535 |
.It Fl j |
| 536 |
Use the bzip2 utility to decompress the archive. |
| 537 |
.It Fl m |
| 538 |
Restore modification times on files. |
| 539 |
.It Fl r |
| 540 |
Rename restored files interactively. |
| 541 |
.It Fl S |
| 542 |
Swap words after reading data from the archive. |
| 543 |
.It Fl s |
| 544 |
Swap bytes after reading data from the archive. |
| 545 |
.It Fl t |
| 546 |
Only list the contents of the archive, no files or |
| 547 |
directories will be created. |
| 548 |
.It Fl u |
| 549 |
Overwrite files even when the file in the archive is |
| 550 |
older than the one that will be overwritten. |
| 551 |
.It Fl V |
| 552 |
Print a dot |
| 553 |
.Pq Sq \&. |
| 554 |
for each file read from the archive. |
| 555 |
.It Fl v |
| 556 |
Be verbose about operations. |
| 557 |
List filenames as they are copied in from the archive. |
| 558 |
.It Fl Z |
| 559 |
Use the |
| 560 |
.Xr compress 1 |
| 561 |
utility to decompress the archive. |
| 562 |
.It Fl z |
| 563 |
Use the |
| 564 |
.Xr gzip 1 |
| 565 |
utility to decompress the archive. |
| 566 |
.El |
| 567 |
.It Fl p |
| 568 |
Copy files from one location to another in a single pass. |
| 569 |
The list of files to copy are read from standard input and |
| 570 |
written out to a directory relative to the specified |
| 571 |
.Ar directory |
| 572 |
argument. |
| 573 |
.Bl -tag -width Ds |
| 574 |
.It Fl a |
| 575 |
Reset the access times on files that have been copied. |
| 576 |
.It Fl d |
| 577 |
Create any intermediate directories as needed to write |
| 578 |
the files at the new location. |
| 579 |
.It Fl L |
| 580 |
Follow symbolic links. |
| 581 |
.It Fl l |
| 582 |
When possible, link files rather than creating an |
| 583 |
extra copy. |
| 584 |
.It Fl m |
| 585 |
Restore modification times on files. |
| 586 |
.It Fl u |
| 587 |
Overwrite files even when the original file being copied is |
| 588 |
older than the one that will be overwritten. |
| 589 |
.It Fl V |
| 590 |
Print a dot |
| 591 |
.Pq Sq \&. |
| 592 |
for each file copied. |
| 593 |
.It Fl v |
| 594 |
Be verbose about operations. |
| 595 |
List filenames as they are copied. |
| 596 |
.El |
| 597 |
.El |
| 598 |
.Sh ENVIRONMENT |
| 599 |
.Bl -tag -width Fl |
| 600 |
.It Ev TMPDIR |
| 601 |
Path in which to store temporary files. |
| 602 |
.El |
| 603 |
.Sh EXIT STATUS |
| 604 |
The |
| 605 |
.Nm |
| 606 |
utility exits with one of the following values: |
| 607 |
.Pp |
| 608 |
.Bl -tag -width Ds -offset indent -compact |
| 609 |
.It 0 |
| 610 |
All files were processed successfully. |
| 611 |
.It 1 |
| 612 |
An error occurred. |
| 613 |
.El |
| 614 |
.Sh DIAGNOSTICS |
| 615 |
Whenever |
| 616 |
.Nm |
| 617 |
cannot create a file or a link when extracting an archive or cannot |
| 618 |
find a file while writing an archive, or cannot preserve the user |
| 619 |
ID, group ID, file mode, or access and modification times when the |
| 620 |
.Fl p |
| 621 |
option is specified, a diagnostic message is written to standard |
| 622 |
error and a non-zero exit value will be returned, but processing |
| 623 |
will continue. |
| 624 |
In the case where |
| 625 |
.Nm |
| 626 |
cannot create a link to a file, |
| 627 |
unless |
| 628 |
.Fl M Ar lncp |
| 629 |
is given, |
| 630 |
.Nm |
| 631 |
will not create a second copy of the file. |
| 632 |
.Pp |
| 633 |
If the extraction of a file from an archive is prematurely terminated |
| 634 |
by a signal or error, |
| 635 |
.Nm |
| 636 |
may have only partially extracted the file the user wanted. |
| 637 |
Additionally, the file modes of extracted files and directories may |
| 638 |
have incorrect file bits, and the modification and access times may |
| 639 |
be wrong. |
| 640 |
.Pp |
| 641 |
If the creation of an archive is prematurely terminated by a signal |
| 642 |
or error, |
| 643 |
.Nm |
| 644 |
may have only partially created the archive, which may violate the |
| 645 |
specific archive format specification. |
| 646 |
.Sh SEE ALSO |
| 647 |
.Xr ar 1 , |
| 648 |
.if \ng==1 \{\ |
| 649 |
.Xr cpio 1 , |
| 650 |
.Xr deb 5 , |
| 651 |
.Xr mirpax 1 , |
| 652 |
.Xr mirtar 1 , |
| 653 |
.\} |
| 654 |
.ie \ng==2 \{\ |
| 655 |
.Xr cpio 1 , |
| 656 |
.Xr deb 5 , |
| 657 |
.Xr pax 1 , |
| 658 |
.Xr paxtar 1 , |
| 659 |
.\} |
| 660 |
.el \{\ |
| 661 |
.Xr pax 1 , |
| 662 |
.\} |
| 663 |
.Xr tar 1 |
| 664 |
.Sh AUTHORS |
| 665 |
.An -nosplit |
| 666 |
.An Keith Muller |
| 667 |
at the University of California, San Diego. |
| 668 |
.Mx |
| 669 |
extensions by |
| 670 |
.An mirabilos Aq [email protected] . |
| 671 |
.Sh CAVEATS |
| 672 |
Different file formats have different maximum file sizes. |
| 673 |
It is recommended that a format such as cpio or ustar |
| 674 |
be used for larger files. |
| 675 |
.Bl -column "File format" "Maximum file size" -offset indent |
| 676 |
.It Sy "File format" Ta Sy "Maximum file size" |
| 677 |
.It ar Ta "10 Gigabytes \- 1 Byte" |
| 678 |
.It bcpio Ta "4 Gibibytes" |
| 679 |
.It sv4cpio Ta "4 Gibibytes" |
| 680 |
.It sv4crc Ta "4 Gibibytes" |
| 681 |
.It cpio Ta "8 Gibibytes" |
| 682 |
.It tar Ta "8 Gibibytes" |
| 683 |
.It ustar Ta "8 Gibibytes" |
| 684 |
.El |
| 685 |
.Pp |
| 686 |
The backwards-compatible format options are not available in the |
| 687 |
.Xr \*(np 1 |
| 688 |
front-end. |
| 689 |
.Pp |
| 690 |
The |
| 691 |
.Fl M |
| 692 |
option is a MirBSD extension, available starting with |
| 693 |
.Mx 8 . |
| 694 |
Archives written using these options are, however, compatible to |
| 695 |
the standard and should be readable on any other system. |
| 696 |
The only option whose behaviour is not explicitly allowed by the |
| 697 |
standard is hard link unification (write file contens only once) |
| 698 |
selected by |
| 699 |
.Fl M Ar 0x0002 . |
| 700 |
.Pp |
| 701 |
The |
| 702 |
.Fl V |
| 703 |
option is a GNU extension, available starting with |
| 704 |
.Mx 11 . |
| 705 |
.Pp |
| 706 |
The |
| 707 |
.Ar ar |
| 708 |
file format matches APT repositories and the BSD |
| 709 |
.Xr ar 1 |
| 710 |
specification, not GNU binutils (which can however read them) or SYSV systems. |
| 711 |
.Sh BUGS |
| 712 |
The |
| 713 |
.Fl s |
| 714 |
and |
| 715 |
.Fl S |
| 716 |
options are currently not implemented. |
| 717 |
.Pp |
| 718 |
The |
| 719 |
.Ar pax |
| 720 |
file format is not yet supported. |