BSD 4_2 development
[unix-history] / usr / man / man1 / cp.1
CommitLineData
ca5f4100
C
1.TH CP 1 "1 April 1982"
2.UC 4
3.SH NAME
4cp \- copy
5.SH SYNOPSIS
6.B cp
7[
8.B \-i
9] [
10.B \-r
11] file1 file2
12.PP
13.B cp
14[
15.B \-i
16] [
17.B \-r
18] file ... directory
19.SH DESCRIPTION
20.I File1
21is copied onto
22.IR file2 .
23The mode and owner of
24.I file2
25are preserved if it already
26existed; the mode of the source file
27is used otherwise.
28.PP
29In the second form, one or more
30.I files
31are copied into the
32.I directory
33with their original file-names.
34.PP
35.I Cp
36refuses to copy a file onto itself.
37.PP
38If the
39.B \-i
40option is specified,
41.I cp
42will prompt the user with the name of the file
43whenever the copy will cause an old file to be
44overwritten. An answer of 'y' will cause
45.I cp
46to continue. Any other answer will prevent it
47from overwriting the file.
48.PP
49If the
50.B \-r
51option is specified and any of the source files are directories,
52.I cp
53copies each subtree rooted at that name; in this case
54the destination must be a directory.
55.SH "SEE ALSO"
56cat(1), pr(1), mv(1)