ECN No Name Newsletter: January, 1993

The ECN No Name Newsletter is no longer being published. This is an archived issue.

[previous article] [next article]

Using File Transfer Protocol

NO NAME NEWSLETTER-- January 1993

Tanya George


The File Transfer Protocol (FTP) allows a person to transfer files between two computers connected via the Internet. There are two different modes of using ftp. One method is to transfer files from one of your accounts to another. The other mode is called anonymous ftp. This method allows users who do not have an account on a remote machine to have limited access to what is there. This includes software, documents of various sorts, files for configuring networks and a wide variety of other information.

FTPing Between Your Accounts

To transfer files from your account on a remote machine to your account on the machine you are currently using, type:

% ftp roby.ecn.purdue.edu
Connected to roby.ecn.purdue.edu.
220 roby.ecn.purdue.edu FTP server
   (Version 4.177 Tue May 28 14:53:22 EST 1991) ready.
Name (roby.ecn.purdue.edu:LOGIN):
331 Password required for LOGIN.
Password: 
230 User LOGIN logged in.
ftp> get filename
ftp> bye
221 Goodbye

In this example, roby is the remote machine that was ftped to. To retrieve files from roby, first locate yourself in the correct directory by using the cd command then and type "get filename". If you will be transferring multiple files use the mget command instead of get command, type "mget filename filename filename". You may reduce some of your typing when using mget by using wildcard characters. The general UNIX commands, ls and cd, work the same in the ftp environment.

FTPing From A Remote Site

Anonymous ftp is a facility offered by many machines on the Internet. This permits you to log in with the user name "anonymous." When prompted for a password, type your e-mail address--it's not necessary, but it is a courtesy for those sites that like to know who is making use of their facility. Your attempt would look something like this:

% ftp wuarchive.wustl.edu
Connected to wuarchive.wustl.edu.
220 wuarchive.wustl.edu FTP server
   (Version 1.1(48) Fri Nov 20 10:29:15 CST 1992) ready.
Name (wuarchive.wustl.edu:LOGIN): anonymous
331 Guest login ok, send complete e-mail address as password.
Password: LOGIN@ecn.purdue.edu (not echoed)
230 Guest login ok, access restrictions apply.
ftp> binary
ftp> cd pub
ftp> get filename
ftp> bye
221 Goodbye.

File Attributes

Usually, files are grouped in archive files, so you don't have to get many small files separately. Also, files are often stored compressed.

When retrieving non-text files, you must use binary mode, otherwise the files become garbled. To do this, use the binary (bin) command. (It's safe to have it set for binary for text files.) To change back to ascii mode, use the ascii command. These are the common UNIX file types:

SUFFIX       FTP       TYPE

  .Z         bin         compress
  .arc       bin         ARChive
  .shar      ascii       SHell ARchive
  .tar       bin         Tape ARchive
  .uu        ascii       uuencode/uudecode
  .zip       bin         ip
  .zoo       bin         oo

Helpful Hints:

  1. 1. FTP will list the commands which it recognizes if you type "help" or type a question mark "?".
  2. 2. Your computer's help command may have information about ftp. Try "man ftp" or "man ftpd".
  3. 3. Use "ls -C" for long listings on a UNIX system.
  4. 4. Type the command, "prompt off" to turn off the prompting to get each file during an mget.


webmaster@ecn.purdue.edu
Last modified: Friday, 12-Sep-97 20:24:57 EST

[HTML Check] HTML