rcp.1 (2010 09)
r
rcp(1) rcp(1)
both local and remote systems. Multiple files and directory subtrees can be copied
from one or more systems to a single destination directory by using a single com-
mand.
dest_file This option specifies the name of the destination file. If host name and path name
are not specified, then the existing file is copied into a file named dest_file in the
current directory on the local system. If dest_file already exists and is writable,
then the existing file is overwritten. The destination file names are constructed in
the same way as source files except that the usage of file name expansion characters
is forbidden in the case of destination file names.
dest_dir This option specifies the name of the destination directory. If host name and path
names are not specified, then the existing file is copied into a directory named
dest_dir in the current directory on the local system. If dest_dir already exists in
the specified directory path (or current directory if not specified), then a new direc-
tory named dest_dir is created underneath the existing directory named dest_dir .
The destination directory names are constructed the in same way as source direc-
tory tree names except that the usage of file name expansion characters is forbidden
in the case of destination directory names.
If the source_dir has more than one file to be copied, the dest_dir does not exist, and
if the
-r option is used for recursive copying, then rcp first creates the dest_dir
and later copies the files under the source_dir to the dest_dir .
file_or_dir If a combination of files and directories are specified for copying (either explicitly or
by file name expansion), then only files are copied unless the
-r option is specified.
If the -r option is present, then all the files and directory subtrees whose names
match the specified file_or_dir name are copied.
-k realm This option is applicable only in a secure environment based on Kerberos V5. It can
be used to obtain tickets from the remote host in the specified realm instead of the
remote host’s default realm as specified in the configuration file
krb.realms.
-P This option is applicable only in a secure environment based on Kerberos V5. It dis-
ables Kerberos authentication. If the remote host has been configured to prevent
non-secure access, using this option would result in the generic error,
krcmd: connect: hostname : Connection refused
See DIAGNOSTICS in remshd(1M) for more details.
-p This option can be used to preserve (duplicate) modification times and modes (per-
missions) of source files, ignoring the current setting of the umask file creation
mode mask. If this option is specified, rcp preserves the sticky bit only if the tar-
get user is superuser.
If the
-p option is not specified, rcp preserves the mode and owner of dest_file if it
already exists; otherwise
rcp uses the mode of the source file modified by the
umask on the destination host. Modification and access times of the destination file
are set to the time when the copy was made.
-S size This option sets the size of the socket send buffer.
-R size This option sets the size of the socket receive buffer.
-r This option can be used to recursively copy directory subtrees rooted at the source
directory name. If any directory subtrees are to be copied, rcp recursively copies
each subtree rooted at the specified source directory name to directory dest_dir .If
source_dir is being copied to an existing directory of the same name, rcp creates a
new directory source_dir within dest_dir and copies the subtree rooted at source_dir
to dest_dir /source_dir.Ifdest_dir does not exist, rcp first creates it and copies the
subtree rooted at source_dir to dest_dir and the output will be similar irrespective
of whether a wildcard character (source_dir/*) is used for copying or otherwise.
Constructing File and Directory Names
As indicated above, file and directory names contain one, two, or four component parts:
user_name Login name to be used for accessing directories and files on remote system.
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010