minor cleanups for cray
[unix-history] / usr / src / old / cpio / cpio.1
... / ...
CommitLineData
1.\" @(#)cpio.1 5.3 (Berkeley) %G%
2.\"
3.TH CPIO 1 ""
4.UC 7
5.SH NAME
6cpio - copy file archives in and out
7.SH SYNOPSIS
8cpio -o [ acBv ]
9.br
10cpio -i [ BcdmrtuvfsSb6 ] [ patterns ]
11.br
12cpio -p [ adlmruv ] directory
13.SH DESCRIPTION
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:
41.IP a
42Reset access times of input files after they have been
43copied.
44.IP B
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/??).
48.IP d
49Directories are to be created as needed.
50.IP c
51Write header information in ASCII character form for
52portability.
53.IP r
54Interactively rename files. If the user types a null
55line, the files is skipped.
56.IP t
57Print a table of contents of the input. No files are
58created.
59.IP u
60Copy unconditionally (normally, an older file will not
61replace a newer file with the same name).
62.IP v
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)).
66.IP l
67Whenever possible, link files rather than copying them.
68Usable only with the -p option.
69.IP m
70Retain previous file modification time. This option is
71ineffective on directories that are being copied.
72.IP f
73Copy in all files except those in patterns.
74.IP s
75Swap bytes. Use only with the -i option.
76.IP S
77Swap halfwords. Use only with the -i option.
78.IP b
79Swap both bytes and halfwords. Use only with the -i
80option.
81.IP 6
82Process an old (i.e., UNIX System Sixth Edition format)
83file. Only useful with -i (copy in).
84.SH EXAMPLES
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
98The trivial case
99.nf
100.in +5
101``find . -depth -print | cpio -oB >/dev/fmt/0m''
102.in -5
103.fi
104can be handled more efficiently by:
105.in +5
106find . -cpio /dev/rmt/0m
107.in -5
108.sp
109.SH SEE ALSO
110ar(1), find(1), ls(1).
111.br
112cpio(4) in the UNIX System User Reference Manual.
113.SH BUGS
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
118-B option does not work with certain magnetic tape drives.