rcp copies files between machines. Each file or directory argument is either a remote file name of the form
or a local file name.
If path is not a full path name, it is interpreted relative to the HOME directory of the specified user rname on rhost. The local user name (that is, the name you are currently logged in as) including either your domain name (or your machine name if you are not a domain user) is used as rname if no other remote user name is specified.
rcp uses the colon (:) to separate the host name and path name which can create problems when you want to specify local file names which contain a colon following a drive letter. As a result, when a file argument on the command line is of the x:path (that is, a single letter followed by a colon and a path name), rcp treats the argument as path on drive x of the local system as opposed to path on a host named x. As an alternative, you can specify local file names on a rcp command line, by using an equal sign (=) in place of the colon and prefixing the name with a slash. For example, you could specify the local file c:/testfile as /c=/testfile.
rcp does not prompt for passwords; it performs remote execution using rsh and requires the same authorization as that command. The rsh reference page provides additional information on how rsh communicates with a rshd service (or daemon) to execute commands remotely.
If an attempted rcp connection to the host fails because of an error matching "permission.*denied" or "remuser too long in a case-insensitive manner, the utility immediately tries again, sending only the user name without domain (or machine) information.
Because the rsh and rcp utilities resend the current without the domain if it is too long and the rlogin utility does not, a user may require two entries in the hosts.equiv or .rhosts file. If the full name (including domain) is too long for the rshd service (or daemon) being used, the user needs one entry with the full user name (including domain) for use with rlogind and a second with the the same user name minus the domain for use with rshd.
rcp handles third party copies, where neither source nor target files are on the current machine.
If rcp fails with a TIMEOUT error on Windows 2012/8.1/2012R2/10/2016/2019 when it should have succeeded, the user can tell rcp to retry with:
A TIMEOUT error is indicated by the following error message:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
enables socket debugging on the TCP sockets used for communication with the remote host.
attempts to preserve (duplicate) the modification times and modes of the source files in the copies created. By default, the mode and owner of the destination file (file2) are preserved if the file already existed; otherwise, the mode of the source file (file1) modified by the umask on the destination host is used.
treats the last command line argument as the target directory and copies all preceding arguments (that is, the source files) to that directory. If any of the source files are directories, rcp copies each subtree rooted at that name to the target directory.
An operation was attempted on something that is not a socket
when set, rcp retries to establish a connection when it fails with a TIMEOUT error on Windows 2012/8.1/2012R2/10/2016/2019.
Possible exit status values are:
When the destination machine is running the BSD 4.2 version of rcp, the destination user and host name may have to be specified as rhost.rname.
This product includes software developed by the University of California, Berkeley and its contributors.
All UNIX systems. Windows Server 2012. Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019.
Linux and UNIX versions of rcp do not support including domain information in rname. This functionality is an MKS extension.
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
MKS Toolkit Connectivity Solutions Guide
PTC MKS Toolkit 10.3 Documentation Build 39.