BSD 4_4 release
[unix-history] / usr / src / old / cpio / cpio.1
index 449bf18..9ba96ef 100644 (file)
-.\"    @(#)cpio.1      5.2 (Berkeley) %G%
+.\" Copyright (c) 1990 The Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.TH CPIO 1 ""
-.UC 7
-.SH NAME
-cpio - copy file archives in and out
-.SH SYNOPSIS
-cpio -o [ acBv ]
-.br
-cpio -i [ BcdmrtuvfsSb6 ] [ patterns ]
-.br
-cpio -p [ adlmruv ] directory
-.SH DESCRIPTION
-Cpio -o (copy out) reads the standard input to obtain a list
-of path names and copies those files onto the standard
-output together with path name and status information.
-Output is padded to a 512-byte boundary.
-.sp
-Cpio -i (copy in) extracts files from the standard input,
-which is assumed to be the product of a previous cpio -o.
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 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 the University of
+.\"    California, Berkeley and its contributors.
+.\" 4. Neither the name of the University nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\"     @(#)cpio.1     5.7 (Berkeley) 5/31/93
+.\"
+.Dd May 31, 1993
+.Dt CPIO 1
+.Os
+.Sh NAME
+.Nm cpio
+.Nd copy file archives in and out
+.Sh SYNOPSIS
+.Nm cpio
+.Fl i
+.Op Fl BcdmrtuvfsSb6
+.Op Ar patterns
+.Nm cpio
+.Fl o
+.Op Fl acBv
+.Nm cpio
+.Fl p
+.Op Fl adlmruv
+.Ar directory
+.Sh DESCRIPTION
+.Nm Cpio
+has three functional modes; copy out, copy in and pass.
+.Pp
+Functional Options:
+.Bl -tag -width 4n
+.It Fl i
+.Em Copy in .
+Extracts files from the standard input,
+which is assumed to be the product of a previous
+.Nm cpio
+.Fl o .
 Only files with names that match patterns are selected.
 Only files with names that match patterns are selected.
-Patterns are given in the name-generating notation of sh(1).
-In patterns, meta-characters ?, *, and [...] match the
-slash / character.  Multiple patterns may be specified and
-if no patterns are specified, the default for patterns is *
+Patterns are given in the name-generating notation of
+.Xr sh 1 .
+In patterns, meta-characters
+.Ql \&? ,
+.Ql \&* ,
+and
+.Ql [...]
+match the
+slash
+.Ql \&/
+character.  Multiple patterns may be specified and
+if no patterns are specified, the default for patterns is
+.Ql \&*
 (i.e., select all files).  The extracted files are
 conditionally created and copied into the current directory
 tree based upon the options described below.  The
 (i.e., select all files).  The extracted files are
 conditionally created and copied into the current directory
 tree based upon the options described below.  The
-permissions of the files will be those of the previous cpio
--o.  The owner and group of the files will be that of the
-current user unless the user is super-user, which causes
-cpio to retain the owner and group of the files of the
-previous cpio -o.
-.sp
-Cpio -p (pass) reads the standard input to obtain a list of
+permissions of the files will be those of the previous
+.Nm cpio
+.Fl o .
+The owner and group of the files will be that of the
+current user unless the user is the super-user, which causes
+.Nm cpio
+to retain the owner and group of the files of the
+previous
+.Nm cpio
+.Fl o .
+.It Fl o
+.Em Copy out .
+Reads the standard input to obtain a list
+of path names and copies those files onto the standard
+output together with path name and status information.
+Output is padded to a 512-byte boundary.
+.It Fl p
+.Em Pass.
+Reads the standard input to obtain a list of
 path names of files that are conditionally created and
 copied into the destination directory tree based upon the
 options described below.
 path names of files that are conditionally created and
 copied into the destination directory tree based upon the
 options described below.
-.sp
-The meanings of the available options are:
-.IP a
+.El
+.Pp
+Options for the above functional option:
+.Bl -tag -width 4n
+.It Fl B
+Input/output is to be blocked 5,120 bytes to the record
+(does not apply to the pass options; meaningful only
+with data directed to or from
+.Pa /dev/rmt0).
+.It Fl S
+Swap halfwords.  Use only with the
+.Fl i
+option.
+.It Fl a
 Reset access times of input files after they have been
 copied.
 Reset access times of input files after they have been
 copied.
