[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    rcp(1) manual page Table of Contents

Name

rcp - remote file copy

Synopsis

rcp [ -p ] filename1 filename2
rcp [ -pr ] filename...directory

Availability

SUNWcsu

Description

The rcp command copies files between machines. Each filename or directory argument is either a remote file name of the form:
hostname:path

or a local file name (containing no ":" (colon) characters, or "/" (backslash) before any ":" (colon) characters).

If a filename is not a full path name, it is interpreted relative to your home directory on hostname. A path on a remote host may be quoted using \, ", or , so that the metacharacters are interpreted remotely.

rcp does not prompt for passwords; your current local user name must exist on hostname and allow remote command execution by rsh(1) .

rcp handles third party copies, where neither source nor target files are on the current machine. Hostnames may also take the form

username@hostname:filename

to use username rather than your current local user name as the user name on the remote host. rcp also supports Internet domain addressing of the remote host, so that:

username@host.domain:filename

specifies the username to be used, the hostname, and the domain in which that host resides. File names that are not full path names will be interpreted relative to the home directory of the user named username, on the remote host.

Options

-p
Attempt to give each copy the same modification times, access times, modes, and ACLs if applicable as the original file.
-r
Copy each subtree rooted at filename; in this case the destination must be a directory.

Files

$HOME/.profile

See Also

cpio(1) , ftp(1) , rlogin(1) , rsh(1) , setfacl(1) , tar(1) , hosts.equiv(4)

Notes

rcp is meant to copy between different hosts; attempting to rcp
a file onto itself, as with:
rcp tmp/file myhost:/tmp/file

results in a severely corrupted file.

rcp may not correctly fail when the target of a copy is a file instead of a directory.

rcp can become confused by output generated by commands in a $HOME /.profile on the remote host.

rcp requires that the source host have permission to execute commands on the remote host when doing third-party copies.

rcp does not properly handle symbolic links. Use tar (see tar(1) ) or cpio (see cpio(1) ) piped to rsh to obtain remote copies of directories containing symbolic links or named pipes.

If you forget to quote metacharacters intended for the remote host, you will get an incomprehensible error message.

rcp will fail if you copy ACLs to a file system that does not support ACLs.


Table of Contents