1.\" $NetBSD: rcp.1,v 1.22 2012/03/22 07:58:17 wiz Exp $ 2.\" 3.\" Copyright (c) 1983, 1990, 1993 4.\" The Regents of the University of California. All rights reserved. 5.\" 6.\" Redistribution and use in source and binary forms, with or without 7.\" modification, are permitted provided that the following conditions 8.\" are met: 9.\" 1. Redistributions of source code must retain the above copyright 10.\" notice, this list of conditions and the following disclaimer. 11.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" notice, this list of conditions and the following disclaimer in the 13.\" documentation and/or other materials provided with the distribution. 14.\" 3. Neither the name of the University nor the names of its contributors 15.\" may be used to endorse or promote products derived from this software 16.\" without specific prior written permission. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28.\" SUCH DAMAGE. 29.\" 30.\" @(#)rcp.1 8.1 (Berkeley) 5/31/93 31.\" 32.Dd March 8, 2005 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 file ... 45.Ar directory 46.Sh DESCRIPTION 47.Nm 48copies files between machines. 49Each 50.Ar file 51or 52.Ar directory 53argument is either a remote file name of the 54form 55.Dq rname@rhost:path , 56or a local file name (containing no 57.Sq \&: 58(colon) characters, 59or a 60.Sq / 61(slash) before any 62.Sq \&: 63(colon) characters). 64.Pp 65The 66.Ar rhost 67can be an IPv4 or an IPv6 address string. 68Since IPv6 addresses already contain 69.Sq \&: 70(colon) characters, 71an IPv6 address string must be enclosed between 72.Sq \&[ 73(left square bracket) and 74.Sq \&] 75(right square bracket) characters. 76Otherwise, the first occurrence of a 77.Sq \&: 78(colon) character would be 79interpreted as the separator between the 80.Ar rhost 81and the 82.Ar path . 83For example, 84.Pp 85.Dl [2001:DB8::800:200C:417A]:tmp/file 86.Pp 87Options: 88.Bl -tag -width flag 89.It Fl 4 90Use IPv4 addresses only. 91.It Fl 6 92Use IPv6 addresses only. 93.It Fl p 94The 95.Fl p 96option causes 97.Nm 98to attempt to preserve (duplicate) in its copies the modification 99times and modes of the source files, ignoring the 100.Ar umask . 101By default, the mode and owner of 102.Ar file2 103are preserved if it already existed; otherwise the mode of the source file 104modified by the 105.Xr umask 2 106on the destination host is used. 107.It Fl r 108If any of the source files are directories, 109.Nm 110copies each subtree rooted at that name; in this case 111the destination must be a directory. 112.El 113.Pp 114If 115.Ar path 116is not a full path name, it is interpreted relative to 117the login directory of the specified user 118.Ar ruser 119on 120.Ar rhost , 121or your current user name if no other remote user name is specified. 122A 123.Ar path 124on a remote host may be quoted (using \e, ", or \(aa) 125so that the metacharacters are interpreted remotely. 126.Pp 127.Nm 128does not prompt for passwords; it performs remote execution 129via 130.Xr rsh 1 , 131and requires the same authorization. 132.Pp 133.Nm 134handles third party copies, where neither source nor target files 135are on the current machine. 136.Sh SEE ALSO 137.Xr cp 1 , 138.Xr ftp 1 , 139.Xr rcmd 1 , 140.Xr rlogin 1 , 141.Xr rsh 1 , 142.Xr rcmd 3 , 143.Xr hosts.equiv 5 , 144.Xr rhosts 5 , 145.Xr environ 7 146.Sh HISTORY 147The 148.Nm 149utility appeared in 150.Bx 4.2 . 151The version of 152.Nm 153described here 154has been reimplemented with Kerberos in 155.Bx 4.3 Reno . 156.Sh BUGS 157Doesn't detect all cases where the target of a copy might 158be a file in cases where only a directory should be legal. 159.Pp 160Is confused by any output generated by commands in a 161.Pa \&.login , 162.Pa \&.profile , 163or 164.Pa \&.cshrc 165file on the remote host. 166.Pp 167The destination user and hostname may have to be specified as 168.Dq rhost.rname 169when the destination machine is running the 170.Bx 4.2 171version of 172.Nm . 173