rcp



Copyright Phillip Farrell. Last revision August 3, 2004

Works just like the standard local Unix copy command, cp, except that you put the name of the remote system, followed by a colon, in front of the pathname specification for the remote file.

You can copy either direction, to or from the remote system, with rcp. You can even do third-party copies between two remote machines. If no directory is specified for the remote system, your home directory there is assumed.

Just like cp, rcp will silently remove any existing file that is "in the way" of making its copy, at either end. But unlike cp, there is no -i option that you can use with rcp to force it to ask you first before overwriting an existing file. You need to check with ls to make sure that your new file name is not already taken on the local computer or rsh remotecomputer ls to make sure that your new file name is not already taken on remotecomputer.

Examples:

  • rcp myfile toquima:
    Copies myfile to your home directory on toquima.
  • rcp myfile toquima:/newdir/newname
    Copies myfile to /newdir/newname on toquima.
  • rcp toquima:myotherfile .
    Gets a copy of myotherfile from your home directory on toquima and puts it in your current working directory on the local machine.

There is a -r option to copy an entire directory tree with one command.

rcp copies either binary or ASCII files okay between Unix machines.

Comments or Questions?