rcp - remote file copy
rcp [ -p ] [ -v ] file1 file2
rcp [ -p ] [ -r ] [ -v ] file ... directory
rcp copies files between machines. Each file or directory argument has
one of these forms:
o A local filename, path, containing no : characters, or a \ before any
o A remote filename of the form remhost:path.
o A remote filename of the the form remuser@remhost:path, which uses the
user name remuser rather than the current user name on the remote
If path is not a full pathname, it is interpreted relative to your login
directory on remhost. A path on a remote host can be quoted (using \, ",
or ') so that the metacharacters are interpreted remotely.
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(2)
on the destination host is used.
The options to rcp are:
-p Causes rcp to attempt to preserve (duplicate) in its copies the
modification times and modes of the source files, ignoring the
-r If any of the source files are directories, rcp copies each subtree
rooted at that name; in this case the destination must be a
-v Causes the filename to be printed as it is copied to or from a
rcp does not prompt for passwords; your current local user name must
exist on remhost and allow remote command execution via rsh(1C).
rcp handles third party copies, where neither source nor target files are
on the current machine. Hostname-to-address translation of the target
host is performed on the source host.
cp(1), ftp(1C), rlogin(1C), rsh(1C), hosts(4), rhosts(4).
rcp doesn't detect all cases where the target of a copy might be a file
in cases where only a directory should be legal.
The exit status is not correct in all error cases when both source and
destination are remote; this is due to a limitation of the protocol.
If you use csh(1), rcp does not work if your .cshrc file on the remote
host unconditionally executes interactive or output-generating commands.
is displayed when this happens. Put the offending commands inside the
following conditional block:
if ($?prompt) then
so they won't interfere with rcp, rsh, and other non-interactive,
rcp cannot handle filenames that have embedded newline characters. A
newline character is a rcp protocol delimiter. The error message when
this happens is:
protocol screwup: unexpected <newline>
PPPPaaaaggggeeee 2222 [ Back ]