projects
/
platform
/
upstream
/
libarchive.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 3.3.1
[platform/upstream/libarchive.git]
/
doc
/
text
/
bsdcpio.1.txt
diff --git
a/doc/text/bsdcpio.1.txt
b/doc/text/bsdcpio.1.txt
index
15920c0
..
03c9ff9
100644
(file)
--- a/
doc/text/bsdcpio.1.txt
+++ b/
doc/text/bsdcpio.1.txt
@@
-1,256
+1,256
@@
CPIO(1) BSD General Commands Manual CPIO(1)
CPIO(1) BSD General Commands Manual CPIO(1)
-NAME
-
cpio
— copy files to and from archives
+1mNAME0m
+
1mcpio 22m
— copy files to and from archives
-SYNOPSIS
-
cpio -i [options] [pattern ...] [< archive
]
-
cpio -o [options] < name-list [> archive
]
- cpio -p [options] dest-dir < name-list
+1mSYNOPSIS0m
+
1mcpio -i 22m[4moptions24m] [4mpattern24m 4m...24m] [4m<24m 4marchive24m
]
+
1mcpio -o 22m[4moptions24m] 4m<24m 4mname-list24m [4m>24m 4marchive24m
]
+ 1mcpio -p 22m[4moptions24m] 4mdest-dir24m 4m<24m 4mname-list0m
-DESCRIPTION
-
cpio
copies files between archives and directories. This implementation
+1mDESCRIPTION0m
+
1mcpio 22m
copies files between archives and directories. This implementation
can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images
and can create tar, pax, cpio, ar, and shar archives.
can extract from tar, pax, cpio, zip, jar, ar, and ISO 9660 cdrom images
and can create tar, pax, cpio, ar, and shar archives.
- The first option to
cpio
is a mode indicator from the following list:
-
-i
Input. Read an archive from standard input (unless overridden)
- and extract the contents to disk or (if the
-t
option is speci‐
+ The first option to
1mcpio 22m
is a mode indicator from the following list:
+
1m-i 22m
Input. Read an archive from standard input (unless overridden)
+ and extract the contents to disk or (if the
1m-t 22m
option is speci‐
fied) list the contents to standard output. If one or more file
patterns are specified, only files matching one of the patterns
will be extracted.
fied) list the contents to standard output. If one or more file
patterns are specified, only files matching one of the patterns
will be extracted.
-
-o
Output. Read a list of filenames from standard input and produce
+
1m-o 22m
Output. Read a list of filenames from standard input and produce
a new archive on standard output (unless overridden) containing
the specified items.
a new archive on standard output (unless overridden) containing
the specified items.
-
-p
Pass-through. Read a list of filenames from standard input and
+
1m-p 22m
Pass-through. Read a list of filenames from standard input and
copy the files to the specified directory.
copy the files to the specified directory.
-OPTIONS
+1mOPTIONS0m
Unless specifically stated otherwise, options are applicable in all oper‐
ating modes.
Unless specifically stated otherwise, options are applicable in all oper‐
ating modes.
- -0, --null
+ 1m-022m, 1m--null0m
Read filenames separated by NUL characters instead of newlines.
This is necessary if any of the filenames being read might con‐
tain newlines.
Read filenames separated by NUL characters instead of newlines.
This is necessary if any of the filenames being read might con‐
tain newlines.
-
-A
(o mode only) Append to the specified archive. (Not yet imple‐
+
1m-A 22m
(o mode only) Append to the specified archive. (Not yet imple‐
mented.)
mented.)
-
-a
(o and p modes) Reset access times on files after they are read.
+
1m-a 22m
(o and p modes) Reset access times on files after they are read.
-
-B
(o mode only) Block output to records of 5120 bytes.
+
1m-B 22m
(o mode only) Block output to records of 5120 bytes.
- -C size
- (o mode only) Block output to records of
size
bytes.
+ 1m-C 4m22msize0m
+ (o mode only) Block output to records of
4msize24m
bytes.
-
-c
(o mode only) Use the old POSIX portable character format.
- Equivalent to
--format odc
.
+
1m-c 22m
(o mode only) Use the old POSIX portable character format.
+ Equivalent to
1m--format 4m22modc24m
.
- -d, --make-directories
+ 1m-d22m, 1m--make-directories0m
(i and p modes) Create directories as necessary.
(i and p modes) Create directories as necessary.
- -E file
- (i mode only) Read list of file name patterns from
file
to list
+ 1m-E 4m22mfile0m
+ (i mode only) Read list of file name patterns from
4mfile24m
to list
and extract.
and extract.
- -F file, --file file
- Read archive from or write archive to
file
.
+ 1m-F 4m22mfile24m, 1m--file 4m22mfile0m
+ Read archive from or write archive to
4mfile24m
.
- -f pattern
- (i mode only) Ignore files that match
pattern
.
+ 1m-f 4m22mpattern0m
+ (i mode only) Ignore files that match
4mpattern24m
.
- -H format, --format format
+ 1m-H 4m22mformat24m, 1m--format 4m22mformat0m
(o mode only) Produce the output archive in the specified format.
Supported formats include:
(o mode only) Produce the output archive in the specified format.
Supported formats include:
-
cpio Synonym for odc
.
-
newc
The SVR4 portable cpio format.
-
odc
The old POSIX.1 portable octet-oriented cpio format.
-
pax
The POSIX.1 pax format, an extension of the ustar for‐
+
4mcpio24m Synonym for 4modc24m
.
+
4mnewc24m
The SVR4 portable cpio format.
+
4modc24m
The old POSIX.1 portable octet-oriented cpio format.
+
4mpax24m
The POSIX.1 pax format, an extension of the ustar for‐
mat.
mat.
-
ustar
The POSIX.1 tar format.
+
4mustar24m
The POSIX.1 tar format.
- The default format is
odc
. See libarchive-formats(5) for more
+ The default format is
4modc24m
. See libarchive-formats(5) for more
complete information about the formats currently supported by the
underlying libarchive(3) library.
complete information about the formats currently supported by the
underlying libarchive(3) library.
- -h, --help
+ 1m-h22m, 1m--help0m
Print usage information.
Print usage information.
- -I file
- Read archive from
file
.
+ 1m-I 4m22mfile0m
+ Read archive from
4mfile24m
.
- -i, --extract
+ 1m-i22m, 1m--extract0m
Input mode. See above for description.
Input mode. See above for description.
- --insecure
+ 1m--insecure0m
(i and p mode only) Disable security checks during extraction or
copying. This allows extraction via symbolic links, absolute
paths, and path names containing ‘..’ in the name.
(i and p mode only) Disable security checks during extraction or
copying. This allows extraction via symbolic links, absolute
paths, and path names containing ‘..’ in the name.
- -J, --xz
+ 1m-J22m, 1m--xz0m
(o mode only) Compress the file with xz-compatible compression
before writing it. In input mode, this option is ignored; xz
compression is recognized automatically on input.
(o mode only) Compress the file with xz-compatible compression
before writing it. In input mode, this option is ignored; xz
compression is recognized automatically on input.
-
-j Synonym for -y
.
+
1m-j 22mSynonym for 1m-y22m
.
-
-L (o and p modes) All symbolic links will be followed.
Normally,
+
1m-L 22m(o and p modes) All symbolic links will be followed.
Normally,
symbolic links are archived and copied as symbolic links. With
this option, the target of the link will be archived or copied
instead.
symbolic links are archived and copied as symbolic links. With
this option, the target of the link will be archived or copied
instead.
- -l, --link
+ 1m-l22m, 1m--link0m
(p mode only) Create links from the target directory to the orig‐
inal files, instead of copying.
(p mode only) Create links from the target directory to the orig‐
inal files, instead of copying.
- --lrzip
+ 1m--lrzip0m
(o mode only) Compress the resulting archive with lrzip(1). In
input mode, this option is ignored.
(o mode only) Compress the resulting archive with lrzip(1). In
input mode, this option is ignored.
-
--lz4
(o mode only) Compress the archive with lz4-compatible compres‐
+
1m--lz4 22m
(o mode only) Compress the archive with lz4-compatible compres‐
sion before writing it. In input mode, this option is ignored;
lz4 compression is recognized automatically on input.
sion before writing it. In input mode, this option is ignored;
lz4 compression is recognized automatically on input.
-
--lzma
(o mode only) Compress the file with lzma-compatible compression
+
1m--lzma 22m
(o mode only) Compress the file with lzma-compatible compression
before writing it. In input mode, this option is ignored; lzma
compression is recognized automatically on input.
before writing it. In input mode, this option is ignored; lzma
compression is recognized automatically on input.
-
--lzop
(o mode only) Compress the resulting archive with lzop(1). In
+
1m--lzop 22m
(o mode only) Compress the resulting archive with lzop(1). In
input mode, this option is ignored.
input mode, this option is ignored.
- --passphrase passphrase
- The
passphrase
is used to extract or create an encrypted archive.
- Currently, zip is only a format that
cpio
can handle encrypted
+ 1m--passphrase 4m22mpassphrase0m
+ The
4mpassphrase24m
is used to extract or create an encrypted archive.
+ Currently, zip is only a format that
1mcpio 22m
can handle encrypted
archives. You shouldn't use this option unless you realize how
insecure use of this option is.
archives. You shouldn't use this option unless you realize how
insecure use of this option is.
- -m, --preserve-modification-time
+ 1m-m22m, 1m--preserve-modification-time0m
(i and p modes) Set file modification time on created files to
match those in the source.
(i and p modes) Set file modification time on created files to
match those in the source.
- -n, --numeric-uid-gid
- (i mode, only with
-t
) Display numeric uid and gid. By default,
-
cpio
displays the user and group names when they are provided in
+ 1m-n22m, 1m--numeric-uid-gid0m
+ (i mode, only with
1m-t22m
) Display numeric uid and gid. By default,
+
1mcpio 22m
displays the user and group names when they are provided in
the archive, or looks up the user and group names in the system
password database.
the archive, or looks up the user and group names in the system
password database.
- --no-preserve-owner
+ 1m--no-preserve-owner0m
(i mode only) Do not attempt to restore file ownership. This is
the default when run by non-root users.
(i mode only) Do not attempt to restore file ownership. This is
the default when run by non-root users.
- -O file
- Write archive to
file
.
+ 1m-O 4m22mfile0m
+ Write archive to
4mfile24m
.
- -o, --create
+ 1m-o22m, 1m--create0m
Output mode. See above for description.
Output mode. See above for description.
- -p, --pass-through
+ 1m-p22m, 1m--pass-through0m
Pass-through mode. See above for description.
Pass-through mode. See above for description.
- --preserve-owner
+ 1m--preserve-owner0m
(i mode only) Restore file ownership. This is the default when
run by the root user.
(i mode only) Restore file ownership. This is the default when
run by the root user.
- --quiet
+ 1m--quiet0m
Suppress unnecessary messages.
Suppress unnecessary messages.
-
-R [user][:][group], --owner
[user][:][group]
+
1m-R 22m[user][:][group], 1m--owner 22m
[user][:][group]
Set the owner and/or group on files in the output. If group is
Set the owner and/or group on files in the output. If group is
- specified with no user (for example,
-R :wheel
) then the group
+ specified with no user (for example,
1m-R 4m22m:wheel24m
) then the group
will be set but not the user. If the user is specified with a
will be set but not the user. If the user is specified with a
- trailing colon and no group (for example,
-R root:
) then the
+ trailing colon and no group (for example,
1m-R 4m22mroot:24m
) then the
group will be set to the user's default group. If the user is
specified with no trailing colon, then the user will be set but
group will be set to the user's default group. If the user is
specified with no trailing colon, then the user will be set but
- not the group. In
-i and -p
modes, this option can only be used
+ not the group. In
1m-i 22mand 1m-p 22m
modes, this option can only be used
by the super-user. (For compatibility, a period can be used in
place of the colon.)
by the super-user. (For compatibility, a period can be used in
place of the colon.)
-
-r (All modes.) Rename files interactively.
For each file, a
- prompt is written to
/dev/tty
containing the name of the file and
- a line is read from
/dev/tty
. If the line read is blank, the
+
1m-r 22m(All modes.) Rename files interactively.
For each file, a
+ prompt is written to
4m/dev/tty24m
containing the name of the file and
+ a line is read from
4m/dev/tty24m
. If the line read is blank, the
file is skipped. If the line contains a single period, the file
is processed normally. Otherwise, the line is taken to be the
new name of the file.
file is skipped. If the line contains a single period, the file
is processed normally. Otherwise, the line is taken to be the
new name of the file.
- -t, --list
+ 1m-t22m, 1m--list0m
(i mode only) List the contents of the archive to stdout; do not
restore the contents to disk.
(i mode only) List the contents of the archive to stdout; do not
restore the contents to disk.
- -u, --unconditional
+ 1m-u22m, 1m--unconditional0m
(i and p modes) Unconditionally overwrite existing files. Ordi‐
narily, an older file will not overwrite a newer file on disk.
(i and p modes) Unconditionally overwrite existing files. Ordi‐
narily, an older file will not overwrite a newer file on disk.
- -V, --dot
+ 1m-V22m, 1m--dot0m
Print a dot to stderr for each file as it is processed. Super‐
Print a dot to stderr for each file as it is processed. Super‐
- seded by
-v
.
+ seded by
1m-v22m
.
- -v, --verbose
+ 1m-v22m, 1m--verbose0m
Print the name of each file to stderr as it is processed. With
Print the name of each file to stderr as it is processed. With
-
-t
, provide a detailed listing of each file.
+
1m-t22m
, provide a detailed listing of each file.
- --version
+ 1m--version0m
Print the program version information and exit.
Print the program version information and exit.
-
-y
(o mode only) Compress the archive with bzip2-compatible compres‐
+
1m-y 22m
(o mode only) Compress the archive with bzip2-compatible compres‐
sion before writing it. In input mode, this option is ignored;
bzip2 compression is recognized automatically on input.
sion before writing it. In input mode, this option is ignored;
bzip2 compression is recognized automatically on input.
-
-Z
(o mode only) Compress the archive with compress-compatible com‐
+
1m-Z 22m
(o mode only) Compress the archive with compress-compatible com‐
pression before writing it. In input mode, this option is
ignored; compression is recognized automatically on input.
pression before writing it. In input mode, this option is
ignored; compression is recognized automatically on input.
-
-z
(o mode only) Compress the archive with gzip-compatible compres‐
+
1m-z 22m
(o mode only) Compress the archive with gzip-compatible compres‐
sion before writing it. In input mode, this option is ignored;
gzip compression is recognized automatically on input.
sion before writing it. In input mode, this option is ignored;
gzip compression is recognized automatically on input.
-EXIT STATUS
- The
cpio
utility exits 0 on success, and >0 if an error occurs.
+1mEXIT STATUS0m
+ The
1mcpio 22m
utility exits 0 on success, and >0 if an error occurs.
-ENVIRONMENT
- The following environment variables affect the execution of
cpio
:
+1mENVIRONMENT0m
+ The following environment variables affect the execution of
1mcpio22m
:
LANG The locale to use. See environ(7) for more information.
TZ The timezone to use when displaying dates. See environ(7) for
more information.
LANG The locale to use. See environ(7) for more information.
TZ The timezone to use when displaying dates. See environ(7) for
more information.
-EXAMPLES
- The
cpio
command is traditionally used to copy file hierarchies in con‐
+1mEXAMPLES0m
+ The
1mcpio 22m
command is traditionally used to copy file hierarchies in con‐
junction with the find(1) command. The first example here simply copies
junction with the find(1) command. The first example here simply copies
- all files from
src to dest
:
- find src | cpio -pmud dest
+ all files from
4msrc24m to 4mdest24m
:
+ 1mfind 4m22msrc24m | 1mcpio -pmud 4m22mdest0m
By carefully selecting options to the find(1) command and combining it
with other standard utilities, it is possible to exercise very fine con‐
trol over which files are copied. This next example copies files from
By carefully selecting options to the find(1) command and combining it
with other standard utilities, it is possible to exercise very fine con‐
trol over which files are copied. This next example copies files from
-
src to dest
that are more than 2 days old and whose names match a partic‐
+
4msrc24m to 4mdest24m
that are more than 2 days old and whose names match a partic‐
ular pattern:
ular pattern:
- find src -mtime +2 | grep foo[bar] | cpio -pdmu dest
+ 1mfind 4m22msrc24m 1m-mtime 4m22m+224m | 1mgrep foo[bar] 22m| 1mcpio -pdmu 4m22mdest0m
- This example copies files from
src to dest
that are more than 2 days old
+ This example copies files from
4msrc24m to 4mdest24m
that are more than 2 days old
and which contain the word “foobar”:
and which contain the word “foobar”:
- find src -mtime +2 | xargs grep -l foobar | cpio -pdmu dest
+ 1mfind 4m22msrc24m 1m-mtime 4m22m+224m | 1mxargs grep -l foobar 22m| 1mcpio -pdmu 4m22mdest0m
-COMPATIBILITY
+1mCOMPATIBILITY0m
The mode options i, o, and p and the options a, B, c, d, f, l, m, r, t,
u, and v comply with SUSv2.
The mode options i, o, and p and the options a, B, c, d, f, l, m, r, t,
u, and v comply with SUSv2.
- The old POSIX.1 standard specified that only
-i, -o, and -p
were inter‐
+ The old POSIX.1 standard specified that only
1m-i22m, 1m-o22m, and 1m-p 22m
were inter‐
preted as command-line options. Each took a single argument of a list of
preted as command-line options. Each took a single argument of a list of
- modifier characters. For example, the standard syntax allows
-imu
but
- does not support
-miu or -i -m -u, since m and u
are only modifiers to
-
-i, they are not command-line options in their own right.
The syntax
+ modifier characters. For example, the standard syntax allows
1m-imu 22m
but
+ does not support
1m-miu 22mor 1m-i -m -u22m, since 4mm24m and 4mu24m
are only modifiers to
+
1m-i22m, they are not command-line options in their own right.
The syntax
supported by this implementation is backwards-compatible with the stan‐
dard. For best compatibility, scripts should limit themselves to the
standard syntax.
supported by this implementation is backwards-compatible with the stan‐
dard. For best compatibility, scripts should limit themselves to the
standard syntax.
-SEE ALSO
+1mSEE ALSO0m
bzip2(1), tar(1), gzip(1), mt(1), pax(1), libarchive(3), cpio(5),
libarchive-formats(5), tar(5)
bzip2(1), tar(1), gzip(1), mt(1), pax(1), libarchive(3), cpio(5),
libarchive-formats(5), tar(5)
-STANDARDS
+1mSTANDARDS0m
There is no current POSIX standard for the cpio command; it appeared in
ISO/IEC 9945-1:1996 (“POSIX.1”) but was dropped from IEEE Std 1003.1-2001
(“POSIX.1”).
There is no current POSIX standard for the cpio command; it appeared in
ISO/IEC 9945-1:1996 (“POSIX.1”) but was dropped from IEEE Std 1003.1-2001
(“POSIX.1”).
@@
-258,17
+258,17
@@
STANDARDS
The cpio, ustar, and pax interchange file formats are defined by IEEE Std
1003.1-2001 (“POSIX.1”) for the pax command.
The cpio, ustar, and pax interchange file formats are defined by IEEE Std
1003.1-2001 (“POSIX.1”) for the pax command.
-HISTORY
- The original
cpio and find
utilities were written by Dick Haight while
+1mHISTORY0m
+ The original
1mcpio 22mand 1mfind 22m
utilities were written by Dick Haight while
working in AT&T's Unix Support Group. They first appeared in 1977 in
PWB/UNIX 1.0, the “Programmer's Work Bench” system developed for use
within AT&T. They were first released outside of AT&T as part of System
working in AT&T's Unix Support Group. They first appeared in 1977 in
PWB/UNIX 1.0, the “Programmer's Work Bench” system developed for use
within AT&T. They were first released outside of AT&T as part of System
- III Unix in 1981. As a result,
cpio actually predates tar
, even though
+ III Unix in 1981. As a result,
1mcpio 22mactually predates 1mtar22m
, even though
it was not well-known outside of AT&T until some time later.
This is a complete re-implementation based on the libarchive(3) library.
it was not well-known outside of AT&T until some time later.
This is a complete re-implementation based on the libarchive(3) library.
-BUGS
+1mBUGS0m
The cpio archive format has several basic limitations: It does not store
user and group names, only numbers. As a result, it cannot be reliably
used to transfer files between systems with dissimilar user and group
The cpio archive format has several basic limitations: It does not store
user and group names, only numbers. As a result, it cannot be reliably
used to transfer files between systems with dissimilar user and group