
FTP Tutorial

What
is FTP?
FTP for Unix
FTP for Windows
FTP for Macintosh
FTP Site Searching
This is a tutorial to provide basic FTP concepts and commands to allow the use
of this simple yet powerful client/server application for the transfering of
files.
FTP is an acronym for File
Transfer Protocol. FTP is a client/server application that allows the transfer
of files between computers. This transfer can take place between a mainframe and
a local terminal, or as a transfer of information over the Internet between your
computer and a distant server. FTP is a powerful application which allows users
to access archives that are available on a large number of computer hosts. The
key elements of FTP are:
- finding FTP sites from your client based system
- establishing a connection with the server
- developing an ability to search through "archives" to retrieve information
- using FTP commands to facilitate the transfer of information
- allowing for the differences in file types and compressions techniques.
The idea of client/server is important here - that you, the
"local" client, are initiating a communication pathway with a "remote" server
that may contain public information of interest to you.
We will look at some of the basic commands and tools for FTP, and then point
to other sources for a more detailed discussion of the subject matter.
We will begin our discussion of FTP with an explanation of some of the
commands used in Unix FTP, in order to develop an understanding of what is
happening underneath the screen interface. We will then discuss the more
user-friendly GUI applications for Windows and Macintosh.
Top of Page
Basic Commands
Since UNIX is a command line environment, we should
introduce some of the basic commands that are used to establish an FTP session
and to instruct the server on what the client is requesting. Some of the most
commonly used commands are:
- open initiates the session between the client and the server
- nlist, dir, ls list the heirarchical organization of files on the
remote server
- cd allows you to change directories on the remote computer either
up or down
- pwd gives the client a chance to view the current directory and
pathway on the remote host
- lls, lcd, lpwd are the ways in which you can do the above for
managing your local files
- get allows you to retrieve a file from the server down to your
local client computer.
- put allows you to place a file from your client up to the remote
server computer.
- mput/mget are the same as above but allow for multiple files to be
manipulated with a single command
- prompt sets interactive prompting; "on" is a safety feature
prompting you for verification of each step of the multiple commands, "off"
allows the commands to act unimpeded
- ascii/binary allows to specify the type of file to be transferred
- quit ends the connection and ends the session.
To find the
full array of commands, type help or ? at the FTP> prompt. This
will instruct ruby to show all the available commands for effective FTP use; the
above list is by no means exhaustive but does give the most commonly used
commands.
Initiating a Session
For the sake of example we will assume that you are
attempting to establish an FTP session from your Ruby account (your account on
the SILS server) to another remote server computer (sunsite.unc.edu, for
example). Once you have logged into Ruby, you could then start an ftp session by
simply typing ftp at the prompt. The prompt then changes to look like:
ftp>. At this you can then type: open sunsite.unc.edu. If you have an account
on sunsite (or whatever remote computer you are connecting to), you can login
with your username and password. If you don't, some servers allow anonymous ftp
sessions, which simply means that you use 'anonymous' as your userid and your
email address as your password when logging in to the remote comuter. A typical
login, with client commands emboldened, is shown:
~ % ftp
ftp>open sunsite.unc.edu
Connected to sunsite.unc.edu.
220-
220 calzone FTP server (Version wu-2.4(4) Mon Jan 13
16:10:34 EST 1997) ready.
Name (sunsite.unc.edu:stear):anonymous
331 Guest login ok, send your complete e-mail address
as password.
Password:
230 Guest login ok, access restrictions apply.
ftp>
Getting What You Want
Once in any FTP server, you can navigate through
the lists of directories and files to find out what is available. This is done
by using the (l)cd, (l)ls and others like them to direct the navigation
and the downloading of the files. Since the organization of directories and
files is structured heirarchically, it may be easy to lose the way when looking
for a document. In order to allow clients to keep up with their paths of
searching, the command pwd becomes useful, prints the current (or
working) directory. Before a file is requested by the client to be downloaded
from the server (get command) or that the client wishes to upload onto
the server (put command), two conditions must be considered
- Issues concerning file permissions
- Whether the file being transported is in Binary or Ascii mode
Briefly, one should view the permissions in UNIX to know for whom it
is readable, writeable, and executable. These permissions can be viewed by using
either the nlist or dirinfo commands. The client must also be
aware if the file being transported is a text file or any other kind of file. In
general, the transfer mode should be set to ascii for text-only files, and to
binary for all others (including .gif, .doc, and any executable files).
Top of Page
The FTP application for
Windows is call WS-FTP and is a GUI-based file-transfer client that allows for a
much easier client/server interaction.
WS-FTP is initiated by double
clicking on the icon for it in Windows 95. The session starts with a logon
procedure, and then graphically represents the client and the server by two
opposing tables of directories and files. By logging in you specify yourself as
the local system, and allow ruby (or any other ftp server) to be the remote
system. The directories can be changed easily enough, both on the remote
computer and on the local client hard drive by simply clicking on the change
directory button.
In order to FTP a file, one can simply look through the
directories of the server to identify the file(s) of interest. You then make
sure that the directory where you want to put that file in is open in your local
system. You can click on either binary or ascii transfer mode, depending on what
kind of file it is (you can also let the program decide by setting it to auto).
Then, clicking the arrow in the direction you want the file to be transferred
(client to server or vice-versa) moves the file into the other
computer.
In terms of permissions, the WS-FTP program makes it very
simple to set or re-set permissions. One need only to double-right click on the
file of interest and choose the CHMOD command to set the permissions with the
mouse.
Top of Page
FTP applications for
Macintosh are unique in their feel interface, but the underlying features of
file transfers between clients and servers are very similiar to the WS-FTP
mentioned above.
One Macintosh application is called Fetch and is
associated with a little dog running across the screen to fetch information. It
has the same basic setup as Windows 95 does. The only setback it has to the
Windows system is that it is not clear in showing exactly where the file is
coming from and where it is going from the server, it only shows the directories
for the client.
One simply needs to click on this application and the
helpful GUI interface leads you through the steps for file transfer.
Another useful FTP program is called Anarchie. The basic metaphor for
Anarchie is based on Finder windows. Each window corresponds to a directory on a
remote ftp server. You can have multiple windows open at once, so you can
interact with different ftp servers, or different directories on those servers,
at the same time. You can drag and drop files between the windows and the
Finder, or just double click to transfer the file. You can even upload or
download entire directories by dragging and dropping a directory from or to a
window!
Anarchie also has two searching facilities to find files on the
internet. "Archie" searching will let you search the one of the various archie
servers around the internet, which attempt to catalog a lot of files available
via ftp. Anarchie also includes the ability to search the entire Info-Mac
archive database, which will tell you the location of any file in the
comprehensive Info-Mac library. Info-Mac is the main repository of Macintosh
shareware and freeware.
Top of Page