In Unix, what is rcp, and how do I use it?
Note: The software discussed here is no longer in common use at IU, and UITS may no longer be able to verify this text's accuracy; additionally, the UITS Support Center may no longer have the materials needed to adequately support this software.
rcp is inherently insecure,
UITS strongly recommends that you do not use it. UITS
computers will not accept
rcp requests. For a secure
alternative, try scp, which is installed on all UITS
rcp command is used to copy files between different
computers without starting an FTP session or logging into the
remote system explicitly. To use the
rcp command, you must
have every system you intend to use as a source or destination in your
The syntax for the
rcp command is as follows:
rcp filename1 filename2
rcp filename1 ... directory
In the example above, each instance of
directory is in the form
If the file is on your local system, you can omit
For example, if you are on a computer called
and you want to copy the files
bar.c , and
baz.c to a directory called
source in your account on a computer called
ministry.rock.net, you would enter the following:
rcp foo.c bar.c baz.c ministry:source
There are a number of problems you might encounter when trying to use
- Wildcards on the remote system must be in quotes. This is because
the Unix shell expands unquoted wildcards, not
- If you copy a file onto itself by accident, your file will be
- Copying symbolic links with
rcpdoesn't work. In this case, you're better off using FTP or the tar command instead.
Last modified on May 13, 2009.