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/10/bin/rcp/rcp.1 320646 2017-07-04 15:53:54Z allanjude $ 31.\" 32.Dd July 3, 2017 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 DEPRECATION NOTICE 47.Nm 48is deprecated and will be removed from future versions of the 49.Fx 50base system. 51If 52.Nm 53is still required, it can be installed from ports or packages 54(net/bsdrcmds). 55.Sh DESCRIPTION 56The 57.Nm 58utility copies files between machines. 59Each 60.Ar file 61or 62.Ar directory 63argument is either a remote file name of the 64form 65.Dq ruser@rhost:path , 66or a local file name (containing no 67.Ql :\& 68characters, 69or a 70.Ql / 71before any 72.Ql :\& Ns 73s). 74.Pp 75The following options are available: 76.Bl -tag -width indent 77.It Fl 4 78Use IPv4 addresses only. 79.It Fl 6 80Use IPv6 addresses only. 81.It Fl p 82Cause 83.Nm 84to attempt to preserve (duplicate) in its copies the modification 85times and modes of the source files, ignoring the 86.Xr umask 2 . 87By default, the mode and owner of 88.Ar file2 89are preserved if it already existed; otherwise the mode of the source file 90modified by the 91.Xr umask 2 92on the destination host is used. 93.It Fl r 94If any of the source files are directories, 95.Nm 96copies each subtree rooted at that name; in this case 97the destination must be a directory. 98.El 99.Pp 100If 101.Ar path 102is not a full path name, it is interpreted relative to 103the login directory of the specified user 104.Ar ruser 105on 106.Ar rhost , 107or your current user name if no other remote user name is specified. 108A 109.Ar path 110on a remote host may be quoted (using 111.Ql \e , 112.Ql \&" , 113or 114.Ql \(aa ) 115so that the metacharacters are interpreted remotely. 116.Pp 117The 118.Nm 119utility does not prompt for passwords; it performs remote execution 120via 121.Xr rsh 1 , 122and requires the same authorization. 123.Pp 124The 125.Nm 126utility handles third party copies, where neither source nor target files 127are on the current machine. 128.Sh SEE ALSO 129.Xr cp 1 , 130.Xr ftp 1 , 131.Xr rlogin 1 , 132.Xr rsh 1 , 133.Xr hosts.equiv 5 134.Sh HISTORY 135The 136.Nm 137command appeared in 138.Bx 4.2 . 139The version of 140.Nm 141described here 142has been reimplemented with Kerberos in 143.Bx 4.3 Reno . 144.Sh BUGS 145Does not detect all cases where the target of a copy might 146be a file in cases where only a directory should be legal. 147.Pp 148Is confused by any output generated by commands in a 149.Pa .login , 150.Pa .profile , 151or 152.Pa .cshrc 153file on the remote host. 154.Pp 155The destination user and hostname may have to be specified as 156.Dq rhost.ruser 157when the destination machine is running the 158.Bx 4.2 159version of 160.Nm . 161