1*3957bea1Swiz.\" $NetBSD: rcp.1,v 1.22 2012/03/22 07:58:17 wiz Exp $ 26ff461a4Scgd.\" 36ff461a4Scgd.\" Copyright (c) 1983, 1990, 1993 46ff461a4Scgd.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" Redistribution and use in source and binary forms, with or without 761f28255Scgd.\" modification, are permitted provided that the following conditions 861f28255Scgd.\" are met: 961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1261f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1361f28255Scgd.\" documentation and/or other materials provided with the distribution. 14b5b29542Sagc.\" 3. Neither the name of the University nor the names of its contributors 1561f28255Scgd.\" may be used to endorse or promote products derived from this software 1661f28255Scgd.\" without specific prior written permission. 1761f28255Scgd.\" 1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2161f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2861f28255Scgd.\" SUCH DAMAGE. 2961f28255Scgd.\" 306ff461a4Scgd.\" @(#)rcp.1 8.1 (Berkeley) 5/31/93 31346aa5ddScgd.\" 3225e3a7ecSginsbach.Dd March 8, 2005 3361f28255Scgd.Dt RCP 1 34f1247650Sgarbled.Os 3561f28255Scgd.Sh NAME 3661f28255Scgd.Nm rcp 3761f28255Scgd.Nd remote file copy 3861f28255Scgd.Sh SYNOPSIS 397ff9d68cSlukem.Nm 4025e3a7ecSginsbach.Op Fl 46p 4161f28255Scgd.Ar file1 file2 42990562bfSwiz.Nm 4325e3a7ecSginsbach.Op Fl 46pr 4461f28255Scgd.Ar file ... 4561f28255Scgd.Ar directory 4661f28255Scgd.Sh DESCRIPTION 477ff9d68cSlukem.Nm 4814dfaa4bSwizcopies files between machines. 4914dfaa4bSwizEach 5061f28255Scgd.Ar file 5161f28255Scgdor 5261f28255Scgd.Ar directory 5361f28255Scgdargument is either a remote file name of the 541a27add3Swizform 551a27add3Swiz.Dq rname@rhost:path , 561a27add3Swizor a local file name (containing no 571a27add3Swiz.Sq \&: 580d1bfba8Sginsbach(colon) characters, 591a27add3Swizor a 601a27add3Swiz.Sq / 611a27add3Swiz(slash) before any 621a27add3Swiz.Sq \&: 631a27add3Swiz(colon) characters). 6461f28255Scgd.Pp 650d1bfba8SginsbachThe 660d1bfba8Sginsbach.Ar rhost 670d1bfba8Sginsbachcan be an IPv4 or an IPv6 address string. 681a27add3SwizSince IPv6 addresses already contain 691a27add3Swiz.Sq \&: 701a27add3Swiz(colon) characters, 711a27add3Swizan IPv6 address string must be enclosed between 721a27add3Swiz.Sq \&[ 731a27add3Swiz(left square bracket) and 741a27add3Swiz.Sq \&] 751a27add3Swiz(right square bracket) characters. 761a27add3SwizOtherwise, the first occurrence of a 771a27add3Swiz.Sq \&: 781a27add3Swiz(colon) character would be 790d1bfba8Sginsbachinterpreted as the separator between the 800d1bfba8Sginsbach.Ar rhost 810d1bfba8Sginsbachand the 820d1bfba8Sginsbach.Ar path . 830d1bfba8SginsbachFor example, 840d1bfba8Sginsbach.Pp 850d1bfba8Sginsbach.Dl [2001:DB8::800:200C:417A]:tmp/file 860d1bfba8Sginsbach.Pp 870d1bfba8SginsbachOptions: 8861f28255Scgd.Bl -tag -width flag 8925e3a7ecSginsbach.It Fl 4 9025e3a7ecSginsbachUse IPv4 addresses only. 9125e3a7ecSginsbach.It Fl 6 9225e3a7ecSginsbachUse IPv6 addresses only. 9361f28255Scgd.It Fl p 9461f28255ScgdThe 9561f28255Scgd.Fl p 9661f28255Scgdoption causes 977ff9d68cSlukem.Nm 9861f28255Scgdto attempt to preserve (duplicate) in its copies the modification 9961f28255Scgdtimes and modes of the source files, ignoring the 10061f28255Scgd.Ar umask . 10161f28255ScgdBy default, the mode and owner of 10261f28255Scgd.Ar file2 10361f28255Scgdare preserved if it already existed; otherwise the mode of the source file 10461f28255Scgdmodified by the 10561f28255Scgd.Xr umask 2 10661f28255Scgdon the destination host is used. 1076ff461a4Scgd.It Fl r 1086ff461a4ScgdIf any of the source files are directories, 1097ff9d68cSlukem.Nm 1106ff461a4Scgdcopies each subtree rooted at that name; in this case 1116ff461a4Scgdthe destination must be a directory. 11261f28255Scgd.El 11361f28255Scgd.Pp 11461f28255ScgdIf 11561f28255Scgd.Ar path 11661f28255Scgdis not a full path name, it is interpreted relative to 11761f28255Scgdthe login directory of the specified user 11861f28255Scgd.Ar ruser 11961f28255Scgdon 12061f28255Scgd.Ar rhost , 12161f28255Scgdor your current user name if no other remote user name is specified. 12261f28255ScgdA 12361f28255Scgd.Ar path 12461f28255Scgdon a remote host may be quoted (using \e, ", or \(aa) 12561f28255Scgdso that the metacharacters are interpreted remotely. 12661f28255Scgd.Pp 1277ff9d68cSlukem.Nm 12861f28255Scgddoes not prompt for passwords; it performs remote execution 12961f28255Scgdvia 13061f28255Scgd.Xr rsh 1 , 13161f28255Scgdand requires the same authorization. 13261f28255Scgd.Pp 1337ff9d68cSlukem.Nm 13461f28255Scgdhandles third party copies, where neither source nor target files 13561f28255Scgdare on the current machine. 13661f28255Scgd.Sh SEE ALSO 13761f28255Scgd.Xr cp 1 , 13861f28255Scgd.Xr ftp 1 , 1399014bdbcSlukem.Xr rcmd 1 , 140b6573fceStv.Xr rlogin 1 , 141bc5b87e7Swiz.Xr rsh 1 , 1429014bdbcSlukem.Xr rcmd 3 , 143b6573fceStv.Xr hosts.equiv 5 , 1449014bdbcSlukem.Xr rhosts 5 , 14589fb08a9Swiz.Xr environ 7 14661f28255Scgd.Sh HISTORY 14761f28255ScgdThe 1487ff9d68cSlukem.Nm 14923e6aab1Sjtcutility appeared in 15061f28255Scgd.Bx 4.2 . 15161f28255ScgdThe version of 1527ff9d68cSlukem.Nm 15361f28255Scgddescribed here 15461f28255Scgdhas been reimplemented with Kerberos in 15561f28255Scgd.Bx 4.3 Reno . 15661f28255Scgd.Sh BUGS 15761f28255ScgdDoesn't detect all cases where the target of a copy might 15861f28255Scgdbe a file in cases where only a directory should be legal. 15961f28255Scgd.Pp 16061f28255ScgdIs confused by any output generated by commands in a 16161f28255Scgd.Pa \&.login , 16261f28255Scgd.Pa \&.profile , 16361f28255Scgdor 16461f28255Scgd.Pa \&.cshrc 16561f28255Scgdfile on the remote host. 16661f28255Scgd.Pp 16761f28255ScgdThe destination user and hostname may have to be specified as 1681a27add3Swiz.Dq rhost.rname 1691a27add3Swizwhen the destination machine is running the 17061f28255Scgd.Bx 4.2 17161f28255Scgdversion of 172990562bfSwiz.Nm . 173