man-pages/man1/cpio.1.html
2021-03-31 01:06:50 +01:00

490 lines
15 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of CPIO</TITLE>
</HEAD><BODY>
<H1>CPIO</H1>
Section: GNU CPIO (1)<BR>Updated: June 21, 2018<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
cpio - copy files to and from archives
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>cpio</B>
{<B>-o</B>|<B>--create</B>} [<B>-0acvABLV</B>] [<B>-C</B> <I>BYTES</I>]
[<B>-H</B> <I>FORMAT</I>] [<B>-M</B> <I>MESSAGE</I>]
[<B>-O</B> [[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE</I>]
[<B>-F</B> [[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE</I>]
[<B>--file=</B>[[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE</I>]
[<B>--format=</B><I>FORMAT</I>] [<B>--message=</B><I>MESSAGE</I>]
[<B>--null</B>] [<B>--reset-access-time</B>] [<B>--verbose</B>]
[<B>--dot</B>] [<B>--append</B>]
[<B>--block-size=</B><I>blocks</I>] [<B>--dereference</B>]
[<B>--io-size=</B><I>BYTES</I>] [<B>--quiet</B>]
[<B>--force-local</B>] [<B>--rsh-command=</B><I>COMMAND</I>]
<B>&lt;</B> <I>name-list</I> [<B>&gt;</B> <I>archive</I>]
<P>
<B>cpio</B>
{<B>-i</B>|<B>--extract</B>} [<B>-bcdfmnrtsuvBSV</B>] [<B>-C</B> <I>BYTES</I>]
[<B>-E</B> <I>FILE</I>] [<B>-H</B> <I>FORMAT</I>]
[<B>-M</B> <I>MESSAGE</I>] [<B>-R</B> [<I>USER</I>][<B>:.</B>][<I>GROUP</I>]]
[<B>-I</B> [[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE</I>]
[<B>-F</B> [[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE</I>]
[<B>--file=</B>[[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE</I>]
[<B>--make-directories</B>] [<B>--nonmatching</B>]
[<B>--preserve-modification-time</B>] [<B>--numeric-uid-gid</B>]
[<B>--rename</B>] [<B>--list</B>] [<B>--swap-bytes</B>]
[<B>--swap</B>] [<B>--dot</B>] [<B>--unconditional</B>]
[<B>--verbose</B>] [<B>--block-size=</B><I>BLOCKS</I>]
[<B>--swap-halfwords</B>] [<B>--io-size=</B><I>BYTES</I>]
[<B>--pattern-file=</B><I>FILE</I>] [<B>--format=</B><I>FORMAT</I>]
[<B>--owner=</B>[<I>USER][</I><B>:.</B>][<I>GROUP</I>]]
[<B>--no-preserve-owner</B>] [<B>--message=</B><I>MESSAGE</I>]
[<B>--force-local</B>] [<B>--no-absolute-filenames</B>] [<B>--sparse</B>]
[<B>--only-verify-crc</B>] [<B>--to-stdout</B>] [<B>--quiet</B>]
[<B>--rsh-command=</B><I>COMMAND</I>]
[<I>pattern</I>...] [<B>&lt;</B> <I>archive</I>]
<P>
<B>cpio</B>
{<B>-p</B>|<B>--pass-through</B>} [<B>-0adlmuvLV</B>]
[<B>-R</B> [<I>USER</I>][<B>:.</B>][<I>GROUP</I>]]
[<B>--null</B>] [<B>--reset-access-time</B>]
[<B>--make-directories</B>] [<B>--link</B>] [<B>--quiet</B>]
[<B>--preserve-modification-time] [--unconditional</B>]
[<B>--verbose</B>] [<B>--dot</B>] [<B>--dereference</B>]
[<B>--owner=</B>[<I>USER</I>][<B>:.</B>][<I>GROUP</I>]]
[<B>--no-preserve-owner</B>] [<B>--sparse</B>]
<I>destination-directory</I> <B>&lt;</B> <I>name-list</I>
<P>
<B>cpio</B>
{<B>-?</B>|<B>--help</B>|<B>--usage</B>|<B>--version</B>}
<A NAME="lbAD">&nbsp;</A>
<H2>REPORTING BUGS</H2>
Report cpio bugs to <A HREF="mailto:bug-cpio@gnu.org">bug-cpio@gnu.org</A>
<P>
GNU cpio home page: &lt;<A HREF="http://www.gnu.org/software/cpio/">http://www.gnu.org/software/cpio/</A>&gt;
<P>
General help using GNU software: &lt;<A HREF="http://www.gnu.org/gethelp/">http://www.gnu.org/gethelp/</A>&gt;
<P>
Report cpio translation bugs to &lt;<A HREF="http://translationproject.org/team/">http://translationproject.org/team/</A>&gt;
<A NAME="lbAE">&nbsp;</A>
<H2>SEE ALSO</H2>
<A HREF="/cgi-bin/man/man2html?5+cpio">cpio</A>(5)
<A NAME="lbAF">&nbsp;</A>
<H2>DESCRIPTION</H2>
GNU <B>cpio</B> copies files between archives and directories. It
supports the following archive formats: old binary cpio, old portable
cpio, SVR4 cpio with and without checksum, HP cpio, and various tar
formats.
<P>
The operation mode is requested by one of the following options:
<DL COMPACT>
<DT id="1"><B>-o</B>, <B>--create</B>
<DD>
Copy-out. Read a list of file names from the standard input and
create on the standard output (unless overridden by the <B>--file</B>
option) an archive containing these files.
<DT id="2"><B>-i</B>, <B>--extract</B>
<DD>
Copy-in. Read the archive from standard input (or from the file
supplied with the <B>--file</B> option) and extract files from it, or
(if the <B>-t</B> option is given) list its contents to the standard
output. If one or more <I>pattern</I>s are supplied, read or list only
files matching these patterns. The <B>-t</B> option alone implies
<B>-i</B>.
<DT id="3"><B>-p</B>, <B>--pass-through</B>
<DD>
Pass-through. Read a list of file names from the standard input and
copy them to the specified directory.
<DT id="4"><B>-?</B>, <B>--help</B>
<DD>
Give a short help summary and exit.
<DT id="5"><B>--usage</B>
<DD>
Print a short usage message and exit.
<DT id="6"><B>--version</B>
<DD>
Print program version and exit.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>REPORTING BUGS</H2>
Report cpio bugs to <A HREF="mailto:bug-cpio@gnu.org">bug-cpio@gnu.org</A>
<P>
GNU cpio home page: &lt;<A HREF="http://www.gnu.org/software/cpio/">http://www.gnu.org/software/cpio/</A>&gt;
<P>
General help using GNU software: &lt;<A HREF="http://www.gnu.org/gethelp/">http://www.gnu.org/gethelp/</A>&gt;
<P>
Report cpio translation bugs to &lt;<A HREF="http://translationproject.org/team/">http://translationproject.org/team/</A>&gt;
<A NAME="lbAH">&nbsp;</A>
<H2>OPTIONS</H2>
<A NAME="lbAI">&nbsp;</A>
<H3>Operation modifiers valid in any mode</H3>
<DL COMPACT>
<DT id="7"><B>--block-size=</B><I>BLOCK-SIZE</I><DD>
Set the I/O block size to <I>BLOCK-SIZE</I> * 512 bytes.
<DT id="8"><B>-B</B>
<DD>
Set the I/O block size to 5120 bytes.
<DT id="9"><B>-c</B>
<DD>
Use the old portable (ASCII) archive format. This is the same as
<B>-H odc</B>.
<DT id="10"><B>-C</B>, <B>--io-size=</B><I>NUMBER</I><DD>
Set the I/O block size to the given <I>NUMBER</I> of bytes.
<DT id="11"><B>-D</B>, <B>--directory=</B><I>DIR</I><DD>
Change to directory <I>DIR</I>.
<DT id="12"><B>--force-local</B>
<DD>
Archive file is local, even if its name contains colons.
<DT id="13"><B>-H</B>, <B>--format=</B><I>FORMAT</I><DD>
Use given archive <B>FORMAT</B>. Valid formats are (the number in
parentheses gives maximum size for individual archive member):
<DL COMPACT><DT id="14"><DD>
<DL COMPACT>
<DT id="15"><B>bin</B>
<DD>
The obsolete binary format. (2147483647 bytes)
<DT id="16"><B>odc</B>
<DD>
The old (POSIX.1) portable format. (8589934591 bytes)
<DT id="17"><B>newc</B>
<DD>
The new (SVR4) portable format, which supports file systems
having more than 65536 i-nodes. (4294967295 bytes)
<DT id="18"><B>crc</B>
<DD>
The new (SVR4) portable format with a checksum added.
<DT id="19"><B>tar</B>
<DD>
The old tar format. (8589934591 bytes)
<DT id="20"><B>ustar</B>
<DD>
The POSIX.1 tar format. Also recognizes GNU tar archives,
which are similar but not identical. (8589934591 bytes)
<DT id="21"><B>hpbin</B>
<DD>
The obsolete binary format used by HPUX's cpio (which stores
device files differently).
<DT id="22"><B>hpodc</B>
<DD>
The portable format used by HPUX's cpio (which stores device
files differently).
</DL>
</DL>
<DT id="23"><B>-R</B>, <B>--owner=</B>[<I>USER</I>][<B>:.</B>][<I>GROUP</I>]<DD>
In copy-in and copy-pass mode, set the ownership of all files created
to the specified <I>USER</I> and/or <I>GROUP</I>. In copy-out mode,
store the supplied owner information in the archive.
<P>
<I>USER</I> and <I>GROUP</I> are first looked up in the system user and
group databases. If not found, <B>cpio</B> checks if they consist of
decimal digits only and, if so, treats them as numeric UID and GID,
correspondingly.
<P>
To avoid the lookup and ensure that arguments are treated as numeric
values, prefix them with a plus sign, e.g.: <B>-R +0:+0</B>.
<DT id="24"><B>--quiet</B>
<DD>
Do not print the number of blocks copied at the end of the run.
<DT id="25"><B>--rsh-command=</B><I>COMMAND</I>
<DD>
Use remote <I>COMMAND</I> instead of <B>rsh</B>.
<DT id="26"><B>-v</B>, <B>--verbose</B>
<DD>
Verbosely list the files processed.
<DT id="27"><B>-V</B>, <B>--dot</B>
<DD>
Print a &quot;<B>.</B>&quot; for each file processed.
<DT id="28"><B>-W</B>, <B>--warning=</B><I>FLAG</I><DD>
Controlsи warning display. The <I>FLAG</I> is one of
<B>none</B>,
to disable all warnings,
<B>all</B>
to enable them,
<B>truncate</B>,
to enable warnings about field truncation, and
<B>no-truncate</B>,
to disable them.
<P>
Multiple <B>-W</B> options accumulate.
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H3>Operation modifiers valid in copy-in and copy-out modes</H3>
<DL COMPACT>
<DT id="29"><B>-F</B>, <B>--file=</B>[[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE-FILE</I><DD>
Use this <I>ARCHIVE-FILE</I> instead of standard input (in copy-in
mode) or standard output (in copy-out mode). Optional <I>USER</I> and
<I>HOST</I> specify the user and host names in case of a remote
archive.
<DT id="30"><B>-M</B>, <B>--message=</B><I>STRING</I><DD>
Print <I>STRING</I> when the end of a volume of the backup media is reached.
</DL>
<A NAME="lbAK">&nbsp;</A>
<H3>Operation modifiers valid only in copy-in mode</H3>
<DL COMPACT>
<DT id="31"><B>-b</B>, <B>--swap</B>
<DD>
Swap both halfwords of words and bytes of halfwords in the data.
Equivalent to <B>-sS</B>.
<DT id="32"><B>-f</B>, <B>--nonmatching</B>
<DD>
Only copy files that do not match any of the given patterns.
<DT id="33"><B>-n</B>, <B>--numeric-uid-gid</B>
<DD>
In the verbose table of contents listing, show numeric UID and GID.
<DT id="34"><B>-r</B>, <B>--rename</B>
<DD>
Interactively rename files.
<DT id="35"><B>-s</B>, <B>--swap-bytes</B>
<DD>
Swap the bytes of each halfword in the files.
<DT id="36"><B>-S</B>, <B>--swap-halfwords</B>
<DD>
Swap the halfwords of each word (4 bytes) in the files.
<DT id="37"><B>--to-stdout</B>
<DD>
Extract files to standard output.
<DT id="38"><B>-E</B>, <B>--pattern-file=</B><I>FILE</I><DD>
Read additional patterns specifying filenames to extract or list from
<I>FILE</I>.
<DT id="39"><B>--only-verify-crc</B>
<DD>
When reading a CRC format archive, only verify the CRC's of each file
in the archive, without actually extracting the files.
</DL>
<A NAME="lbAL">&nbsp;</A>
<H3>Operation modifiers valid only in copy-out mode</H3>
<DL COMPACT>
<DT id="40"><B>-A</B>, <B>--append</B>
<DD>
Append to an existing archive.
<DT id="41"><B>--device-independent</B>, <B>--reproducible</B>
<DD>
Create reproducible archives. This is equivalent to
<B>--ignore-devno --renumber-inodes</B>.
<DT id="42"><B>--ignore-devno</B>
<DD>
Store 0 in the device number field of each archive member, instead of
the actual device number.
<DT id="43"><B>-O</B> [[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE-NAME</I><DD>
Use <I>ARCHIVE-NAME</I> instead of standard output. Optional <I>USER</I> and
<I>HOST</I> specify the user and host names in case of a remote
archive.
<P>
The output archive name can be specified wither using this option, or
using <B>-F</B> (<B>--file</B>), but not both.
<DT id="44"><B>--renumber-inodes</B>
<DD>
Renumber inodes when storing them in the archive.
</DL>
<A NAME="lbAM">&nbsp;</A>
<H3>Operation modifiers valid only in copy-pass mode</H3>
<DL COMPACT>
<DT id="45"><B>-l</B>, <B>--link</B>
<DD>
Link files instead of copying them, when possible.
</DL>
<A NAME="lbAN">&nbsp;</A>
<H3>Operation modifiers valid in copy-in and copy-out modes</H3>
<DL COMPACT>
<DT id="46"><B>--absolute-filenames</B>
<DD>
Do not strip file system prefix components from the file names. This
is the default.
<DT id="47"><B>--no-absolute-filenames</B>
<DD>
Create all files relative to the current directory.
</DL>
<A NAME="lbAO">&nbsp;</A>
<H3>Operation modifiers valid in copy-out and copy-pass modes</H3>
<DL COMPACT>
<DT id="48"><B>-0</B>, <B>--null</B>
<DD>
Filenames in the list are delimited by null characters instead of
newlines.
<DT id="49"><B>-a</B>, <B>--reset-access-time</B>
<DD>
Reset the access times of files after reading them.
<DT id="50"><B>-I</B> [[<I>USER</I><B>@</B>]<I>HOST</I><B>:</B>]<I>ARCHIVE-NAME</I><DD>
Use <I>ARCHIVE-NAME</I> instead of standard input. Optional <I>USER</I> and
<I>HOST</I> specify the user and host names in case of a remote
archive.
<P>
The input archive name can be specified wither using this option, or
using <B>-F</B> (<B>--file</B>), but not both.
<DT id="51"><B>-L</B>, <B>--dereference</B>
<DD>
Dereference symbolic links (copy the files that they point to instead
of copying the links).
</DL>
<A NAME="lbAP">&nbsp;</A>
<H3>Operation modifiers valid in copy-in and copy-pass modes</H3>
<DL COMPACT>
<DT id="52"><B>-d</B>, <B>--make-directories</B>
<DD>
Create leading directories where needed.
<DT id="53"><B>-m</B>, <B>--preserve-modification-time</B>
<DD>
Retain previous file modification times when creating files.
<DT id="54"><B>--no-preserve-owner</B>
<DD>
Do not change the ownership of the files.
<DT id="55"><B>--sparse</B>
<DD>
Write files with large blocks of zeros as sparse files.
<DT id="56"><B>-u</B>, <B>--unconditional</B>
<DD>
Replace all files unconditionally.
</DL>
<A NAME="lbAQ">&nbsp;</A>
<H2>RETURN VALUE</H2>
GNU <B>cpio</B> exits with code <B>0</B> if it was able to successfully
complete the requested operation. On errors, it exits with code <B>2</B>.
<A NAME="lbAR">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+tar">tar</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?8+rmt">rmt</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?1+mt">mt</A></B>(1).
<A NAME="lbAS">&nbsp;</A>
<H2>BUG REPORTS</H2>
Report bugs to &lt;<A HREF="mailto:bug-cpio@gnu.org">bug-cpio@gnu.org</A>&gt;.
<A NAME="lbAT">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copyright &#169; 2014 Free Software Foundation, Inc.
<BR>
License GPLv3+: GNU GPL version 3 or later &lt;<A HREF="http://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</A>&gt;
<BR>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
<P>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="57"><A HREF="#lbAB">NAME</A><DD>
<DT id="58"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="59"><A HREF="#lbAD">REPORTING BUGS</A><DD>
<DT id="60"><A HREF="#lbAE">SEE ALSO</A><DD>
<DT id="61"><A HREF="#lbAF">DESCRIPTION</A><DD>
<DT id="62"><A HREF="#lbAG">REPORTING BUGS</A><DD>
<DT id="63"><A HREF="#lbAH">OPTIONS</A><DD>
<DL>
<DT id="64"><A HREF="#lbAI">Operation modifiers valid in any mode</A><DD>
<DT id="65"><A HREF="#lbAJ">Operation modifiers valid in copy-in and copy-out modes</A><DD>
<DT id="66"><A HREF="#lbAK">Operation modifiers valid only in copy-in mode</A><DD>
<DT id="67"><A HREF="#lbAL">Operation modifiers valid only in copy-out mode</A><DD>
<DT id="68"><A HREF="#lbAM">Operation modifiers valid only in copy-pass mode</A><DD>
<DT id="69"><A HREF="#lbAN">Operation modifiers valid in copy-in and copy-out modes</A><DD>
<DT id="70"><A HREF="#lbAO">Operation modifiers valid in copy-out and copy-pass modes</A><DD>
<DT id="71"><A HREF="#lbAP">Operation modifiers valid in copy-in and copy-pass modes</A><DD>
</DL>
<DT id="72"><A HREF="#lbAQ">RETURN VALUE</A><DD>
<DT id="73"><A HREF="#lbAR">SEE ALSO</A><DD>
<DT id="74"><A HREF="#lbAS">BUG REPORTS</A><DD>
<DT id="75"><A HREF="#lbAT">COPYRIGHT</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:09 GMT, March 31, 2021
</BODY>
</HTML>