Solaris Advanced User's Guide

Copying Files From a Remote Machine

To copy from a remote machine to your machine, use the rcp command with the following syntax.

$ rcp machinename:source destination

In the previous example, machinename is the name of the remote machine, source is the name of the file(s) you want to copy, and destination is the path name on your machine where you want the copied file(s) to reside.

The following example illustrates how to copy the file /etc/hosts from the remote machine starbug to the /tmp directory on the local machine venus.

venus$ rcp starbug:/etc/hosts /tmp

You can also combine various abbreviations and syntaxes when using rcp. For example, to copy all of the files ending in .doc from user hank's home directory on remote machine fretful to the current directory on local machine venus, type the following command.

venus$ rcp fretful:~hank/*.doc .