TCP/IP Remote Utilities |
Use the host.user variables to use a user name other than the current user name. If host.user is specified with source, the Rhosts file on the remote host must contain an entry for user.
If a host name is supplied as a full domain name containing periods, a user name must be appended to the host name. This prevents the last element of the domain name from being interpreted as a user name. For example:
Rcp domain-name1.user:johns domain-name2.user:buddyg
Remote processing is performed by a command run from the user's logon shell on most UNIX computers. The user's profile or Cshrc is executed before parsing file names, and exported shell variables can be used (using the escape characters or quotation marks) in remote file names.
If you try to copy several files to a file rather than to a directory, only the last file is copied. Also, the rcp command cannot copy a file onto itself.
These examples demonstrate syntax for the most common uses of rcp.
To copy a local file to the logon directory of a remote computer:
rcp <file name remote computer>
To copy a local file to an existing directory and a new file name on a remote computer:
rcp <file name remote computer:/directory/newfile name>
To copy multiple local files to a subdirectory of a remote logon directory:
rcp <file1 file2 file3 remote computer:subdirectory/filesdirectory>
To copy from a remote source to the current directory of the local computer:
rcp <remote computer:file name>
To copy multiple files from multiple remote sources to a remote destination with different user names:
rcp <remote1.user1:file1 remote2.user2:file2 remotedest.destuser:directory>
To copy from a remote computer using an IP address to a local computer (where the user name is mandatory because a period is used in the remote host name):
rcp <IP address.user:file name file name>