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