document distributed with 4.2BSD
[unix-history] / usr / src / bin / rcp / rcp.1
CommitLineData
3b46468b
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
c33a908d 5.\" @(#)rcp.1 6.4 (Berkeley) %G%
3b46468b 6.\"
b9719bce 7.TH RCP 1C ""
3b46468b
KM
8.UC 5
9.SH NAME
10rcp \- remote file copy
11.SH SYNOPSIS
12.B rcp
ec6dcb7a
JL
13[
14.B \-p
15] file1 file2
3b46468b
KM
16.br
17.B rcp
18[
2f7ce0a7
JB
19.B \-p
20] [
21.B \-r
3b46468b
KM
22] file ... directory
23.SH DESCRIPTION
24.I Rcp
25copies files between machines. Each
26.I file
27or
28.I directory
29argument is either a remote file name of the
30form ``rhost:path'', or a local file name (containing no `:' characters,
c33a908d 31or a `/' before any `:'s).
3b46468b
KM
32.PP
33If the
34.B \-r
ec6dcb7a 35option
3b46468b
KM
36is specified and any of the source files are directories,
37.I rcp
38copies each subtree rooted at that name; in this case
39the destination must be a directory.
40.PP
ec6dcb7a
JL
41By default, the mode and owner of
42.I file2
43are preserved if it already existed; otherwise the mode of the source file
44modified by the
45.IR umask (2)
46on the destination host is used.
47The
48.B \-p
49option causes
50.I rcp
51to attempt to preserve (duplicate) in its copies the modification
52times and modes of the source files, ignoring the
53.IR umask .
54.PP
3b46468b
KM
55If
56.I path
57is not a full path name, it is interpreted relative to
58your login directory on
59.IR rhost .
60A
61.I path
62on a remote host may be quoted (using \e, ", or \(aa)
63so that the metacharacters are interpreted remotely.
64.PP
65.I Rcp
66does not prompt for passwords; your current local user name
67must exist on
68.I rhost
69and allow remote command execution via
70.IR rsh (1C).
71.PP
72.I Rcp
73handles third party copies, where neither source nor target files
74are on the current machine.
2f7ce0a7 75Hostnames may also take the form ``rname@rhost'' to use
3b46468b
KM
76.I rname
77rather than the current user name on the remote host.
2f7ce0a7
JB
78The destination hostname may also take the form ``rhost.rname'' to
79support destination machines that are running 4.2BSD
80versions of
81.I rcp.
3b46468b 82.SH SEE ALSO
ec6dcb7a 83cp(1), ftp(1C), rsh(1C), rlogin(1C)
3b46468b
KM
84.SH BUGS
85Doesn't detect all cases where the target of a copy might
86be a file in cases where only a directory should be legal.
87.br
88Is confused by any output generated by commands in a
89\&.login, \&.profile, or \&.cshrc file on the remote host.