-.IP B
-Input/output is to be blocked 5,120 bytes to the record  
-(does not apply to the pass options; meaningful only 
-with data directed to or from /dev/rmt/??).
-.IP d
-Directories are to be created as needed.
-.IP c
+.It Fl b
+Swap halfwords.  Use only with the
+.Fl i
+option.
+.It Fl c
 Write header information in ASCII character form for
 portability.
 Write header information in ASCII character form for
 portability.
-.IP r
+.It Fl d
+Directories are to be created as needed.
+.It Fl f
+Copy in all files except those in patterns.
+.It Fl l
+Whenever possible, link files rather than copying them.
+Usable only with the
+.Fl p
+option.
+.It Fl m
+Retain previous file modification time.  This option is
+ineffective on directories that are being copied.
+.It Fl r
 Interactively rename files.  If the user types a null
 Interactively rename files.  If the user types a null
-line, the files is skipped.
-.IP t
+line, the file is skipped.
+.It Fl s
+Swap bytes.  Use only with the
+.Fl i
+option.
+.It Fl t
 Print a table of contents of the input.  No files are
 created.
 Print a table of contents of the input.  No files are
 created.
-.IP u
+.It Fl u
 Copy unconditionally (normally, an older file will not
 replace a newer file with the same name).
 Copy unconditionally (normally, an older file will not
 replace a newer file with the same name).
-.IP v
-Verbose: causes a list of file names to be printed.  
-When used with the t option, the table of contents
-looks like the output of an ls -l command (see ls(1)).
-.IP l
-Whenever possible, link files rather than copying them.
-Usable only with the -p option.
-.IP m
-Retain previous file modification time.  This option is
-ineffective on directories that are being copied.
-.IP f
-Copy in all files except those in patterns.
-.IP s
-Swap bytes.  Use only with the -i option.
-.IP S
-Swap halfwords.  Use only with the -i option.
-.IP b
-Swap both bytes and halfwords.  Use only with the -i
-option.
-.IP 6
+.It Fl v
+Verbose: causes a list of file names to be printed.
+When used with the
+.Fl t
+option, the table of contents
+looks like the output of an
+.Ql ls -l
+command (see
+.Xr ls 1 ) .
+.It Fl 6
 Process an old (i.e., UNIX System Sixth Edition format)
 Process an old (i.e., UNIX System Sixth Edition format)
-file.  Only useful with -i (copy in).
-.SH EXAMPLES
+file.  Only useful with
+.Fl i
+(copy in).
+.El
+.Sh EXAMPLES
 The first example below copies the contents of a directory
 into an archive; the second duplicates a directory
 hierarchy:
 The first example below copies the contents of a directory
 into an archive; the second duplicates a directory
 hierarchy:
-.sp
-.in +5
-ls | cpio -o >/dev/rmt/0m
-.sp
+.Pp
+.Bd -literal -offset indent
+ls  \&| cpio -o > /dev/rmt0
+
 cd olddir
 cd olddir
-.br
-find . -depth -print | cpio -pdl newdir
-.br
-.sp
-.in -5
+find \&. -depth -print \&|  cpio -pdl newdir
+.Pp
 The trivial case
 The trivial case
-.nf
-.in +5
-``find . -depth -print | cpio -oB >/dev/fmt/0m''
-.in -5
-.fi
+.Pp
+.Dl find \&. -depth -print \&|  cpio -oB >/dev/rmt0
+.Pp
 can be handled more efficiently by:
 can be handled more efficiently by:
-.in +5
-find . -cpio /dev/rmt/0m
-.in -5
-.sp
-.SH SEE ALSO
-ar(1), find(1), ls(1).
-.br
-cpio(4) in the UNIX System User Reference Manual.
-.SH BUGS
+.Pp
+.Dl find \&. -cpio /dev/rmt0
+.Sh SEE ALSO
+.Xr ar 1 ,
+.Xr find 1 ,
+.Xr ls 1 ,
+.Xr cpio 4
+.Sh HISTORY
+The
+.Nm cpio
+command appeared in System V AT&T UNIX.  This program is derived
+from the System V AT&T sources which were contributed to the public
+domain by AT&T.
+.Sh BUGS
 Path names are restricted to 128 characters.  If there are
 too many unique linked files, the program runs out of memory
 to keep track of them and, thereafter, linking information
 is lost.  Only the super-user can copy special files.  The
 Path names are restricted to 128 characters.  If there are
 too many unique linked files, the program runs out of memory
 to keep track of them and, thereafter, linking information
 is lost.  Only the super-user can copy special files.  The
--B option does not work with certain magnetic tape drives
-(see un32(7) in the UNIX System Administrator Reference 
-Manual).
+.Fl B
+option does not work with certain magnetic tape drives.