1.\" $NetBSD: rcp.1,v 1.18 2004/09/05 08:48:32 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 September 5, 2004 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 p 41.Ar file1 file2 42.Nm 43.Op Fl pr 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 ``rname@rhost:path'', or a local file name (containing no `:' characters, 55or a `/' before any `:'s). 56.Pp 57.Bl -tag -width flag 58.It Fl p 59The 60.Fl p 61option causes 62.Nm 63to attempt to preserve (duplicate) in its copies the modification 64times and modes of the source files, ignoring the 65.Ar umask . 66By default, the mode and owner of 67.Ar file2 68are preserved if it already existed; otherwise the mode of the source file 69modified by the 70.Xr umask 2 71on the destination host is used. 72.It Fl r 73If any of the source files are directories, 74.Nm 75copies each subtree rooted at that name; in this case 76the destination must be a directory. 77.El 78.Pp 79If 80.Ar path 81is not a full path name, it is interpreted relative to 82the login directory of the specified user 83.Ar ruser 84on 85.Ar rhost , 86or your current user name if no other remote user name is specified. 87A 88.Ar path 89on a remote host may be quoted (using \e, ", or \(aa) 90so that the metacharacters are interpreted remotely. 91.Pp 92.Nm 93does not prompt for passwords; it performs remote execution 94via 95.Xr rsh 1 , 96and requires the same authorization. 97.Pp 98.Nm 99handles third party copies, where neither source nor target files 100are on the current machine. 101.Sh SEE ALSO 102.Xr cp 1 , 103.Xr ftp 1 , 104.Xr rcmd 1 , 105.Xr rlogin 1 , 106.Xr rsh 1 , 107.Xr rcmd 3 , 108.Xr hosts.equiv 5 , 109.Xr rhosts 5 , 110.Xr environ 7 111.Sh HISTORY 112The 113.Nm 114utility appeared in 115.Bx 4.2 . 116The version of 117.Nm 118described here 119has been reimplemented with Kerberos in 120.Bx 4.3 Reno . 121.Sh BUGS 122Doesn't detect all cases where the target of a copy might 123be a file in cases where only a directory should be legal. 124.Pp 125Is confused by any output generated by commands in a 126.Pa \&.login , 127.Pa \&.profile , 128or 129.Pa \&.cshrc 130file on the remote host. 131.Pp 132The destination user and hostname may have to be specified as 133``rhost.rname'' when the destination machine is running the 134.Bx 4.2 135version of 136.Nm . 137