rcp

NAME

rcp - remote file copy

SYNOPSIS

rcp [-Dfpt] file1 file2
rcp [-dDfprt] file ...  directory

DESCRIPTION

The rcp(1) utility copies files between computers. Each file or directory argument is either a remote file name of the form rname@rhost:path or a local file name (containing no ':' characters, or a '/' before any ':'s). The rhost name can be specified in either name or numeric dot-notation.

-d
Ensure that the target should be a directory. If it is not, rcp(1) emits an errors message and exits. This option is a good precaution to avoid clobbering files. By default, the option is turned on when more than one source file has been specified.
-D
This Interix-specific option prefixes the user's name with the user's Windows domain name.

When rcp(1) is used for remote-to-remote copies, the Windows domain name is prefixed to the user's name for the source files. That is, the command

rcp -D loki@asgard:ragnarok loki@bifrost:plans
is treated as:
rcp PANTHEON+loki@asgard:ragnarok loki@bifrost:plans

When used for remote-to-local copies, both user names are prefixed with the user's domain name. Again, assuming user loki in Windows domain PANTHEON, these two commands are equivalent:

rcp -D @asgard:ragnarok plans
rcp PANTHEON+loki@asgard:ragnarok plans
If the user name is specified, however, it is assumed to be correct and complete.
rcp -D thor@asgard:hammer problems
is logically equivalent to:
rcp thor@asgard:hammer problems
-f
Force rcp(1) into source mode. This option overrides -t.
-p
The -p option causes rcp(1) to attempt to preserve (duplicate) in its copies the modification times and modes of the source files, ignoring the umask. By default, the mode and owner of file2 are preserved if it already existed; otherwise, the mode of the source file modified by the by the umask on the destination host is used. For information on the umask, see umask(2).
-r
If any of the source files are directories, rcp(1) copies each subtree rooted at that name; in this case the destination must be a directory.
-t
Force rcp(1) into sink (or receive) mode. If both -f and -t are given, -f takes precedence.

If path is not a full path name, it is interpreted relative to the login directory of the specified user ruser on rhost, or your current user name if no other remote user name is specified. A path on a remote host can be quoted (using \, ", or ') so that the metacharacters are interpreted remotely.

The rcp(1) utility does not prompt for passwords; it performs remote execution through rsh(1), and requires the same authorization.

The rcp(1) utility handles third-party copies, where neither source nor target files are on the current computer.

NOTES

Does not detect all cases where the target of a copy might be a file when only a directory should be legal.

Is confused by any output generated by commands in a .login, .profile, or .cshrc file on the remote host.

The destination user and host name might have to be specified as "rhost.rname" when the destination computer is running the Berkeley Software Distribution (BSD) 4.2 version of rcp(1).

FILES

The rcp(1) command uses the following files, if they exist:
$HOME/.rhosts
This file is on the destination computer; see rshd(1) for a description.

SEE ALSO

cp(1)

ftp(1)

rsh(1)

rshd(1)

rlogin(1)