Previous Table of Contents Next


Using the rcp Command

To transfer a file from a remote system to your system by using the remote copy command, type rcp system-name:source-pathname destination and press Return. If you have proper security to access the remote system, the file is copied to the destination you specify.

In this example, the file quest is copied from the /tmp directory on the system ash to the current working directory on the system oak:

oak% rcp ash:/tmp/quest .
oak%

To transfer a file from a local system to a remote system, type rcp pathname system-name:destination-pathname and press Return. If you have proper security to access the remote system, the file is copied from the local system to the remote destination you specify.

In this example, the file quest is copied from the current working directory on the system oak to the /tmp directory on the system ash:

oak% rcp quest ash:/tmp
oak%

If you want, you can rename the file as part of the destination path name. For example, to rename the file quest to questions and put it in the /tmp directory, type /tmp/questions as the destination path name.

Using the File Transfer Program (ftp)

Follow these steps to transfer files from your local system to a remote system by using the file transfer program.


NOTE:  You may need to have an account on each system and an entry in the / .rhosts file to use the file transfer program. Some systems allow read-only ftp access to anybody who logs in as anonymous and types a login name at the password prompt.

If you have an NIS or an NIS+ account, you can use your login name and network password to access a remote system by using ftp:

1.  Type ftp and press Return. The ftp> prompt is displayed.
2.  Type open remote-system-name and press Return. System connection messages are displayed, and you are asked for a user name.
3.  Type the user name for your account on the remote system and press Return. If a password is required, you are asked to enter it.
4.  Type the password (if required) for your account on the remote system and press Return. A system login message and the ftp> prompt are displayed.
5.  Type bin to set binary format or asc to set ASCII format and press Return. The file type is set.
6.  Type put local-filename destination-filename and press Return. File transfer messages and the ftp> prompt are displayed.
7.  Type quit and press Return. A goodbye message and the command prompt are displayed.

The following example establishes an ftp connection from the system oak to the system elm, specifies ASCII format, puts the file quest from oak into the /tmp/quest directory on elm, and quits the session:

oak% ftp
ftp> open elm
Connected to elm
220 elm FTP server (UNIX(r) System V Release 4.0) ready.

Name (elm:ignatz): ignatz
331 Password required for ignatz.
Password:
230 User ignatz logged in.
ftp> asc
ftp> put quest /tmp/quest
200 PORT command successful.

150 ASCII data connection for /tmp/quest (129.144.52.119,1333).

226 Transfer complete.
ftp> quit
221 Goodbye.
oak%

You can use the send command as an alternative to the put command. You can copy multiple files by using the mput command. There is no msend command. See the ftp(1) manual page for more information.


NOTE:  You must have an account on each system to use the file transfer program.

If you have an NIS or an NIS+ account, you can use your login name and network password to access a remote system by using ftp. Follow these steps to transfer files from a remote system to your local system by using the file transfer program:

1.  Type ftp and press Return. The ftp> prompt is displayed.
2.  Type open remote-system-name and press Return. System connection messages are displayed, and you are asked for a user name.
3.  Type the user name for your account on the remote system and press Return. If a password is required, you are asked to enter it.
4.  Type the password (if required) for your account on the remote system and press Return. A system login message and the ftp> prompt are displayed.
5.  Type bin to set binary format or asc to set ASCII format and press Return. The file type is set.
6.  Type get remote-filename destination-filename and press Return. File transfer messages and the ftp> prompt are displayed.
7.  Type quit and press Return. A goodbye message and the command prompt are displayed.

The following example establishes an ftp connection from the system oak to the system elm, specifies ASCII format, gets the file quest from elm, puts it into the /tmp/quest directory on oak, and quits the session:

oak% ftp
ftp> open elm
Connected to elm
220 elm FTP server (UNIX(r)System V Release 4.0) ready.

Name (elm:ignatz): ignatz
331 Password required for ignatz.
Password:
230 User ignatz logged in.

ftp> asc
ftp> get quest /tmp/quest
200 PORT command successful.
150 ASCII data connection for /tmp/quest (129.144.52.119,1333).
226 Transfer complete.

ftp> quit
221 Goodbye.
oak%


NOTE:  You can copy multiple files by using the mget command. See the ftp(1) manual page for more information.


Previous Table of Contents Next