Commit | Line | Data |
---|---|---|
b2cd844e C |
1 | CPIO(1) UNIX Reference Manual CPIO(1) |
2 | ||
3 | N\bNA\bAM\bME\bE | |
4 | c\bcp\bpi\bio\bo - copy file archives in and out | |
5 | ||
6 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS | |
7 | c\bcp\bpi\bio\bo -\b-o\bo [-\b-a\bac\bcB\bBv\bv] | |
8 | c\bcp\bpi\bio\bo -\b-i\bi [-\b-B\bBc\bcd\bdm\bmr\brt\btu\buv\bvf\bfs\bsS\bSb\bb6\b6] [_\bp_\ba_\bt_\bt_\be_\br_\bn_\bs] | |
9 | c\bcp\bpi\bio\bo -\b-p\bp [-\b-a\bad\bdl\blm\bmr\bru\buv\bv] _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by | |
10 | ||
11 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN | |
12 | C\bCp\bpi\bio\bo has three functional modes; copy out, copy in and pass. | |
13 | ||
14 | Functional Options: | |
15 | ||
16 | -\b-o\bo Copy out - reads the standard input to obtain a list of path names | |
17 | and copies those files onto the standard output together with path | |
18 | name and status information. Output is padded to a 512-byte boun- | |
19 | dary. | |
20 | ||
21 | -\b-i\bi Copy in - extracts files from the standard input, which is assumed | |
22 | to be the product of a previous c\bcp\bpi\bio\bo -\b-o\bo. Only files with names | |
23 | that match patterns are selected. Patterns are given in the name- | |
24 | generating notation of sh(1). In patterns, meta-characters `?', | |
25 | `*', and `[...]' match the slash `/' character. Multiple patterns | |
26 | may be specified and if no patterns are specified, the default for | |
27 | patterns is `*' (i.e., select all files). The extracted files are | |
28 | conditionally created and copied into the current directory tree | |
29 | based upon the options described below. The permissions of the | |
30 | files will be those of the previous c\bcp\bpi\bio\bo -\b-o\bo. The owner and group | |
31 | of the files will be that of the current user unless the user is | |
32 | super-user, which causes c\bcp\bpi\bio\bo to retain the owner and group of the | |
33 | files of the previous c\bcp\bpi\bio\bo -\b-o\bo. | |
34 | ||
35 | -\b-p\bp Pass - reads the standard input to obtain a list of path names of | |
36 | files that are conditionally created and copied into the destina- | |
37 | tion directory tree based upon the options described below. | |
38 | ||
39 | Options for the above functional options: | |
40 | ||
41 | -\b-a\ba Reset access times of input files after they have been copied. | |
42 | ||
43 | -\b-B\bB Input/output is to be blocked 5,120 bytes to the record (does not | |
44 | apply to the pass options; meaningful only with data directed to or | |
45 | from /_\bd_\be_\bv/_\br_\bm_\bt/??). | |
46 | ||
47 | -\b-d\bd Directories are to be created as needed. | |
48 | ||
49 | -\b-c\bc Write header information in ASCII character form for portability. | |
50 | ||
51 | -\b-r\br Interactively rename files. If the user types a null line, the | |
52 | files is skipped. | |
53 | ||
54 | -\b-t\bt Print a table of contents of the input. No files are created. | |
55 | ||
56 | -\b-u\bu Copy unconditionally (normally, an older file will not replace a | |
57 | newer file with the same name). | |
58 | ||
59 | -\b-v\bv Verbose: causes a list of file names to be printed. When used with | |
60 | the t option, the table of contents looks like the output of an `ls | |
61 | -l' command (see ls(1)). | |
62 | ||
63 | -\b-l\bl Whenever possible, link files rather than copying them. Usable | |
64 | only with the -\b-p\bp option. | |
65 | ||
66 | -\b-m\bm Retain previous file modification time. This option is ineffective | |
67 | on directories that are being copied. | |
68 | -\b-f\bf Copy in all files except those in patterns. | |
69 | ||
70 | -\b-s\bs Swap bytes. Use only with the -\b-i\bi option. | |
71 | ||
72 | -\b-S\bS Swap halfwords. Use only with the -\b-i\bi option. | |
73 | ||
74 | -\b-b\bb halfwords. Use only with the -\b-i\bi option. | |
75 | ||
76 | -\b-6\b6 Process an old (i.e., UNIX System Sixth Edition format) file. Only | |
77 | useful with -\b-i\bi (copy in). | |
78 | ||
79 | E\bEX\bXA\bAM\bMP\bPL\bLE\bES\bS | |
80 | The first example below copies the contents of a directory into an ar- | |
81 | chive; the second duplicates a directory hierarchy: | |
82 | ||
83 | ls | cpio -o >/dev/rmt/0m | |
84 | ||
85 | cd olddir | |
86 | find . -depth -print | cpio -pdl newdir | |
87 | ||
88 | The trivial case | |
89 | ||
90 | find . -depth -print | cpio -oB >/dev/fmt/0m | |
91 | ||
92 | can be handled more efficiently by: | |
93 | ||
94 | find . -cpio /dev/rmt/0m | |
95 | ||
96 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO | |
97 | ar(1), find(1), ls(1), cpio(4) | |
98 | ||
99 | H\bHI\bIS\bST\bTO\bOR\bRY\bY | |
100 | The c\bcp\bpi\bio\bo command appeared in System V AT&T UNIX. This program is derived | |
101 | from the System V AT&T sources which were contributed to the public | |
102 | domain by AT&T. | |
103 | ||
104 | B\bBU\bUG\bGS\bS | |
105 | Path names are restricted to 128 characters. If there are too many | |
106 | unique linked files, the program runs out of memory to keep track of them | |
107 | and, thereafter, linking information is lost. Only the super-user can | |
108 | copy special files. The -\b-B\bB option does not work with certain magnetic | |
109 | tape drives. |