minor cleanups for cray
[unix-history] / usr / src / old / cpio / cpio.1
CommitLineData
3efa0a25 1.\" @(#)cpio.1 5.3 (Berkeley) %G%
d012942d
KB
2.\"
3.TH CPIO 1 ""
4.UC 7
5.SH NAME
bfa647ea 6cpio - copy file archives in and out
d012942d 7.SH SYNOPSIS
bfa647ea 8cpio -o [ acBv ]
d012942d 9.br
bfa647ea 10cpio -i [ BcdmrtuvfsSb6 ] [ patterns ]
bfa647ea 11.br
d012942d
KB
12cpio -p [ adlmruv ] directory
13.SH DESCRIPTION
bfa647ea
KB
14Cpio -o (copy out) reads the standard input to obtain a list
15of path names and copies those files onto the standard
16output together with path name and status information.
17Output is padded to a 512-byte boundary.
18.sp
19Cpio -i (copy in) extracts files from the standard input,
20which is assumed to be the product of a previous cpio -o.
21Only files with names that match patterns are selected.
22Patterns are given in the name-generating notation of sh(1).
23In patterns, meta-characters ?, *, and [...] match the
24slash / character. Multiple patterns may be specified and
25if no patterns are specified, the default for patterns is *
26(i.e., select all files). The extracted files are
27conditionally created and copied into the current directory
28tree based upon the options described below. The
29permissions of the files will be those of the previous cpio
30-o. The owner and group of the files will be that of the
31current user unless the user is super-user, which causes
32cpio to retain the owner and group of the files of the
33previous cpio -o.
34.sp
35Cpio -p (pass) reads the standard input to obtain a list of
36path names of files that are conditionally created and
37copied into the destination directory tree based upon the
38options described below.
39.sp
40The meanings of the available options are:
d012942d 41.IP a
bfa647ea
KB
42Reset access times of input files after they have been
43copied.
d012942d 44.IP B
bfa647ea
KB
45Input/output is to be blocked 5,120 bytes to the record
46(does not apply to the pass options; meaningful only
47with data directed to or from /dev/rmt/??).
d012942d 48.IP d
bfa647ea 49Directories are to be created as needed.
d012942d 50.IP c
bfa647ea
KB
51Write header information in ASCII character form for
52portability.
d012942d 53.IP r
bfa647ea
KB
54Interactively rename files. If the user types a null
55line, the files is skipped.
d012942d 56.IP t
bfa647ea
KB
57Print a table of contents of the input. No files are
58created.
d012942d 59.IP u
bfa647ea
KB
60Copy unconditionally (normally, an older file will not
61replace a newer file with the same name).
d012942d 62.IP v
bfa647ea
KB
63Verbose: causes a list of file names to be printed.
64When used with the t option, the table of contents
65looks like the output of an ls -l command (see ls(1)).
d012942d 66.IP l
bfa647ea
KB
67Whenever possible, link files rather than copying them.
68Usable only with the -p option.
d012942d 69.IP m
bfa647ea
KB
70Retain previous file modification time. This option is
71ineffective on directories that are being copied.
d012942d 72.IP f
bfa647ea 73Copy in all files except those in patterns.
d012942d 74.IP s
bfa647ea 75Swap bytes. Use only with the -i option.
d012942d 76.IP S
bfa647ea 77Swap halfwords. Use only with the -i option.
d012942d 78.IP b
bfa647ea
KB
79Swap both bytes and halfwords. Use only with the -i
80option.
d012942d 81.IP 6
bfa647ea
KB
82Process an old (i.e., UNIX System Sixth Edition format)
83file. Only useful with -i (copy in).
d012942d 84.SH EXAMPLES
bfa647ea
KB
85The first example below copies the contents of a directory
86into an archive; the second duplicates a directory
87hierarchy:
88.sp
89.in +5
90ls | cpio -o >/dev/rmt/0m
91.sp
92cd olddir
93.br
94find . -depth -print | cpio -pdl newdir
95.br
96.sp
97.in -5
d012942d
KB
98The trivial case
99.nf
100.in +5
101``find . -depth -print | cpio -oB >/dev/fmt/0m''
102.in -5
103.fi
bfa647ea 104can be handled more efficiently by:
bfa647ea
KB
105.in +5
106find . -cpio /dev/rmt/0m
d012942d 107.in -5
bfa647ea 108.sp
d012942d 109.SH SEE ALSO
bfa647ea
KB
110ar(1), find(1), ls(1).
111.br
112cpio(4) in the UNIX System User Reference Manual.
d012942d 113.SH BUGS
bfa647ea
KB
114Path names are restricted to 128 characters. If there are
115too many unique linked files, the program runs out of memory
116to keep track of them and, thereafter, linking information
117is lost. Only the super-user can copy special files. The
3efa0a25 118-B option does not work with certain magnetic tape drives.