|
|
1.1 root 1:
2:
3:
4: CPIO(1) UNIX Programmer's Manual CPIO(1)
5:
6:
7:
8: NAME
9: cpio - copy file archives in and out
10:
11: SYNOPSIS
12: cpio -o[Bacv]
13: cpio -i[Bcdfmrtuv] [pattern...]
14: cpio -p[adlmruv] directory
15:
16: DESCRIPTION
17: The cpio utility produces and reads files in the format
18: specified by the cpio Archive/Interchange File Format speci-
19: fied in IEEE Std. 1003.1-1988.
20:
21: The cpio -i (copy in) utility extracts files from the stan-
22: dard input, which is assumed to be the product of a previous
23: cpio -o . Only files with names that match patterns are
24: selected. Multiple patterns may be specified and if no pat-
25: terns are specified, the default for patterns is selecting
26: all files. The extracted files are conditionally created
27: and copied into the current directory, and possibly any lev-
28: els below, based upon the options described below and the
29: permissions of the files will be those of the previous cpio
30: -o . The owner and group of the files will be that of the
31: current user unless the user has appropriate privileges,
32: which causes cpio to retains the owner and group of the
33: files of the previous cpio -o .
34:
35: The cpio -p (pass) utility reads the standard input to
36: obtain a list of path names of files that are conditionally
37: created and copied into the destination directory based upon
38: the options described below.
39:
40: If an error is detected, the cause is reported and the cpio
41: utility will continue to copy other files. cpio will skip
42: over any unrecognized files which it encounters in the
43: archive.
44:
45: The following restrictions apply to the cpio utility:
46:
47: 1 Pathnames are restricted to 256 characters.
48:
49: 2 Appropriate privileges are required to copy special
50: files.
51:
52: 3 Blocks are reported in 512-byte quantities.
53:
54: Options
55: The following options are available:
56:
57: -B Input/output is to be blocked 5120 bytes to the record.
58: Can only be used with cpio -o or cpio -i for data that
59: is directed to or from character special files.
60:
61:
62:
63: Printed 8/28/89 USENIX Association 1
64:
65:
66:
67:
68:
69:
70: CPIO(1) UNIX Programmer's Manual CPIO(1)
71:
72:
73:
74: -a Reset access times of input files after they have been
75: copied. When the -l option is also specified, the
76: linked files do not have their access times reset. Can
77: only be used with cpio -o or cpio -i .
78:
79: -c Write header information in ASCII character for for
80: portability. Can only be used with cpio -i or cpio -o
81: . Note that this option should always be used to write
82: portable files.
83:
84: -d Creates directories as needed. Can only be used with
85: cpio -i or cpio -p .
86:
87: -f Copy in all files except those in patterns . Can only
88: be used with cpio -i .
89:
90: -l Whenever possible, link files rather than copying them.
91: Can only be used with cpio -p .
92:
93: -m Retain previous modification times. This option is
94: ineffective on directories that are being copied. Can
95: only be used with cpio -i or cpio -p .
96:
97: -r Interactively rename files. The user is asked whether
98: to rename pattern each invocation. Read and write per-
99: missions for /dev/tty are required for this option. If
100: the user types a null line, the file is skipped.
101: Should only be used with cpio -i or cpio -o .
102:
103: -t Print a table of contents of the input. No files are
104: created. Can only be used with cpio -i .
105:
106: -u Copy files unconditionally; usually an older file will
107: not replace a new file with the same name. Can only be
108: used with cpio -i or cpio -p .
109:
110: -v Verbose: cause the names of the affected files to be
111: printed. Can only be used with cpio -i . Provides a
112: detailed listing when used with the -t option.
113:
114: Operands
115: The following operands are available:
116:
117: patterns Simple regular expressions given in the name-
118: generating notation of the shell.
119:
120: directory The destination directory.
121:
122: Exit Status
123: The cpio utility exits with one of the following values:
124:
125: 0 All input files were copied.
126:
127:
128:
129: Printed 8/28/89 USENIX Association 2
130:
131:
132:
133:
134:
135:
136: CPIO(1) UNIX Programmer's Manual CPIO(1)
137:
138:
139:
140: 2 The utility encountered errors in copying or accessing
141: files or directories. An error will be reported for
142: nonexistent files or directories, or permissions that
143: do not allow the user to access the source or target
144: files.
145:
146:
147: It is important to use the -depth option of the find utility
148: to generate pathnames for cpio . This eliminates problems
149: cpio could have trying to create files under read-only
150: directories.
151:
152: The following command:
153: ls | cpio -o > ../newfile
154: copies out the files listed by the ls utility and redirects
155: them to the file newfile .
156:
157: The following command:
158: cat newfile | cpio -id "memo/al" "memo/b*"
159: uses the output file newfile from the cpio -o utility, takes
160: those files that match the patterns memo/al and memo/b* ,
161: creates the directories below the current directory, and
162: places the files in the appropriate directories.
163:
164: The command
165: find . -depth -print | cpio -pdlmv newdir
166: takes the file names piped to it from the find utility and
167: copies or links those files to another directory named
168: newdir , while retaining the modification time.
169:
170: FILES
171: /dev/tty used to prompt the user for information when the
172: -i or -r options are specified.
173:
174: SEE ALSO
175: find(1), pax(1), tar(1), cpio(5), tar(5)
176:
177: COPYRIGHT
178: Copyright (c) 1989 Mark H. Colburn.
179: All rights reserved.
180:
181: Redistribution and use in source and binary forms are per-
182: mitted provided that the above copyright notice is dupli-
183: cated in all such forms and that any documentation,
184: advertising materials, and other materials related to such
185: distribution and use acknowledge that the software was
186: developed by Mark H. Colburn and sponsored by The USENIX
187: Association.
188:
189: THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS
190: OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
191: IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
192:
193:
194:
195: Printed 8/28/89 USENIX Association 3
196:
197:
198:
199:
200:
201:
202: CPIO(1) UNIX Programmer's Manual CPIO(1)
203:
204:
205:
206: PARTICULAR PURPOSE.
207:
208: AUTHOR
209: Mark H. Colburn
210: NAPS International
211: 117 Mackubin Street, Suite 1
212: St. Paul, MN 55102
213: [email protected]
214:
215:
216: Sponsored by The USENIX Association for public distribution.
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261: Printed 8/28/89 USENIX Association 4
262:
263:
264:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.