Debian Codegraph @

upstream/opensuse-tumbleweed/man1/cpio.1

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