| 1 |
.\" This file is part of GNU cpio. -*- nroff -*- |
| 2 |
.\" Copyright 2014-2024 Free Software Foundation, Inc. |
| 3 |
.\" |
| 4 |
.\" GNU cpio is free software; you can redistribute it and/or modify |
| 5 |
.\" it under the terms of the GNU General Public License as published by |
| 6 |
.\" the Free Software Foundation; either version 3 of the License, or |
| 7 |
.\" (at your option) any later version. |
| 8 |
.\" |
| 9 |
.\" GNU cpio is distributed in the hope that it will be useful, |
| 10 |
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
.\" GNU General Public License for more details. |
| 13 |
.\" |
| 14 |
.\" You should have received a copy of the GNU General Public License |
| 15 |
.\" along with GNU cpio. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
.TH CPIO 1 "April 29, 2023" "CPIO" "GNU CPIO" |
| 17 |
.SH NAME |
| 18 |
cpio \- copy files to and from archives |
| 19 |
.SH SYNOPSIS |
| 20 |
.B cpio |
| 21 |
{\fB\-o\fR|\fB\-\-create\fR} [\fB\-0acvABLV\fR] [\fB\-C\fR \fIBYTES\fR] |
| 22 |
[\fB\-H\fR \fIFORMAT\fR] [\fB\-M\fR \fIMESSAGE\fR] |
| 23 |
[\fB\-O\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE\fR] |
| 24 |
[\fB\-F\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE\fR] |
| 25 |
[\fB\-\-file=\fR[[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE\fR] |
| 26 |
[\fB\-\-format=\fIFORMAT\fR] [\fB\-\-message=\fIMESSAGE\fR] |
| 27 |
[\fB\-\-null\fR] [\fB\-\-reset\-access\-time\fR] [\fB\-\-verbose\fR] |
| 28 |
[\fB\-\-dot\fR] [\fB\-\-append\fR] |
| 29 |
[\fB\-\-block\-size=\fIblocks\fR] [\fB\-\-dereference\fR] |
| 30 |
[\fB\-\-io\-size=\fIBYTES\fR] [\fB\-\-quiet\fR] |
| 31 |
[\fB\-\-force\-local\fR] [\fB\-\-rsh\-command=\fICOMMAND\fR] |
| 32 |
\fB<\fR \fIname-list\fR [\fB>\fR \fIarchive\fR] |
| 33 |
|
| 34 |
.B cpio |
| 35 |
{\fB\-i\fR|\fB\-\-extract\fR} [\fB\-bcdfmnrtsuvBSV\fR] [\fB\-C\fR \fIBYTES\fR] |
| 36 |
[\fB\-E\fR \fIFILE\fR] [\fB\-H\fR \fIFORMAT\fR] |
| 37 |
[\fB\-M\fR \fIMESSAGE\fR] [\fB\-R\fR [\fIUSER\fR][\fB:.\fR][\fIGROUP\fR]] |
| 38 |
[\fB\-I\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE\fR] |
| 39 |
[\fB\-F\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE\fR] |
| 40 |
[\fB\-\-file=\fR[[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE\fR] |
| 41 |
[\fB\-\-make\-directories\fR] [\fB\-\-nonmatching\fR] |
| 42 |
[\fB\-\-preserve\-modification\-time\fR] [\fB\-\-numeric\-uid\-gid\fR] |
| 43 |
[\fB\-\-rename\fR] [\fB\-\-list\fR] [\fB\-\-swap\-bytes\fR] |
| 44 |
[\fB\-\-swap\fR] [\fB\-\-dot\fR] [\fB\-\-unconditional\fR] |
| 45 |
[\fB\-\-verbose\fR] [\fB\-\-block\-size=\fIBLOCKS\fR] |
| 46 |
[\fB\-\-swap\-halfwords\fR] [\fB\-\-io\-size=\fIBYTES\fR] |
| 47 |
[\fB\-\-pattern\-file=\fIFILE\fR] [\fB\-\-format=\fIFORMAT\fR] |
| 48 |
[\fB\-\-owner=\fR[\fIUSER\fR][\fB:.\fR][\fIGROUP\fR]] |
| 49 |
[\fB\-\-no\-preserve\-owner\fR] [\fB\-\-message=\fIMESSAGE\fR] |
| 50 |
[\fB\-\-force\-local\fR] [\fB\-\-no\-absolute\-filenames\fR] [\fB\-\-sparse\fR] |
| 51 |
[\fB\-\-only\-verify\-crc\fR] [\fB\-\-to\-stdout\fR] [\fB\-\-quiet\fR] |
| 52 |
[\fB\-\-rsh\-command=\fICOMMAND\fR] |
| 53 |
[\fIpattern\fR...] [\fB<\fR \fIarchive\fR] |
| 54 |
|
| 55 |
.B cpio |
| 56 |
{\fB\-p\fR|\fB\-\-pass\-through\fR} [\fB\-0adlmuvLV\fR] |
| 57 |
[\fB\-R\fR [\fIUSER\fR][\fB:.\fR][\fIGROUP\fR]] |
| 58 |
[\fB\-\-null\fR] [\fB\-\-reset\-access\-time\fR] |
| 59 |
[\fB\-\-make\-directories\fR] [\fB\-\-link\fR] [\fB\-\-quiet\fR] |
| 60 |
[\fB\-\-preserve\-modification\-time] [\fB\-\-unconditional\fR] |
| 61 |
[\fB\-\-verbose\fR] [\fB\-\-dot\fR] [\fB\-\-dereference\fR] |
| 62 |
[\fB\-\-owner=\fR[\fIUSER\fR][\fB:.\fR][\fIGROUP\fR]] |
| 63 |
[\fB\-\-no\-preserve\-owner\fR] [\fB\-\-sparse\fR] |
| 64 |
\fIdestination-directory\fR \fB<\fR \fIname-list\fR |
| 65 |
|
| 66 |
.B cpio |
| 67 |
{\fB\-?\fR|\fB\-\-help\fR|\fB\-\-usage\fR|\fB\-\-version\fR} |
| 68 |
.SH REPORTING BUGS |
| 69 |
Report cpio bugs to [email protected] |
| 70 |
.PP |
| 71 |
GNU cpio home page: <http://www.gnu.org/software/cpio/> |
| 72 |
.PP |
| 73 |
General help using GNU software: <http://www.gnu.org/gethelp/> |
| 74 |
.PP |
| 75 |
Report cpio translation bugs to <http://translationproject.org/team/> |
| 76 |
.SH SEE ALSO |
| 77 |
cpio(5) |
| 78 |
.SH DESCRIPTION |
| 79 |
GNU \fBcpio\fR copies files between archives and directories. It |
| 80 |
supports the following archive formats: old binary cpio, old portable |
| 81 |
cpio, SVR4 cpio with and without checksum, HP cpio, and various tar |
| 82 |
formats. |
| 83 |
.PP |
| 84 |
The operation mode is requested by one of the following options: |
| 85 |
.TP |
| 86 |
.BR \-o ", " \-\-create |
| 87 |
Copy-out. Read a list of file names from the standard input and |
| 88 |
create on the standard output (unless overridden by the \fB\-\-file\fR |
| 89 |
option) an archive containing these files. |
| 90 |
.TP |
| 91 |
.BR \-i ", " \-\-extract |
| 92 |
Copy-in. Read the archive from standard input (or from the file |
| 93 |
supplied with the \fB\-\-file\fR option) and extract files from it, or |
| 94 |
(if the \fB\-t\fR option is given) list its contents to the standard |
| 95 |
output. If one or more \fIpattern\fRs are supplied, read or list only |
| 96 |
files matching these patterns. The \fB\-t\fR option alone implies |
| 97 |
\fB\-i\fR. |
| 98 |
.TP |
| 99 |
.BR \-p ", " \-\-pass\-through |
| 100 |
Pass-through. Read a list of file names from the standard input and |
| 101 |
copy them to the specified directory. |
| 102 |
.TP |
| 103 |
.BR \-? ", " \-\-help |
| 104 |
Give a short help summary and exit. |
| 105 |
.TP |
| 106 |
.B \-\-usage |
| 107 |
Print a short usage message and exit. |
| 108 |
.TP |
| 109 |
.B \-\-version |
| 110 |
Print program version and exit. |
| 111 |
.SH REPORTING BUGS |
| 112 |
Report cpio bugs to [email protected] |
| 113 |
.PP |
| 114 |
GNU cpio home page: <http://www.gnu.org/software/cpio/> |
| 115 |
.PP |
| 116 |
General help using GNU software: <http://www.gnu.org/gethelp/> |
| 117 |
.PP |
| 118 |
Report cpio translation bugs to <http://translationproject.org/team/> |
| 119 |
.SH OPTIONS |
| 120 |
.SS Operation modifiers valid in any mode |
| 121 |
.TP |
| 122 |
\fB\-\-block\-size=\fIBLOCK-SIZE\fR |
| 123 |
Set the I/O block size to \fIBLOCK-SIZE\fR * 512 bytes. |
| 124 |
.TP |
| 125 |
.B \-B |
| 126 |
Set the I/O block size to 5120 bytes. |
| 127 |
.TP |
| 128 |
.B \-c |
| 129 |
Use the old portable (ASCII) archive format. This is the same as |
| 130 |
\fB\-H odc\fR. |
| 131 |
.TP |
| 132 |
\fB\-C\fR, \fB\-\-io\-size=\fINUMBER\fR |
| 133 |
Set the I/O block size to the given \fINUMBER\fR of bytes. |
| 134 |
.TP |
| 135 |
\fB\-D\fR, \fB\-\-directory=\fIDIR\fR |
| 136 |
Change to directory \fIDIR\fR. |
| 137 |
.TP |
| 138 |
.B \-\-force\-local |
| 139 |
Archive file is local, even if its name contains colons. |
| 140 |
.TP |
| 141 |
\fB\-H\fR, \fB\-\-format=\fIFORMAT\fR |
| 142 |
Use given archive \fBFORMAT\fR. Valid formats are (the number in |
| 143 |
parentheses gives maximum size for individual archive member): |
| 144 |
.RS |
| 145 |
.TP |
| 146 |
.B bin |
| 147 |
The obsolete binary format. (2147483647 bytes) |
| 148 |
.TP |
| 149 |
.B odc |
| 150 |
The old (POSIX.1) portable format. (8589934591 bytes) |
| 151 |
.TP |
| 152 |
.B newc |
| 153 |
The new (SVR4) portable format, which supports file systems |
| 154 |
having more than 65536 inodes. (4294967295 bytes) |
| 155 |
.TP |
| 156 |
.B crc |
| 157 |
The new (SVR4) portable format with a checksum added. |
| 158 |
.TP |
| 159 |
.B tar |
| 160 |
The old tar format. (8589934591 bytes) |
| 161 |
.TP |
| 162 |
.B ustar |
| 163 |
The POSIX.1 tar format. Also recognizes GNU tar archives, |
| 164 |
which are similar but not identical. (8589934591 bytes) |
| 165 |
.TP |
| 166 |
.B hpbin |
| 167 |
The obsolete binary format used by HPUX's cpio (which stores |
| 168 |
device files differently). |
| 169 |
.TP |
| 170 |
.B hpodc |
| 171 |
The portable format used by HPUX's cpio (which stores device |
| 172 |
files differently). |
| 173 |
.RE |
| 174 |
.TP |
| 175 |
\fB\-R\fR, \fB\-\-owner=\fR[\fIUSER\fR][\fB:.\fR][\fIGROUP\fR] |
| 176 |
In copy-in and copy-pass mode, set the ownership of all files created |
| 177 |
to the specified \fIUSER\fR and/or \fIGROUP\fR. In copy-out mode, |
| 178 |
store the supplied owner information in the archive. |
| 179 |
|
| 180 |
\fIUSER\fR and \fIGROUP\fR are first looked up in the system user and |
| 181 |
group databases. If not found, \fBcpio\fR checks if they consist of |
| 182 |
decimal digits only and, if so, treats them as numeric UID and GID, |
| 183 |
correspondingly. |
| 184 |
|
| 185 |
To avoid the lookup and ensure that arguments are treated as numeric |
| 186 |
values, prefix them with a plus sign, e.g.: \fB-R +0:+0\fR. |
| 187 |
.TP |
| 188 |
.B \-\-quiet |
| 189 |
Do not print the number of blocks copied at the end of the run. |
| 190 |
.TP |
| 191 |
.BI \-\-rsh\-command= COMMAND |
| 192 |
Use remote \fICOMMAND\fR instead of \fBrsh\fR. |
| 193 |
.TP |
| 194 |
.BR \-v ", " \-\-verbose |
| 195 |
Verbosely list the files processed. |
| 196 |
.TP |
| 197 |
.BR \-V ", " \-\-dot |
| 198 |
Print a "\fB.\fR" for each file processed. |
| 199 |
.TP |
| 200 |
\fB\-W\fR, \fB\-\-warning=\fIFLAG\fR |
| 201 |
Controls what warnings are displayed. The \fIFLAG\fR is one of |
| 202 |
.BR none , |
| 203 |
to disable all warnings, |
| 204 |
.BR all |
| 205 |
to enable them, |
| 206 |
.BR truncate , |
| 207 |
to enable warnings about field truncation, and |
| 208 |
.BR no\-truncate , |
| 209 |
to disable them. |
| 210 |
|
| 211 |
Multiple \fB\-W\fR options accumulate. |
| 212 |
.SS Operation modifiers valid in copy-in and copy-out modes |
| 213 |
.TP |
| 214 |
\fB\-F\fR, \fB\-\-file=\fR[[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE-FILE\fR |
| 215 |
Use this \fIARCHIVE-FILE\fR instead of standard input (in copy-in |
| 216 |
mode) or standard output (in copy-out mode). Optional \fIUSER\fR and |
| 217 |
\fIHOST\fR specify the user and host names in case of a remote |
| 218 |
archive. |
| 219 |
.TP |
| 220 |
\fB\-M\fR, \fB\-\-message=\fISTRING\fR |
| 221 |
Print \fISTRING\fR when the end of a volume of the backup media is reached. |
| 222 |
.SS Operation modifiers valid only in copy-in mode |
| 223 |
.TP |
| 224 |
.BR \-b ", " \-\-swap |
| 225 |
Swap both halfwords of words and bytes of halfwords in the data. |
| 226 |
Equivalent to \fB\-sS\fR. |
| 227 |
.TP |
| 228 |
.BR \-f ", " \-\-nonmatching |
| 229 |
Only copy files that do not match any of the given patterns. |
| 230 |
.TP |
| 231 |
.BR \-n ", " \-\-numeric\-uid\-gid |
| 232 |
In the verbose table of contents listing, show numeric UID and GID. |
| 233 |
.\" FIXME: special meaning when storing tar files. |
| 234 |
.TP |
| 235 |
.BR \-r ", " \-\-rename |
| 236 |
Interactively rename files. |
| 237 |
.TP |
| 238 |
.BR \-s ", " \-\-swap\-bytes |
| 239 |
Swap the bytes of each halfword in the files. |
| 240 |
.TP |
| 241 |
.BR \-S ", " \-\-swap\-halfwords |
| 242 |
Swap the halfwords of each word (4 bytes) in the files. |
| 243 |
.TP |
| 244 |
.B \-\-to\-stdout |
| 245 |
Extract files to standard output. |
| 246 |
.TP |
| 247 |
\fB\-E\fR, \fB\-\-pattern\-file=\fIFILE\fR |
| 248 |
Read additional patterns specifying filenames to extract or list from |
| 249 |
\fIFILE\fR. |
| 250 |
.TP |
| 251 |
.B \-\-only\-verify\-crc |
| 252 |
When reading a CRC format archive, only verify the CRC's of each file |
| 253 |
in the archive, without actually extracting the files. |
| 254 |
.SS Operation modifiers valid only in copy-out mode |
| 255 |
.TP |
| 256 |
.BR \-A ", " \-\-append |
| 257 |
Append to an existing archive. |
| 258 |
.TP |
| 259 |
.BR \-\-device\-independent ", " \-\-reproducible |
| 260 |
Create reproducible archives. This is equivalent to |
| 261 |
.BR "\-\-ignore\-devno \-\-ignore\-dirnlink \-\-renumber\-inodes" . |
| 262 |
.TP |
| 263 |
.B \-\-ignore\-devno |
| 264 |
Store 0 in the device number field of each archive member, instead of |
| 265 |
the actual device number. |
| 266 |
.TP |
| 267 |
.B \-\-ignore\-dirnlink |
| 268 |
Store 2 in the |
| 269 |
.I nlink |
| 270 |
field of each directory archive member, |
| 271 |
instead of the actual number of links. |
| 272 |
.TP |
| 273 |
\fB\-O\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE-NAME\fR |
| 274 |
Use \fIARCHIVE-NAME\fR instead of standard output. Optional \fIUSER\fR and |
| 275 |
\fIHOST\fR specify the user and host names in case of a remote |
| 276 |
archive. |
| 277 |
|
| 278 |
The output archive name can be specified either using this option, or |
| 279 |
using \fB\-F\fR (\fB\-\-file\fR), but not both. |
| 280 |
.TP |
| 281 |
.B \-\-renumber\-inodes |
| 282 |
Renumber inodes when storing them in the archive. |
| 283 |
.SS Operation modifiers valid only in copy-pass mode |
| 284 |
.TP |
| 285 |
.BR \-l ", " \-\-link |
| 286 |
Link files instead of copying them, when possible. |
| 287 |
.SS Operation modifiers valid in copy-in and copy-out modes |
| 288 |
.TP |
| 289 |
.B \-\-absolute\-filenames |
| 290 |
Do not strip file system prefix components from the file names. This |
| 291 |
is the default. |
| 292 |
.TP |
| 293 |
.B \-\-no\-absolute\-filenames |
| 294 |
Create all files relative to the current directory. |
| 295 |
.SS Operation modifiers valid in copy-out and copy-pass modes |
| 296 |
.TP |
| 297 |
.BR \-0 ", " \-\-null |
| 298 |
Filenames in the list are delimited by null characters instead of |
| 299 |
newlines. |
| 300 |
.TP |
| 301 |
.BR \-a ", " \-\-reset\-access\-time |
| 302 |
Reset the access times of files after reading them. |
| 303 |
.TP |
| 304 |
\fB\-I\fR [[\fIUSER\fB@\fR]\fIHOST\fB:\fR]\fIARCHIVE-NAME\fR |
| 305 |
Use \fIARCHIVE-NAME\fR instead of standard input. Optional \fIUSER\fR and |
| 306 |
\fIHOST\fR specify the user and host names in case of a remote |
| 307 |
archive. |
| 308 |
|
| 309 |
The input archive name can be specified either using this option, or |
| 310 |
using \fB\-F\fR (\fB\-\-file\fR), but not both. |
| 311 |
.TP |
| 312 |
.BR \-L ", " \-\-dereference |
| 313 |
Dereference symbolic links (copy the files that they point to instead |
| 314 |
of copying the links). |
| 315 |
.SS Operation modifiers valid in copy-in and copy-pass modes |
| 316 |
.TP |
| 317 |
.BR \-d ", " \-\-make\-directories |
| 318 |
Create leading directories where needed. |
| 319 |
.TP |
| 320 |
.BR \-m ", " \-\-preserve\-modification\-time |
| 321 |
Retain previous file modification times when creating files. |
| 322 |
.TP |
| 323 |
.B \-\-no\-preserve\-owner |
| 324 |
Do not change the ownership of the files. |
| 325 |
.TP |
| 326 |
.B \-\-sparse |
| 327 |
Write files with large blocks of zeros as sparse files. |
| 328 |
.TP |
| 329 |
.BR \-u ", " \-\-unconditional |
| 330 |
Replace all files unconditionally. |
| 331 |
.SH "RETURN VALUE" |
| 332 |
GNU \fBcpio\fR exits with code \fB0\fR if it was able to successfully |
| 333 |
complete the requested operation. On errors, it exits with code \fB2\fR. |
| 334 |
.SH "SEE ALSO" |
| 335 |
.BR tar (1), |
| 336 |
.BR rmt (8), |
| 337 |
.BR mt (1). |
| 338 |
.SH "BUG REPORTS" |
| 339 |
Report bugs to <bug\[email protected]>. |
| 340 |
.SH COPYRIGHT |
| 341 |
Copyright \(co 2014--2023 Free Software Foundation, Inc. |
| 342 |
.br |
| 343 |
.na |
| 344 |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> |
| 345 |
.br |
| 346 |
.ad |
| 347 |
This is free software: you are free to change and redistribute it. |
| 348 |
There is NO WARRANTY, to the extent permitted by law. |
| 349 |
.\" Local variables: |
| 350 |
.\" eval: (add-hook 'write-file-hooks 'time-stamp) |
| 351 |
.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.\\-]* [0-9] \"" |
| 352 |
.\" time-stamp-format: "%:B %:d, %:y" |
| 353 |
.\" time-stamp-end: "\"" |
| 354 |
.\" time-stamp-line-limit: 20 |
| 355 |
.\" end: |