RCP(1c,C) AIX TCP/IP User s Guide RCP(1c,C) ------------------------------------------------------------------------------- rcp PURPOSE Copies and transfers remote files. SYNTAX +------+ +-- file1 --- file2 --------------+ rcp ---| |---| +------+ |---| +- -p -+ +-| |--- file --- directory -+ +- -r -+ ^ | +--------+ DESCRIPTION The rcp command copies files between machines. It is generally used to access files outside your cluster. Each file argument is either a local file name or a remote file name. The local file name must contain either no colon (:) characters or a slash (/) before any colons. The remote file name has the form: [[user name@]machine:] [pathname] file You may specify a remote host, a particular user account on that host, a pathname and a file name. All but the file name are optional. If user name is specified, @machine: must be specified with it. If pathname is not a full path name, it is interpreted relative to your login directory on the remote host. A path on a remote host may be quoted (using, ", or ') so that the metacharacters are interpreted remotely. The rcp command does not prompt for passwords. Ordinarily, your current local user name must exist on rhost and must allow remote execution via rsh. Also, an .rhosts file must exist on rhost and it must contain the name of your local host. To transfer files to or from a remote machine that does not have a login for your current local user name, there is an alternate form of the command. The following formats allow you to specify a different account name at the far end of the connection: rcp name@machine:file file rcp file name@machine:file Processed April 9, 1991 RCP(1c,C) 1 RCP(1c,C) AIX TCP/IP User s Guide RCP(1c,C) The rcp command can also handle remote-to-remote copies, where neither the source nor the target files are on the machine where rcp is expected to run. A remote host name may be specified in the user@host format. The remote user name given can be different from the local user name. The destination host name may also take the form rhost.rname, to support hosts that are running 4.2BSD versions of rcp. Note: The command is confused by any output generated by commands in .cshrc in the event that csh is the login shell of the remote machine. FLAGS The rcp command options are: -p Causes the rcp command to attempt to preserve (duplicate) in its copies the modification times and modes of the source files, ignoring the umask. -r Copies each subtree rooted, if any of the source files are directories. By default, the mode and owner of file2 are preserved if it already existed. Otherwise, the mode of the source file modified by the umask on the destination host that is used. EXAMPLES 1. Remote-copy the file myfile.1 from the local host to the remote host named remote_host, and name the file myfile.2 on the remote host. Then copy the file myfile.2 from the remote host back to the local host. $ rcp myfile.1 remote_host:myfile.2 $ rcp remote_host:myfile.2 myfile.3 2. A user "John" logged into host6 can execute the following commands, provided that he has appropriate access privileges: $ rcp mary@host7:oldfile fred@host8:newfile $ rcp mary@host7:oldfile vax4_2bsd.fred:newfile RELATED INFORMATION In this book: "ftp" "rsh, remsh" "rlogin" ".rhosts" "hosts.equiv" cp, refer to AIX Operating System Commands Reference Processed April 9, 1991 RCP(1c,C) 2