RCP(1N) COMMAND REFERENCE RCP(1N) NAME rcp - remote file copy SYNOPSIS rcp filename1 filename2 rcp [ -r ] [ -l ] [ -p ] filename ... directory DESCRIPTION Copy files between machines using rcp; each filename or directory argument is either a remote file name of the form rhostname:pathname, or a local file name - no colon characters (:) allowed, no slash (/) before any colons. If the -r option is specified and any of the source files are directories (and -l is not specified, or the file is not a symbolic link), rcp copies each subtree rooted at that name; in this case the destination must be a directory. With the -l option, any source file which is a symbolic link will be copied without being followed, whether it links to a directory, or whether the -r option is given. If path is not a full path name, it is interpreted relative to your login directory on rhost. 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. Therefore, access to the remote system is based on the contents of either of two files on the remote system: .rhosts in a remote user's login directory or /etc/hosts.equiv. See rlogin(1n) for more details. The command rcp normally requires the current local user name to exist on rhostname; to circumvent this requirement, host names may take the form rhostname.rname using rname rather than the current user name on the remote host. The rcp command handles third party copies, where neither source nor target files are on the current machine. OPTIONS -r Recursively copy all files and subdirectories from the given source directories; the destination must be a directory. -l Copy symbolic links instead of following them. Copied links will look just like the original. -p Preserves modification time; works like the command cp -p. EXAMPLES In the following example, rcp copies all files with Printed 4/6/89 1
RCP(1N) COMMAND REFERENCE RCP(1N) extensions .c in the user's login directory on host1 to the directory named src on the local system. Note that *.c is quoted so that the local shell will not attempt to expand the wildcard character *. The quotes will, however, be stripped off by the local shell so that the shell on the remote host will do the file name expansion. rcp host1:"*.c" src The next example copies the directory doc (in jeffm's home directory on host1) and all the files in it (including other directories) to chrisd's directory on the local host. Use of .jeffm is only necessary if the user initiating the rcp is not jeffm; for this approach to work, the user's username initiating the rcp must appear along with the name of his host machine in the .rhosts file in jeffm's home directory. (See .rhosts(5n)). rcp -r host1.jeffm:doc /usr/chrisd The following example copies the local files file1 and file2 and remote file file3 on host2 to the directory dir1 on host1. rcp -r file1 file2 host2:file3 host1:dir1 DIAGNOSTICS The command rcp prints error messages received from the remote rcp as well as messages generated by the shell on the remote host. The latter have the format: rcp : Message from rhost: <message> If you are using csh(1csh) on the remote system rcp prints any output generated by commands in the remote .cshrc file. RETURN VALUE [USAGE] Incorrect command line syntax. Execution terminated. [NP_WARN] An error warranting a warning message occurred. Execution continues. [NP_ERR] An error occurred that was not a system error. Execution terminated. [P_WARN] A system error occurred. Execution continues. See intro(2) for more information on system errors. Printed 4/6/89 2
RCP(1N) COMMAND REFERENCE RCP(1N) [P_ERR] A system error occurred. Execution terminated. See intro(2) for more information on system errors. [INTERNAL] An unexpected error occurred. Execution was terminated. Record the message and save the core file for analysis. Contact service personnel at your Tektronix field office. SEE ALSO ftp(1n), rsh(1n), rlogin(1n), .rhosts(5n), and hosts.equiv(5n). Printed 4/6/89 3
%%index%% na:240,74; sy:314,362; de:676,2114; op:2790,469; ex:3259,176;3747,1367; di:5114,604; rv:5718,609;6639,427; se:7066,269; %%index%%000000000153