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