HMC Homepage      CS Home

Using FTP

Transferring Files Between Machines

Part of the reason for having networked computers is convenient access to data on other machines. The program most commonly used to transfer files is called FTP (file transfer program). NCFTP is a configurable interface to FTP.

The following examples assume you are transfering files between turing and odin. However, the commands should still apply if you are connected to other machines.1

  1. Assuming you are logged on to turing, connect to odin with the command

    % ftp odin

    It will print the message "Connected to odin.", a few other lines and eventually prompt you for your name. At this point, type your username on odin. It will then prompt you for your password. Type your password for odin.

    If all goes well, you will see the prompt ftp> .

  2. Use the cd (change directory) command to change to the directory on odin where you want to transfer files.

    ftp> cd lyrics or whichever directory you want

    The command lcd (local change directory) will change the current directory on turing.

  3. If necessary, use the command dir to list the files in the current directory on the machine you've connected to (in this case, odin)

  4. If you are going to be transfering a binary file (such as a compressed file or an executable), enter

    ftp> binary

  5. For each file you want to copy from odin to turing, enter

    ftp> get odin_filename [turing_filename]

    For each file you want to copy from turing to odin, enter

    ftp> put turing_filename [odin_filename]

    For example, the command

    ftp> get song.txt junk.txt

    will make a copy of the odin file song.txt in the file junk.txt on turing. The second filename is optional; if omitted the file will be copied with the same name. (The brackets [...] mean optional; they should not be typed).

    To transfer multiple files at a time, use the commands mget and mput . You cannot specify a second filename with mget and mput with wildcards. Also, mget and mput will ask you for confirmation of every file they get or put. To turn this off, use the command prompt.

  6. To quit, type bye or quit or press Ctrl-D.

Notes:

There are many sites that run anonymous ftp servers. To connect to these, use the username anonymous and use your e-mail address for the password, or just use NCFTP. Because these servers are generally not dedicated ftp servers (people are trying to use them to get real work done), you should try to avoid doing large transfers (i.e. greater than 100K total) during normal working hours. This will keep the ftp site administrator happy and willing to continue service.

For more detailed information, refer to the manual page for ftp(1).

1. Note: Due to security issues, ftp sessions into turing have been disabled. However you may still use ftp on turing to connect to other machines. If you need to connect to turing in order to transfer files, you can use scp which is a "secure copy" program. For more info on scp, see the manual page on scp(1).


Copyright (c) HMC Computer Science Department. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License.''

HMC Computer Science Department
Contact Information
Last Modified Wednesday, 25-Jul-2001 15:26:01 PDT