rcp.1 (2010 09)

r
rcp(1) rcp(1)
hostname Hostname of remote system where directories and files are located.
pathname Absolute directory path name or directory path name relative to the login directory of
user user_name .
filename Actual name of source or destination file. File name expansion is allowed on source
file names.
dirname Actual name of source or destination directory subtree. File name expansion is
allowed on source directory names.
Each file or directory argument is either a remote file name of the form hostname
:path, or a local file
name (with a slash (
/) before any colon (
:)). hostname can be either an official host name or an alias (see
hosts (4)). If hostname is of the form ruser
@rhost, ruser is used on the remote host instead of the current
user name. An unspecified path (that is, hostname
:) refers to the remote user’s login directory. If path
does not begin with
/, it is interpreted relative to the remote user’s login directory on hostname . Shell
metacharacters in remote paths can be quoted with backslash (
\), single quotes (
’’), or double quotes
(
""), so that they will be interpreted remotely.
rcp does not prompt for passwords. In a non-secure or traditional environment, user authorization is
checked by determining if the current local user name or any user name specified via ruser exists on
rhost . In a Kerberos V5 Network Authentication or secure environment, the authorization method is
dependent upon the command line options for
remshd (see remshd (1M) for details). In either case,
remote command execution via remsh (1) and rcmd(3N), or rcmd_af (3N) in case of IPv6 systems, must be
allowed and remshd (1M) must be executable on the remote host.
Third-Party Transfers
Third-party transfers in the following form:
rcp ruser1@rhost1:path1 ruser2@rhost2:path2
are performed as:
remsh rhost1 -l ruser1 rcp path1 ruser2@rhost2:path2
Therefore, for a such a transfer to succeed, ruser2 on rhost2 must allow access by ruser1 from rhost1 (see
hosts.equiv (4)).
rcp With IPv6 Address
To invoke
rcp with an IPv6 address, the IPv6 address must be enclosed in a pair of square brackets (
[
and ]) as shown in the example below.
rcp source user@[IPv6_address]:dest
If the IPv6 address is not enclosed within square brackets, the first occurrence of a colon (
:) is treated as
the separator between the hostname and the path .
WARNINGS
The
rcp routine is confused by any output generated by commands in a .cshrc file on the remote host
(see csh(1)).
Copying a file onto itself, for example:
rcp path ‘hostname‘:path
may produce inconsistent results. The current HP-UX version of rcp simply copies the file over itself.
However, some implementations of rcp, including some earlier HP-UX implementations, corrupt the file.
In addition, the same file may be referred to in multiple ways, for example, via hard links, symbolic links,
or NFS. It is not guaranteed that rcp will correctly copy a file over itself in all cases.
Implementations of
rcp based on the 4.2BSD version (including the implementations of
rcp prior to
HP-UX 7.0) require that remote users be specified as rhost .ruser . If the first remote host specified in a
third party transfer (rhost1 in the example below) uses this older syntax, the command must have the
form:
rcp ruser1@rhost1:path1 rhost2.ruser2:path2
since the target is interpreted by rhost1 . A common problem is encountered when two remote files are to
be copied to a remote target that specifies a remote user. If the two remote source systems, rhost1 and
rhost2 , each expect a different form for the remote target, the command:
rcp rhost1:path1 rhost2:path2 rhost3.ruser3:path3
HP-UX 11i Version 3: September 2010 3 Hewlett-Packard Company 3