CPIO(1) | General Commands Manual | CPIO(1) |
cpio
— copy file
archives in and out
cpio |
-o [-0AaBcJjLVvZz ]
[-C bytes]
[-F archive]
[-H format]
[-M flag]
[-O archive] <
name-list
[> archive] |
cpio |
-i
[-06BbcdfJjmrSstuVvZz ]
[-C bytes]
[-E file]
[-F archive]
[-H format]
[-I archive]
[-M flag]
[pattern ...]
[< archive] |
cpio |
-p
[-0adLlmuVv ] destination-directory
< name-list |
The cpio
command copies files to and from
a cpio
archive.
The options are as follows:
-0
\0
’) character as a
pathname terminator, instead of newline
(‘\n
’). This applies only to the
pathnames read from standard input in the write and copy modes, and to the
pathnames written to standard output in list mode. This option is expected
to be used in concert with the -print0
function in
find(1), the -d
'' option to the read
built-in utility of mksh(1) or the
-0
flag in
xargs(1).-o
-A
-a
-B
-C
bytes-c
cpio
header for
portability.-F
archive-H
formatcpio
format. Selected by
-6
.cpio
format. Selected
by -c
.cpio
format.cpio
format with checksums. This
is the default format for creating new archives.-J
-j
-L
-M
flagroot
:wheel
).
When creating an archive and verbosely listing output, these normalisation operations are not reflected in the output, because they are made only after the output has been shown.
This option is only implemented for the ar, cpio, sv4cpio, sv4crc, and ustar file format writing routines.
-O
archive-V
-v
-Z
-z
-i
-6
cpio
format archives.-B
-b
-C
bytes-c
-d
-E
file-F
archive, -I
archive-f
-H
formatcpio
format.cpio
format.cpio
format.cpio
format with checksums.-J
-j
-m
-r
-S
-s
-t
-u
-V
-v
-Z
-z
-p
-a
-d
-L
-l
-m
-u
-V
-v
TMPDIR
The cpio
utility exits with one of the
following values:
Whenever cpio
cannot create a file or a
link when extracting an archive or cannot find a file while writing an
archive, or cannot preserve the user ID, group ID, file mode, or access and
modification times when the -p
option is specified,
a diagnostic message is written to standard error and a non-zero exit value
will be returned, but processing will continue. In the case where
cpio
cannot create a link to a file, unless
-M
lncp is given,
cpio
will not create a second copy of the file.
If the extraction of a file from an archive is prematurely
terminated by a signal or error, cpio
may have only
partially extracted the file the user wanted. Additionally, the file modes
of extracted files and directories may have incorrect file bits, and the
modification and access times may be wrong.
If the creation of an archive is prematurely terminated by a
signal or error, cpio
may have only partially
created the archive, which may violate the specific archive format
specification.
Keith Muller at the University of California, San Diego. MirBSD extensions by mirabilos ⟨m@mirbsd.org⟩.
Different file formats have different maximum file sizes. It is recommended that a format such as cpio or ustar be used for larger files.
File format | Maximum file size |
ar | 10 Gigabytes - 1 Byte |
bcpio | 4 Gibibytes |
sv4cpio | 4 Gibibytes |
sv4crc | 4 Gibibytes |
cpio | 8 Gibibytes |
tar | 8 Gibibytes |
ustar | 8 Gibibytes |
The backwards-compatible format options are not available in the pax(1) front-end.
The -M
option is a MirBSD extension,
available starting with Archives written using these options are, however,
compatible to the standard and should be readable on any other system. The
only option whose behaviour is not explicitly allowed by the standard is
hard link unification (write file contens only once) selected by
-M
0x0002.
The -V
option is a GNU extension,
available starting with
The ar file format matches APT repositories and the BSD ar(1) specification, not GNU binutils (which can however read them) or SYSV systems.
The -s
and -S
options are currently not implemented.
The pax file format is not yet supported.
January 5, 2024 | MirBSD |