1.\"-
2.\" Copyright (c) 1983, 1990, 1993
3.\"	The Regents of the University of California.  All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\" 4. Neither the name of the University nor the names of its contributors
14.\"    may be used to endorse or promote products derived from this software
15.\"    without specific prior written permission.
16.\"
17.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27.\" SUCH DAMAGE.
28.\"
29.\"	@(#)rcp.1	8.1 (Berkeley) 5/31/93
30.\" $FreeBSD: stable/9/bin/rcp/rcp.1 238481 2012-07-15 11:39:35Z des $
31.\"
32.Dd October 16, 2002
33.Dt RCP 1
34.Os
35.Sh NAME
36.Nm rcp
37.Nd remote file copy
38.Sh SYNOPSIS
39.Nm
40.Op Fl 46p
41.Ar file1 file2
42.Nm
43.Op Fl 46pr
44.Ar
45.Ar directory
46.Sh DESCRIPTION
47The
48.Nm
49utility copies files between machines.
50Each
51.Ar file
52or
53.Ar directory
54argument is either a remote file name of the
55form
56.Dq ruser@rhost:path ,
57or a local file name (containing no
58.Ql :\&
59characters,
60or a
61.Ql /
62before any
63.Ql :\& Ns
64s).
65.Pp
66The following options are available:
67.Bl -tag -width indent
68.It Fl 4
69Use IPv4 addresses only.
70.It Fl 6
71Use IPv6 addresses only.
72.It Fl p
73Cause
74.Nm
75to attempt to preserve (duplicate) in its copies the modification
76times and modes of the source files, ignoring the
77.Xr umask 2 .
78By default, the mode and owner of
79.Ar file2
80are preserved if it already existed; otherwise the mode of the source file
81modified by the
82.Xr umask 2
83on the destination host is used.
84.It Fl r
85If any of the source files are directories,
86.Nm
87copies each subtree rooted at that name; in this case
88the destination must be a directory.
89.El
90.Pp
91If
92.Ar path
93is not a full path name, it is interpreted relative to
94the login directory of the specified user
95.Ar ruser
96on
97.Ar rhost ,
98or your current user name if no other remote user name is specified.
99A
100.Ar path
101on a remote host may be quoted (using
102.Ql \e ,
103.Ql \&" ,
104or
105.Ql \(aa )
106so that the metacharacters are interpreted remotely.
107.Pp
108The
109.Nm
110utility does not prompt for passwords; it performs remote execution
111via
112.Xr rsh 1 ,
113and requires the same authorization.
114.Pp
115The
116.Nm
117utility handles third party copies, where neither source nor target files
118are on the current machine.
119.Sh SEE ALSO
120.Xr cp 1 ,
121.Xr ftp 1 ,
122.Xr rlogin 1 ,
123.Xr rsh 1 ,
124.Xr hosts.equiv 5
125.Sh HISTORY
126The
127.Nm
128command appeared in
129.Bx 4.2 .
130The version of
131.Nm
132described here
133has been reimplemented with Kerberos in
134.Bx 4.3 Reno .
135.Sh BUGS
136Does not detect all cases where the target of a copy might
137be a file in cases where only a directory should be legal.
138.Pp
139Is confused by any output generated by commands in a
140.Pa .login ,
141.Pa .profile ,
142or
143.Pa .cshrc
144file on the remote host.
145.Pp
146The destination user and hostname may have to be specified as
147.Dq rhost.ruser
148when the destination machine is running the
149.Bx 4.2
150version of
151.Nm .
152