xref: /386bsd/usr/share/man/cat1/cp.0 (revision a2142627)
1CP(1)                       386BSD Reference Manual                      CP(1)
2
3NNAAMMEE
4     ccpp - copy files
5
6SSYYNNOOPPSSIISS
7     ccpp [--RRffhhiipp] _s_o_u_r_c_e__f_i_l_e _t_a_r_g_e_t__f_i_l_e
8     ccpp [--RRffhhiipp] _s_o_u_r_c_e__f_i_l_e ... _t_a_r_g_e_t__d_i_r_e_c_t_o_r_y
9
10DDEESSCCRRIIPPTTIIOONN
11     In the first synopsis form, the ccpp utility copies the contents of the
12     _s_o_u_r_c_e__f_i_l_e to the _t_a_r_g_e_t__f_i_l_e. In the second synopsis form, the contents
13     of each named _s_o_u_r_c_e__f_i_l_e is copied to the destination _t_a_r_g_e_t__d_i_r_e_c_t_o_r_y.
14     The names of the files themselves are not changed.  If ccpp detects an
15     attempt to copy a file to itself, the copy will fail.
16
17     The following options are available:
18
19     --RR    If _s_o_u_r_c_e__f_i_l_e designates a directory, ccpp copies the directory and
20           the entire subtree connected at that point.  This option also
21           causes symbolic links to be copied, rather than indirected through,
22           and for ccpp to create special files rather than copying them as
23           normal files.  Created directories have the same mode as the
24           corresponding source directory, unmodified by the process' umask.
25
26     --ff    For each existing destination pathname, remove it and create a new
27           file, without prompting for confirmation regardless of its
28           permissions.  (The --ii option is ignored if the --ff option is
29           specified.)
30
31     --hh    Forces ccpp to follow symbolic links.  Provided for the --RR option
32           which does not follow symbolic links by default.
33
34     --ii    Causes ccpp to write a prompt to standard error before copying a file
35           that would overwrite an existing file.  If the response from the
36           standard input begins with the character `y', the file is copied if
37           permissions allow the copy.
38
39     --pp    Causes ccpp to preserve in the copy as many of the modification time,
40           access time, file mode, user ID, and group ID as allowed by
41           permissions.
42
43           If the user ID and group ID cannot be preserved, no error message
44           is displayed and the exit value is not altered.
45
46           If the source file has its set user ID bit on and the user ID
47           cannot be preserved, the set user ID bit is not preserved in the
48           copy's permissions.  If the source file has its set group ID bit on
49           and the group ID cannot be preserved, the set group ID bit is not
50           preserved in the copy's permissions.  If the source file has both
51           the set user ID and set group ID bits on and either the user ID or
52           group ID cannot be preserved, neither the set user ID or set group
53           ID bits are preserved in the copy's permissions.
54
55     For each destination file that already exists, its contents are
56     overwritten if permissions allow, but its mode, user ID, and group ID are
57     unchanged.
58
59     If the destination file does not exist, the mode of the source file is
60     used as modified by the file mode creation mask (uummaasskk, see csh(1)).  If
61     the source file has its set user ID bit on, that bit is removed unless
62     both the source file and the destination file are owned by the same user.
63     If the source file has its set group ID bit on, that bit is removed
64     unless both the source file and the destination file are in the same
65     group and the user is a member of that group.  If both the set user ID
66     and set group ID bits are set, all of the above conditions must be
67     fulfilled or both bits are removed.
68
69     Appropriate permissions are required for file creation or overwriting.
70
71     Symbolic links are followed unless the --RR option is specified, in which
72     case the link itself is copied.
73
74     CCpp exits 0 on success, >0 if an error occurred.
75
76SSEEEE AALLSSOO
77     mv(1),  rcp(1),  umask(2)
78
79HHIISSTTOORRYY
80     The ccpp command is expected to be IEEE Std1003.2 (``POSIX'') compatible.
81
824th Berkeley Distribution        July 30, 1991                               2
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133