4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / bin / rcp / rcp.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
ebb479fc 2.\" All rights reserved.
3b46468b 3.\"
3d98c418 4.\" %sccs.include.redist.roff%
3b46468b 5.\"
93e761fe 6.\" @(#)rcp.1 6.16 (Berkeley) %G%
ebb479fc 7.\"
b5dc1377
CL
8.Dd
9.Dt RCP 1
3d98c418 10.Os BSD 4.3r
b5dc1377
CL
11.Sh NAME
12.Nm rcp
13.Nd remote file copy
14.Sh SYNOPSIS
15.Nm rcp
0bf4a03b 16.Op Fl p
b5dc1377
CL
17.Op Fl k Ar realm
18.Ar file1 file2
19.Nm rcp
84c47785 20.Op Fl Kprx
b5dc1377
CL
21.Op Fl k Ar realm
22.Ar file ...
23.Ar directory
24.Sh DESCRIPTION
25.Nm Rcp
3b46468b 26copies files between machines. Each
b5dc1377 27.Ar file
3b46468b 28or
b5dc1377 29.Ar directory
3b46468b 30argument is either a remote file name of the
2d1955f2 31form ``rname@rhost:path'', or a local file name (containing no `:' characters,
c33a908d 32or a `/' before any `:'s).
b5dc1377 33.Pp
3d98c418 34.Bl -tag -width flag
84c47785
KB
35.It Fl K
36The
37.Fl K
38option turns off all Kerberos authentication.
93e761fe
KB
39.It Fl k
40The
41.Fl k
42option requests
b5dc1377 43.Nm rcp
93e761fe
KB
44to obtain tickets
45for the remote host in realm
46.Ar realm
47instead of the remote host's realm as determined by
48.Xr krb_realmofhost 3 .
3d98c418 49.It Fl p
ec6dcb7a 50The
b5dc1377 51.Fl p
ec6dcb7a 52option causes
b5dc1377 53.Nm rcp
ec6dcb7a
JL
54to attempt to preserve (duplicate) in its copies the modification
55times and modes of the source files, ignoring the
b5dc1377
CL
56.Ar umask .
57By default, the mode and owner of
58.Ar file2
59are preserved if it already existed; otherwise the mode of the source file
60modified by the
61.Xr umask 2
62on the destination host is used.
93e761fe
KB
63.It Fl r
64If any of the source files are directories,
b5dc1377 65.Nm rcp
93e761fe
KB
66copies each subtree rooted at that name; in this case
67the destination must be a directory.
3d98c418 68.El
b5dc1377 69.Pp
3b46468b 70If
b5dc1377 71.Ar path
3b46468b 72is not a full path name, it is interpreted relative to
2d1955f2 73the login directory of the specified user
b5dc1377
CL
74.Ar ruser
75on
76.Ar rhost ,
2d1955f2 77or your current user name if no other remote user name is specified.
b5dc1377
CL
78A
79.Ar path
3b46468b
KM
80on a remote host may be quoted (using \e, ", or \(aa)
81so that the metacharacters are interpreted remotely.
b5dc1377
CL
82.Pp
83.Nm Rcp
2d1955f2
KF
84does not prompt for passwords; it performs remote execution
85via
b5dc1377 86.Xr rsh 1 ,
2d1955f2 87and requires the same authorization.
b5dc1377
CL
88.Pp
89.Nm Rcp
3b46468b
KM
90handles third party copies, where neither source nor target files
91are on the current machine.
b5dc1377
CL
92.Sh SEE ALSO
93.Xr cp 1 ,
94.Xr ftp 1 ,
95.Xr rsh 1 ,
96.Xr rlogin 1
97.Sh HISTORY
3d98c418
CL
98The
99.Nm rcp
100command appeared in
101.Bx 4.2 .
102The version of
103.Nm rcp
104described here
105has been reimplemented with Kerberos in
106.Bx 4.3 Reno .
b5dc1377 107.Sh BUGS
3b46468b
KM
108Doesn't detect all cases where the target of a copy might
109be a file in cases where only a directory should be legal.
b5dc1377 110.Pp
3b46468b 111Is confused by any output generated by commands in a
b5dc1377
CL
112.Pa \&.login ,
113.Pa \&.profile ,
114or
115.Pa \&.cshrc
116file on the remote host.
117.Pp
891645ee 118The destination user and hostname may have to be specified as
3d98c418
CL
119``rhost.rname'' when the destination machine is running the
120.Bx 4.2
b5dc1377
CL
121version of
122.Nm rcp .