+.\" $OpenBSD: cpio.1,v 1.28 2008/06/11 07:42:50 jmc Exp $
.\"
.\" Copyright (c) 1997 SigmaSoft, Th. Lockert
.\" All rights reserved.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by SigmaSoft, Th. Lockert.
-.\" 4. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $OpenBSD: cpio.1,v 1.5 1998/09/14 22:13:52 aaron Exp $
+.\" $OpenBSD: cpio.1,v 1.28 2008/06/11 07:42:50 jmc Exp $
.\"
-.Dd February 16, 1997
+.Dd $Mdocdate: June 11 2008 $
.Dt CPIO 1
.Os
.Sh NAME
.Sh SYNOPSIS
.Nm cpio
.Fl o
-.Op Fl aABcjLvzZ
+.Op Fl AaBcjLvZz
.Op Fl C Ar bytes
.Op Fl F Ar archive
.Op Fl H Ar format
.Op Fl O Ar archive
-.Ar "< name-list"
-.Op Ar "> archive"
+.Ar \*(Lt name-list
+.Op Ar \*(Gt archive
.Nm cpio
.Fl i
-.Op Fl bBcdfjmrsStuvzZ6
+.Op Fl 6BbcdfjmrSstuvZz
.Op Fl C Ar bytes
.Op Fl E Ar file
.Op Fl F Ar archive
.Op Fl H Ar format
.Op Fl I Ar archive
-.Op Ar "pattern ..."
-.Op Ar "< archive"
+.Op Ar pattern ...
+.Op Ar \*(Lt archive
.Nm cpio
.Fl p
-.Op Fl adlLmuv
+.Op Fl adLlmuv
.Ar destination-directory
-.Ar "< name-list"
+.Ar \*(Lt name-list
.Sh DESCRIPTION
The
.Nm
.Nm
archive.
.Pp
-The following options are supported:
-.Bl -tag -width Fl
+The options are as follows:
+.Bl -tag -width Ds
.It Fl o
-Create an archive. Reads the list of files to store in the
+Create an archive.
+Reads the list of files to store in the
archive from standard input, and writes the archive on standard
output.
-.Bl -tag -width Fl
+.Bl -tag -width Ds
+.It Fl A
+Append to the specified archive.
.It Fl a
Reset the access times on files that have been copied to the
archive.
-.It Fl A
-Append to the specified archive.
.It Fl B
Set block size of output to 5120 bytes.
+.It Fl C Ar bytes
+Set the block size of output to
+.Ar bytes .
.It Fl c
Use ASCII format for
.Nm
header for portability.
-.It Fl C Ar bytes
-Set the block size of output to
-.Ar bytes .
.It Fl F Ar archive
-.It Fl O Ar archive
-Use the specified file name as the archive to write to.
+Use the specified file as the input for the archive.
.It Fl H Ar format
-Write the archive in the specified format. Recognized
-formats are:
-.Bl -tag -width Ds
+Write the archive in the specified format.
+Recognized formats are:
+.Pp
+.Bl -tag -width sv4cpio -compact
.It Ar bcpio
-Old binary cpio format.
+Old binary
+.Nm
+format.
.It Ar cpio
-Old octal character cpio format.
+Old octal character
+.Nm
+format.
.It Ar sv4cpio
-SVR4 hex cpio format.
+SVR4 hex
+.Nm
+format.
.It Ar tar
Old tar format.
.It Ar ustar
POSIX ustar format.
.El
.It Fl j
-Compress archive using
-.Xr bzip2 1
-format.
+Compress archive using the bzip2 format.
+The bzip2 utility must be installed separately.
.It Fl L
Follow symbolic links.
+.It Fl O Ar archive
+Use the specified file name as the archive to write to.
.It Fl v
-Be verbose about operations. List filenames as they are
-written to the archive.
-.It Fl z
-Compress archive using
-.Xr gzip 1
-format.
+Be verbose about operations.
+List filenames as they are written to the archive.
.It Fl Z
Compress archive using
.Xr compress 1
format.
+.It Fl z
+Compress archive using
+.Xr gzip 1
+format.
.El
.It Fl i
-Restore files from an archive. Reads the archive file from
+Restore files from an archive.
+Reads the archive file from
standard input and extracts files matching the
.Ar patterns
that were specified on the command line.
-.Bl -tag -width Fl
+.Bl -tag -width Ds
+.It Fl 6
+Process old-style
+.Nm
+format archives.
+.It Fl B
+Set the block size of the archive being read to 5120 bytes.
.It Fl b
Do byte and word swapping after reading in data from the
archive, for restoring archives created on systems with
a different byte order.
-.It Fl B
-Set the block size of the archive being read to 5120 bytes.
-.It Fl c
-Expect the archive headers to be in ASCII format.
.It Fl C Ar bytes
Read archive written with a block size of
.Ar bytes .
+.It Fl c
+Expect the archive headers to be in ASCII format.
.It Fl d
Create any intermediate directories as needed during
restore.
.It Fl E Ar file
Read list of file name patterns to extract or list from
.Ar file .
+.It Fl F Ar archive , Fl I Ar archive
+Use the specified file as the input for the archive.
.It Fl f
Restore all files except those matching the
.Ar patterns
given on the command line.
-.It Fl F Ar archive
-.It Fl I Ar archive
-Use the specified file as the input for the archive.
.It Fl H Ar format
-Read an archive of the specified format. Recognized
-formats are:
-.Bl -tag -width Ds
+Read an archive of the specified format.
+Recognized formats are:
+.Pp
+.Bl -tag -width sv4cpio -compact
.It Ar bcpio
-Old binary cpio format.
+Old binary
+.Nm
+format.
.It Ar cpio
-Old octal character cpio format.
+Old octal character
+.Nm
+format.
.It Ar sv4cpio
-SVR4 hex cpio format.
+SVR4 hex
+.Nm
+format.
.It Ar tar
Old tar format.
.It Ar ustar
POSIX ustar format.
.El
.It Fl j
-Uncompress archive using
-.Xr bzip2 1
-format.
+Uncompress archive using the bzip2 format.
+The bzip2 utility must be installed separately.
.It Fl m
Restore modification times on files.
.It Fl r
Rename restored files interactively.
-.It Fl s
-Swap bytes after reading data from the archive.
.It Fl S
Swap words after reading data from the archive.
+.It Fl s
+Swap bytes after reading data from the archive.
.It Fl t
Only list the contents of the archive, no files or
directories will be created.
Overwrite files even when the file in the archive is
older than the one that will be overwritten.
.It Fl v
-Be verbose about operations. List filenames as they are
-copied in from the archive.
-.It Fl z
-Uncompress archive using
-.Xr gzip 1
-format.
+Be verbose about operations.
+List filenames as they are copied in from the archive.
.It Fl Z
Uncompress archive using
.Xr compress 1
format.
-.It Fl 6
-Process old-style \*Qcpio\*U format archives.
+.It Fl z
+Uncompress archive using
+.Xr gzip 1
+format.
.El
.It Fl p
Copy files from one location to another in a single pass.
written out to a directory relative to the specified
.Ar directory
argument.
-.Bl -tag -width Fl
+.Bl -tag -width Ds
.It Fl a
Reset the access times on files that have been copied.
.It Fl d
Create any intermediate directories as needed to write
the files at the new location.
+.It Fl L
+Follow symbolic links.
.It Fl l
When possible, link files rather than creating an
extra copy.
-.It Fl L
-Follow symbolic links.
.It Fl m
Restore modification times on files.
.It Fl u
Overwrite files even when the original file being copied is
older than the one that will be overwritten.
.It Fl v
-Be verbose about operations. List filenames as they are
-copied.
+Be verbose about operations.
+List filenames as they are copied.
+.El
.El
+.Sh ENVIRONMENT
+.Bl -tag -width Fl
+.It Ev TMPDIR
+Path in which to store temporary files.
.El
.Sh ERRORS
.Nm
.Nm
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
+ID, group ID, file mode, or access and modification times when the
.Fl 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
+will continue.
+In the case where
.Nm
cannot create a link to a file,
.Nm
If the creation of an archive is prematurely terminated by a signal
or error,
.Nm
-may have only partially created the archive which may violate the
+may have only partially created the archive, which may violate the
specific archive format specification.
.Sh SEE ALSO
.Xr pax 1 ,
.Xr tar 1
+.Sh AUTHORS
+Keith Muller at the University of California, San Diego.
+.Sh CAVEATS
+Different file formats have different maximum file sizes.
+It is recommended that a format such as cpio or ustar
+be used for larger files.
+.Pp
+.Bl -column "File format" "Maximum file size" -offset indent -compact
+.It Sy "File format" Ta Sy "Maximum file size"
+.It bcpio Ta 4 Gigabytes
+.It sv4cpio Ta 4 Gigabytes
+.It cpio Ta 8 Gigabytes
+.It tar Ta 8 Gigabytes
+.It ustar Ta 8 Gigabytes
+.El
.Sh BUGS
-The
+The
.Fl s
and
.Fl S
options are currently not implemented.
-.Sh AUTHOR
-Keith Muller at the University of California, San Diego.