|
Using FTP from the Shell
The File Transfer Protocol, or FTP, is used for transferring
files from one machine to another on the Internet. FTP requires
that a user be logged in to both hosts.
Anonymous FTP is a special use of FTP in which a site makes its
collection of files available to users who do not have accounts on that
host. The anonymous FTP convention uses a special login name of anonymous
and a special password, usually one's email address, to let users have
limited access to the remote host for the purpose of retrieving files
that have been approved for public access. It is really a "guest"
activity rather than an "anonymous" activity.
How FTP Works
FTP is based on the client-server model where the client sends queries
and the server sends back responses to the queries. To accomplish file
transfers, there must be a client program on the local host and a server
program on the remote host.
The FTP client provides the user with a session that enables him to send
commands to the remote host machine. The server provides access to
directories containing files that may or may not be open to an anonymous
account. The user may browse through the directories and files, transfer
files and issue a number of commands to the server. Normally, files on
the host machine are organized in a hierarchical fashion, with a parent
directory at the top and branches of subdirectories containing files
below that. FTP expects the user to know the name and location of the
file that is to be retrieved. Many sites urge users to retrieve and read
README files first before proceeding to retrieve other files from a
directory.
Internet sites that permit anonymous FTP logins allow guest users to do
only a limited number of operations, such as logging in using FTP,
listing the contents of certain directories, and retrieving files from
those directories.
Back to Contents List
How to Get FTP
Most Unix Internet connections come standard with FTP software. Usually,
it is the system administrator who installs and maintains this software.
Software is also available for PCs and Macintoshes. The Macintosh client,
called Fetch, is available from Dartmouth College. Information may be
obtained by sending email to Fetch@dartmouth.edu.
Back to Contents List

Pros and Cons
The most widely recognized advantage of FTP is its availability. Since it
is usually standard with most Unix Internet connections, it is probable
that every system of this type will have FTP capabilities (however, not
all may have anonymous FTP capabilities).
FTP is the easiest way to retrieve the many files from various repository
hosts (see the list below) and this can be accomplished using the
anonymous FTP convention.
A disadvantage of FTP is that its interface is not always very
user-friendly. To retrieve a file, the user needs to know what host it is
on and the pathname of the file, i.e. the directory where it is located
along with the specific filename of the file.
Back to Contents List
How to Use FTP
To start an FTP session, the user must establish a network connection
from his local host to the remote host. On many Internet hosts, the user
types ftp and the host name of the machine to which he wants to connect.
Macintosh users begin their sessions by clicking on the Fetch icon.
The remote host prompts the user for a username and a password. When
using anonymous FTP, the user enters anonymous as the username and his
email address as the password. Otherwise, the user types in the userid
and password for his account on that host.
Back to Contents List
Key Commands
After logging on, the user might receive a welcome message from the host
machine, and then the FTP prompt, ftp>. Macintosh and PC Windows users
will use a graphical point and click interface. The following basic
commands may be used with Unix and PC DOS clients:
To: Type:
List the directory to the terminal......ls or dir
Change directories (move up or down)....cd or cdup
Retrieve a file.........................get <filename>
Put a file on the host machine..........put <filename>
Abort a file transfer...................CTRL-C
Get help/list of commands...............help or ?
Leave the FTP session...................exit, quit or bye
Many hosts maintain files named README or INDEX. These files usually
contain information about the host and its directories and files. It is
usually a good idea to retrieve these files first and read them before
continuing, especially if the host's directory has a large number of
subdirectories and files.
Back to Contents List
What FTP Looks Like
Here is an example of a typical FTP session from Unix client. In this
session, the user connected to the host naic.nasa.gov, logged on as
anonymous and entered her email address when prompted for a password. She
then retrieved the file named README. Notice that this FTP server
provides helpful introductory comments.
-------------------------------------------------------------------------------
% ftp naic.nasa.gov
Connected to naic.nasa.gov.
220 naic.nasa.gov FTP server (Version wu-2.1c(5) Tue Dec 14 08:21:13
PST 1993) ready.
Name (naic.nasa.gov:mstahl): anonymous
331 Guest login ok, send your complete e-mail address as password.
Password:
230----------------------------------------------------------------------------
230-Welcome to the NASA Network Applications and Information Center FTP
Archive
230-
230- Access to NAIC's online services is also available through:
230-
230- Gopher - naic.nasa.gov (port 70)
230- World-Wide-Web - http://naic.nasa.gov/naic/naic-home.html
230-
230- If you experience any problems please send email to
230-
230- naic@nasa.gov
230-
230- or call +1 (800) 858-9947
230----------------------------------------------------------------------------
230-
230-Please read the file README
230- it was last modified on Fri Dec 10 13:06:33 1993 - 111 days ago
230 Guest login ok, access restrictions apply.
ftp> get README
200 PORT command successful.
150 Opening ASCII mode data connection for README (5641 bytes).
226 Transfer complete.
local: README remote: README
5783 bytes received in 0.028 seconds (2e+02 Kbytes/s)
ftp> bye
221 Goodbye.
%
-------------------------------------------------------------------------------
Back to Contents List

Trying FTP
Here is a list of some FTP sites that allow anonymous FTP logins:
Library-related files hydra.uwo.ca
infolib.murdoch.edu.au
ftp.uni.edu
ftp.cni.org
Network information is.internic.net
naic.nasa.gov
nic.ddn.mil
Microcomputer software repository wuarchive.wustl.edu
Macintosh software repository sumex-aim.stanford.edu
Back to Contents List
For More Information
Books that contain extensive descriptions of FTP are:
- The Whole Internet Users Guide and Catalog by Ed Krol. O'Reilly and
Associates. 1992.
- The Internet Passport, published by NorthWestNet. 1993.
In addition, online help is available. On Unix systems, you can issue the
command man ftp; on VMS or CMS systems you can issue the command help
ftp.
Back to Contents List
Questions?
If you have any questions about this material, please
contact the NAIC:
HOW TO CONTACT THE NAIC
Telephone 1-800-858-9947 (toll-free within US)
1-415-604-0600 (outside US)
Staff are available to answer the phone from 6 a.m. to 5 p.m.
Pacific time. Voicemail messages left at other times will be
promptly returned.
FAX 1-415-604-0978
Electronic Mail
From an Internet host send mail to:
naic@nasa.gov
From a DECnet host send mail to:
EAST::"naic@nasa.gov"
Online servers:
URL:gopher://naic.nasa.gov
URL:http://naic.nasa.gov/
URL:ftp://naic.nasa.gov/
Postal Mail
NAIC
NASA Ames Research Center
M/S 204-14
Moffett Field, CA 94035-1000
Back To Shell/Unix Support
|