1CP(1) General Commands Manual CP(1)
2
3
4
6 cp - copy
7
9 cp [ -ip ] file1 file2
10
11 cp [ -ipr ] file ... directory
12
14 File1 is copied onto file2. By default, the mode and owner of file2
15 are preserved if it already existed; otherwise the mode of the source
16 file modified by the current umask(2) is used. The -p option causes cp
17 to attempt to preserve (duplicate) in its copies the modification times
18 and modes of the source files, ignoring the present umask.
19
20 In the second form, one or more files are copied into the directory
21 with their original file-names.
22
23 Cp refuses to copy a file onto itself.
24
25 If the -i option is specified, cp will prompt the user with the name of
26 the file whenever the copy will cause an old file to be overwritten. An
27 answer of 'y' will cause cp to continue. Any other answer will prevent
28 it from overwriting the file.
29
30 If the -r option is specified and any of the source files are directo‐
31 ries, cp copies each subtree rooted at that name; in this case the des‐
32 tination must be a directory.
33
35 cat(1), mv(1), rcp(1C)
36
37
38
394th Berkeley Distribution June 8, 1985 CP(1)