
The ECN No Name Newsletter is no longer being published.
This is an archived issue.
[previous article]
[next article]
Using RCP to Copy Files between Machines
Marian Hensler
Remote copy (RCP) is the UNIX utility designed to copy files and
directories between machines. This utility allows copying
between your account on the local machine (machine logged into)
and a remote machine (other machine) after appropriate
permissions are set up.
- ADVANTAGE of using RCP is you can use it anytime. It is
quick and easy.
- DISADVANTAGE of using RCP is that when set up between
individuals, personal files can not be kept private;
therefore, this arrangement should be temporary and only
done when an account owner is willing to permit another
person complete access to all his files.
The examples below have been set up with EI being the local
machine and GA being the remote machine; thus, we are copying
files and directories from the remote machine, GA, or sending
files to GA. In these examples someone else is the owner of the
remote account. In reality you might have accounts on multiple
machines and you could use RCP between your various accounts.
The only difference is that the portion of the command reading
his_login@ would be omitted.
- CREATE a permission file on the remote machine. The
owner of the account on the remote machine creates a .rhosts
file in his HOME directory. The account owner then places
the full machine address of your machine (in our example EI)
followed by your login (your_login) in the remote .rhosts
file. By this action, the account owner is giving you
permission to copy and/or send files and directories
directly between your account and the remote account.
ei.ecn.purdue.edu your_login
- COPY a file from the remote machine. The format is first
the name of the command (RCP) followed by login of the
remote account owner (his_login@) and remote machine name
(ga:) then the name of the file on the remote machine
(remote_file) and then the name you want the file to have
when it appears in your current directory (my_file).
$rcp his_login@ga:remote_file my_file
- COPY a directory from the remote machine. Same as above,
except the -r flag (to copy everything within the directory)
follows the RCP command and the directory's name is
specified.
$rcp -r his_login@ga:remote_dir my_dir
- SEND a file to the remote machine. The format is first
the name of the command (RCP) then the name of the file on
your machine (my_file) followed by login of the remote
account owner (his_login@) and remote machine name (ga:)
then the name you want the file to have when it appears on
the remote machine (remote_file).
$rcp my_file his_login@ga:remote_file
- SEND a directory to the remote machine. Same as above,
except the -r flag and directory name are included.
$rcp -r my_dir his_login@ga:remote_dir
NOTE: When copying or sending directories, the name of the
directory may be anything you desire, but all files within the
directory will have names duplicating what was on the originating
machine.
webmaster@ecn.purdue.edu
Last modified: Friday, 31-Oct-97 11:51:21 EST
HTML