|
|
1.1 root 1: .\" Copyright (c) 1990 The Regents of the University of California.
2: .\" All rights reserved.
3: .\"
4: .\" Redistribution and use in source and binary forms are permitted provided
5: .\" that: (1) source distributions retain this entire copyright notice and
6: .\" comment, and (2) distributions including binaries display the following
7: .\" acknowledgement: ``This product includes software developed by the
8: .\" University of California, Berkeley and its contributors'' in the
9: .\" documentation or other materials provided with the distribution and in
10: .\" all advertising materials mentioning features or use of this software.
11: .\" Neither the name of the University nor the names of its contributors may
12: .\" be used to endorse or promote products derived from this software without
13: .\" specific prior written permission.
14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17: .\"
18: .\" @(#)cpio.1 5.5 (Berkeley) 7/24/90
19: .\"
20: .\" @(#)cpio.1 5.3 (Berkeley) 3/29/88
21: .\"
22: .Dd July 24, 1990
23: .Dt CPIO 1
24: .Os BSD 4.4
25: .Sh NAME
26: .Nm cpio
27: .Nd copy file archives in and out
28: .Sh SYNOPSIS
29: .Nm cpio
30: .Fl o
31: .Op Fl acBv
32: .br
33: .Nm cpio
34: .Fl i
35: .Op Fl BcdmrtuvfsSb6
36: .Op Ar patterns
37: .br
38: .Nm cpio
39: .Fl p
40: .Op Fl adlmruv
41: .Ar directory
42: .Sh DESCRIPTION
43: .Nm Cpio
44: has three functional modes; copy out, copy in and pass.
45: .Pp
46: Functional Options:
47: .Tw Ds
48: .Tp Fl o
49: Copy out \- reads the standard input to obtain a list
50: of path names and copies those files onto the standard
51: output together with path name and status information.
52: Output is padded to a 512-byte boundary.
53: .Pp
54: .Tp Fl i
55: Copy in \- extracts files from the standard input,
56: which is assumed to be the product of a previous
57: .Nm cpio
58: .Fl o .
59: Only files with names that match patterns are selected.
60: Patterns are given in the name-generating notation of
61: .Xr sh 1 .
62: In patterns, meta-characters
63: .Sq Li \&? ,
64: .Sq Li \&* ,
65: and
66: .Sq Li [...]
67: match the
68: slash
69: .Sq Li \&/
70: character. Multiple patterns may be specified and
71: if no patterns are specified, the default for patterns is
72: .Sq Li \&*
73: (i.e., select all files). The extracted files are
74: conditionally created and copied into the current directory
75: tree based upon the options described below. The
76: permissions of the files will be those of the previous
77: .Nm cpio
78: .Fl o .
79: The owner and group of the files will be that of the
80: current user unless the user is super-user, which causes
81: .Nm cpio
82: to retain the owner and group of the files of the
83: previous
84: .Nm cpio
85: .Fl o .
86: .Pp
87: .Tp Fl p
88: Pass \- reads the standard input to obtain a list of
89: path names of files that are conditionally created and
90: copied into the destination directory tree based upon the
91: options described below.
92: .Tp
93: .Pp
94: Options for the above functional options:
95: .Tw Ds
96: .Tp Fl a
97: Reset access times of input files after they have been
98: copied.
99: .Tp Fl B
100: Input/output is to be blocked 5,120 bytes to the record
101: (does not apply to the pass options; meaningful only
102: with data directed to or from
103: .Pa /dev/rmt/??).
104: .Tp Fl d
105: Directories are to be created as needed.
106: .Tp Fl c
107: Write header information in ASCII character form for
108: portability.
109: .Tp Fl r
110: Interactively rename files. If the user types a null
111: line, the files is skipped.
112: .Tp Fl t
113: Print a table of contents of the input. No files are
114: created.
115: .Tp Fl u
116: Copy unconditionally (normally, an older file will not
117: replace a newer file with the same name).
118: .Tp Fl v
119: Verbose: causes a list of file names to be printed.
120: When used with the t option, the table of contents
121: looks like the output of an
122: .Ql ls -l
123: command (see
124: .Xr ls 1 ) .
125: .Tp Fl l
126: Whenever possible, link files rather than copying them.
127: Usable only with the
128: .Fl p
129: option.
130: .Tp Fl m
131: Retain previous file modification time. This option is
132: ineffective on directories that are being copied.
133: .Tp Fl f
134: Copy in all files except those in patterns.
135: .Tp Fl s
136: Swap bytes. Use only with the
137: .Fl i
138: option.
139: .Tp Fl S
140: Swap halfwords. Use only with the
141: .Fl i
142: option.
143: .Tp Fl b
144: halfwords. Use only with the
145: .Fl i
146: option.
147: .Tp Fl 6
148: Process an old (i.e., UNIX System Sixth Edition format)
149: file. Only useful with
150: .Fl i
151: (copy in).
152: .Tp
153: .Sh EXAMPLES
154: The first example below copies the contents of a directory
155: into an archive; the second duplicates a directory
156: hierarchy:
157: .Pp
158: .Dl ls \&| cpio -o >/dev/rmt/0m
159: .Pp
160: .Dl cd olddir
161: .Dl find . -depth -print \&| cpio -pdl newdir
162: .Pp
163: The trivial case
164: .Pp
165: .Dl find . -depth -print \&| cpio -oB >/dev/fmt/0m
166: .Pp
167: can be handled more efficiently by:
168: .Pp
169: .Dl find . -cpio /dev/rmt/0m
170: .Pp
171: .Sh SEE ALSO
172: .Xr ar 1 ,
173: .Xr find 1 ,
174: .Xr ls 1 ,
175: .Xr cpio 4
176: .Sh HISTORY
177: The
178: .Nm cpio
179: command appeared in System V AT&T UNIX. This program is derived
180: from the System V AT&T sources which were contributed to the public
181: domain by AT&T.
182: .Sh BUGS
183: Path names are restricted to 128 characters. If there are
184: too many unique linked files, the program runs out of memory
185: to keep track of them and, thereafter, linking information
186: is lost. Only the super-user can copy special files. The
187: .Fl B
188: option does not work with certain magnetic tape drives.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.