Last update: 21-Sep-94
  - New FTP site list (Chapter 3)
  - Downloading large files (Chapter 9)

0. Contents
===========
1. Introduction
2. FTP command list
3. Important sites
4. A Sample Session
5. The .netrc File
6. Archivers
7. The Archie Database
8. Mailservers
9. Transferring to Amiga



1. Introduction
===============

FTP stands for File Transfer Protocol.  The program with the same name,
'ftp', allows you to gain access to some other machines and store and/or
retrieve files.  If you have a UNIX account on a machine with Internet
access, and the machine has the 'ftp' command, you're almost done.  If not,
you have to get the files by mail:  see the section 'Mailservers', below.

In this document, we refer to two computers:

o	The 'local machine' is the computer that you are physically logged
	in on.

o	The 'remote machine' is the computer that you are contacting via
	your local machine.  It might be right next door, or thousands of
	kilometers away!  Using 'ftp', you can transfer files from the
	remote machine to your local machine, or from your local machine to
	the remote machine.

Normally, one needs an account on a remote machine to use it.  However, a
number of machines on the Internet allow anybody to log in as the user 'ftp'
or 'anonymous'.  When you log in using the anonymous account, you'll be
prompted for a password.  You should type your local login name as the
password, especially when you upload.  After doing so, you may retrieve all
files found in public areas on the remote machine.  Doing this is
commonly called 'using anonymous ftp' or 'doing some anonymous ftp-ing'.

The ftp program gives you a prompt that looks like this:

		ftp>

At this prompt, you can type commands to connect to remote machines, upload
and download files, etc.



2. FTP command List
===================

Here are some important commands you'll need within ftp.  In these examples,
any words given inside angled brackets <like this> are like variables
that stand for particular values.  For example, the command

			get <remote file name>

means you should type the word "get" followed by the name of a file that
is on the remote machine.  An actual example would be:

			get SuperProgram.lha

Commands For Opening And Closing FTP Connections:

	open <site>

		Connects to a remote machine.  For valid sites, see below.

	close
		Closes connection to the remote site

	bye
		Quits FTP.

	quit
		Same as bye.

Commands For Setting The Transfer Mode
		
	bin

		Sets the connection to binary mode for transferring non-text
		files, such as "lha", "lzh", "zoo", "arc", "dms", "zom", "Z"
		(compressed), "gz", "tar", and other archives.  See the
		"Archivers" section below.

	asc
		Sets the connection to text (ASCII) mode for transferring
		text files.

	It is OK to transfer text files in "bin" mode.  However, it is
	WRONG to transfer binary files in "asc" mode -- they will get all
	messed up.  So to be safe, you can just type "bin" at the beginning
	of each ftp session and leave it that way.  (However, "asc" mode
	is faster for text files.)

Commands For Downloading (Getting, Receiving) Files:

	get <remote file name>

		Receives the named remote file.  This command cannot
		transfer multiple files at a time; for that, see "mget".

		If you specify a second argument, it will be used as the
		name for the local file.  (By default, the local file has
		the same name as the remote file.)

	mget <remote file 1> <remote file 2> ...

		Receives all the above remote files with a single command.

	mget <pattern>

		Receives all the remote files whose names match <pattern>.
		Patterns may include the symbols

			*	stands for any sequence of characters
			?	stands for any 1 character

		For example, if you wanted to download all files that
		begin with "B" and end with ".lzh", type:

			mget B*.lzh

		To download all files whose names are exactly 4 characters
		long, type:

			mget ????

		You will be prompted before each file is downloaded.
		To turn off this prompting, see the "prompt" command below.

Commands For Uploading (Putting, Sending) Files

	put <local file name>

		Transmits the local file to the remote machine.
		This works for only one file at a time, similarly to the
		way "get" works.

		If you specify a second argument, it will be used as the
		name for the remote file.  (By default, the remote file has
		the same name as the local file.)

	mput <local file 1> <local file 2> ...etc.

		Transmits all the above local files to the remote machine
		with a single command.

	mput <pattern>

		Transmits all local files whose names match the given
		pattern.  See the "mget" command, above, for information
		about patterns.

Additional Commands For Uploading And Downloading

	prompt

		Normally, mget and mput will prompt you before transferring
		each file.  If you don't like this, the 'prompt' command
		toggles the prompting on and off.

	hash

		Normally, files are downloaded silently.  Typing the 'hash'
		command will cause a 'hash mark' to be printed every so
		often, indicating how much downloading has completed so far.
		Typing this command again toggles the hash marks on and off.

Commands For Exploring The Local And Remote Machines

	Files on the remote machine (and probably your local machine too)
	are organized in directories.  Here is how to navigate those
	directories and view their contents.

	dir <pattern>

		Lists files in the current directory of the remote machine.
		See "mget", above, for information about patterns.

	ls <pattern>

		Same as "dir", but list the files in a short format.

	cd <directory name>

		Changes your current directory on the remote machine.

	lcd <directory name>

		Changes your current directory on the local machine

	mkdir <directory name>

		Creates a new directory on the remote machine.  This will
		not work if you do not have permission to do it on the
		remote machine.

Some Special And Helpful Functions

o	There are some special arguments you can add to the 'get' command.
	If you type:

			get myfile -

	then file 'myfile' will be displayed on your screen instead of
	downloaded.  If you would like this file to be displayed one
	screen at a time, pausing after each screenful, type

			get myfile |more

	[NOTE -- NO SPACE BETWEEN THE '|' and 'more'].  This latter command
	may not work on all remote machines.

o	Also note that the ls and dir commands take only one argument.  This
	can be either an option or a pattern, BUT NOT BOTH.  If you give a
	second argument, this will be interpreted as a local filename, and
	the directory listing will be stored in that local file instead of
	displayed on your screen.


3. Important Sites
==================

Location     Name                     IP Address      Path         Files
                                                                        
USA (MO)     ftp.wustl.edu            128.252.135.4   pub/aminet/    ALL
USA (WI)     ftp.netnet.net           198.70.64.3     pub/aminet/    ALL
Scandinavia  ftp.luth.se              130.240.18.2    pub/aminet/    ALL
Switzerland  ftp.eunet.ch             146.228.10.16   pub/aminet/    ALL
Switzerland  ftp.math.ethz.ch         129.132.104.6   pub/aminet/   1000
Germany      kelly.uni-paderborn.de   131.234.128.206 pub/aminet/    ALL
Germany      ftp.uni-paderborn.de     131.234.2.42    pub/aminet/    ALL
Germany      ftp.uni-stuttgart.de     129.69.18.15    cd  aminet    4000
Germany      ftp.uni-erlangen.de      131.188.3.2     pub/aminet/   7000
Germany      ftp.uni-trier.de         136.199.8.81    pub/aminet/   4500
Germany      ftp.cs.tu-berlin.de      130.149.17.7    pub/aminet/   4000
Germany      ftp.tu-chemnitz.de       192.108.33.193  pub/aminet/   4000
Germany      ftp.fh-augsburg.de       141.82.16.242   pub/aminet/   3000
Germany      ftp.uni-oldenburg.de     134.106.40.9    pub/aminet/   2500
Germany      ftp.uni-bremen.de        134.102.228.2   pub/aminet/   2000
Germany      ftp.uni-kl.de            131.246.9.95    pub/aminet/   1500
Germany      ftp.uni-siegen.de        141.99.128.1    pub/aminet/   1500
Germany      ftp.rz.uni-wuerzburg.de  132.187.1.2     pub/aminet/    700
France       ftp.cnam.fr              163.173.128.15  pub/aminet/   8000
Portugal     ftp.ci.ua.pt             193.136.80.6    pub/aminet/   2000
UK           ftp.doc.ic.ac.uk         155.198.1.40    pub/aminet/    ALL
UK           micros.hensa.ac.uk       148.88.8.84     pub/aminet/   8500

The above group of sites together are called 'Aminet'.  They all contain the
same files (through a process called 'mirroring'), although most of them
delete older files.  Also, there are a lot of other Amiga FTP sites around, 
and when make announcments about software on these sites, they usually give 
the site address.

Finland      ftp.funet.fi            128.214.6.100   pub/amiga/
USA          ftp.isca.uiowa.edu      128.255.21.233  amiga/fx
USA          ftp.hawaii.edu          128.171.44.70   pub/amiga/fish
Scandinavia  ftp.funet.fi            128.214.248.6   pub/amiga/fish

Both ftp.cso.uiuc.edu and grind.isca.uiowa.edu have a full collection of
Fish Disks as their main feature.  Whenever I mention a program that is to
be retrieved from a Fish disk, you can get it there.



4. A Sample Session
===================

This is an example FTP session.  What you have to type is given in square
brackets, on a line by itself, like this:

   [Here is something that you would type]

Everything else is displayed by the computer.  FTP output is often preceded
by strange numbers like "220" and "150" -- you can ignore these.
The example begins here.

   [ftp]

ftp> 
     [open wuarchive.wustl.edu]
Connected to wuarchive.wustl.edu.
220 amiga FTP server (Version 5.60.97 Wed Dec 9 22:23:21 MET 1992) ready.
Name (amiga:umueller): 
                       [ftp]
331 Guest login ok, send your userid as password.
Password:
          [kdalton]
230- Welcome to amiga.physik anonymous FTP server
230-      .....
230 Guest login ok, access restrictions apply.
ftp> 
     [cd pub/aminet]
250 CWD command successful.
ftp> 
     [get RECENT |more]
200 PORT command successful.
150 Opening ASCII mode data connection for RECENT (5676 bytes).
| Recent uploads to wuarchive.wustl.edu [130.60.80.80] on 11-Dec-1992
| The last 7 days' uploads, newest first. Blank line=new day, + = long .readme
|
|File                Dir        Size Description
|------------------- ---        ---- -----------
tiff2iff.lha         gfx/conv     7K Converts TIFF files to Amiga IFF
DNetIRCpic.lzh       comm/net    16K Demo picture of DNet IRC
DNetIRC.lha          comm/net    88K+IRC intuition DNet client (dnetlib.o neede
ICoons_Nofp.lzh      gfx/3d     172K+Spline based object modeller (no 68881 nee
1993.lha             mods/u4ia  109K+ProTracker Module By U4ia called '1993'
skick321.lha         os20/util   37K+Soft-kicker under OS 2.0 - new release
monoxyde.dms         demo/mega  477K+MONOXYDE - new demo by Vanish
baudbandit1.4b.lha   comm/misc   16K+Version 1.4b of baudbandit.device
jed206b.lha          util/edit  144K+programmable, programmers editor. OS2.0+
--More--
         [q]
226 Transfer complete.
local: |more remote: RECENT
5763 bytes received in 4.5 seconds (1.2 Kbytes/s)
ftp> 
     [cd game/think]
250 CWD command successful.
ftp> 
     [bin]
200 Type set to I.
ftp> 
     [get t-triz.lzh]
200 PORT command successful.
150 Opening BINARY mode data connection for t-triz.lzh (56496 bytes).
226 Transfer complete.
local: t-triz.lzh remote: t-triz.lzh
56496 bytes received in 0.43 seconds (1.3e+02 Kbytes/s)
ftp> 
     [bye]
221 Goodbye.

This is the end of of the sample session.

If you're looking for something specific on that site, check the appropriate
directory (using the 'cd' and 'ls' commands), or download the remote files
'INDEX', 'LOCAL' or 'ls-lR.Z'.  You can then use a program such as the UNIX
'grep' to search for filenames in them.  (Type 'man grep' in the UNIX shell
to learn about grep).


5. The .netrc File
==================

If you put a file named .netrc in your home directory on the local machine,
it will make your ftp life easier.  Just put into this file all information
about how to log in at your favourite FTP site, and it'll be done
automatically when you ftp to that site.

After you create the .netrc file, you have to 'chmod 600 .netrc' or it won't
be accepted:

		cd
		chmod 600 .netrc

Here's an example .netrc file to log onto the machine wuarchive.wustl.edu.
It also defines a macro called 'init' that turns on binary mode and changes
your remote directory to pub/aminet.  To use this macro after you are logged
into the remote machine, just type

		$init

machine wuarchive.wustl.edu
login ftp
password kdalton
macdef init
bin
cd pub/aminet


Make sure you put a blank line after the last command, or else it won't work
properly.  Also, remember to set the password to your login name.


6. Archivers
============

Most files on FTP sites store their files in archived (compressed) format.
You can recognize the archiver used by the ending of the file name.  These
are the most important ones:

Suffix  Archiver        Filename on Aminet

.lzh    LhA             LhA_e138.run
.lha    LhA             LhA_e138.run
.zoo    Zoo             zoo2-10.lzh
.zip    Zip             unzip-4.1.lzh
.dms    DMS             dms111.sfx
.run    (LhA)           -
.sfx    (LhA)           -
.tar.Z  tar, compress   tar-compress.lzh
.gz	GNU Zip		gzip124x.lha

The AmigaDOS versions of those archivers can be found on the AmiNet sites
(see above) in the directory pub/aminet/util/arc, except for GNU Zip which
is found in pub/aminet/util/pack.  To give you a start, LhA is also stored
in self-extracting form (.run or .sfx).  Just execute it to extract it.

UNIX versions of most of these archivers are available.  You can get them
from wuarchive.wustl.edu in the directory /pub/aminet/misc/unix/, or if
they're not there, use archie (see below) to find them. The files names are:

LhA  lha-1.00.tar.Z  
Zoo  zoo-2.10.tar.Z
Zip  unzip41.tar.Z
Dms  dmscheck.c.Z


7. The Archie Database
======================

There is a database of all files on all FTP sites worldwide, called 'archie'.
They have a mailserver, a telnet service, and a client software.  Telnet to
archie.sura.net and log in as 'archie', or send mail containing HELP in its
body to archie@quiche.cs.mcgill.ca.  You'll get more information that way.


8. Mailservers
==============

Some sites allow sending them magic mail messages which cause them to FTP
things from other sites, uuencode them, and send them to you.  Others only
send the files stored locally at that site.  Here are the most important mail
servers.  Send a mail containing HELP in its body to find out more about them
(note that the German links are slow, generally):

ftpmail@decwrl.dec.com
mailserver@nic.funet.fi
ftp-mailer@ftp.informatik.tu-muenchen.de
mrcserv@janus.mtroyal.ab.ca
mail-server@ftp.cs.tu-berlin.de
mail-server@rtfm.mit.edu


9. Transferring to Amiga
========================

After you have the files on your UNIX account, you need to get the files
home.  Most Amiga terminal programs have one or more ways to transfer files
to your Amiga.  Read your terminal program documentation for more
information.

One recommended method is to use ZModem.  If your local machine has the
'sz' command, and your terminal program supports ZModem, you are set.
To download the file 'whatever.lzh' to your Amiga, type:

		sz whatever.lzh

and then use your terminal program to receive it.  If your site does not
have 'sz', you can get it from krynn.efd.lth.se in the file
/pub/modem/rzsz9107.tar.Z.  Compile it, or use archie to find a version
specific for your UNIX flavor.

In the worst case, you can turn on your terminal program's "screen capture"
feature and type:

	uuencode <filename filename

to get your file typed to the screen in 'uuencoded' format.  On your Amiga,
uudecode the file (using uudecode from Fish Disk 92).  Also, some sites
still use 'kermit'. If you have a program of that name, you can use one of
the Amiga kermit implementations found on Aminet to get files home.

If you don't have a modem, you can try to find a workstation with 3.5"
floppy drive.  Sun 4 computers have them.  There you can either use the
program mtools (try 'man mcopy') to store the files in MSDOS format and
retrieve them using MSH (Fish Disk 382) or CrossDOS (included with AmigaDOS
2.1 and higher), or you use gnu tar (UNIX version to be found on
decuac.dec.com, /pub/binaries/gnutar-1.10.tar.Z) to store files on the disk
in .tar format using the command 'gtar cfvM /dev/rfd0c'.  Then you restore
the files with gnu gtar (found on wuarchive.wustl.edu, in the file
pub/aminet/util/gnu/gtar110.lzh) and the FLAT device (Fish Disk 535) and MSH
(or any other PC format reading tool).  Mount FLAT:, and then enter 'gtar
xfvM flat:MSH' or replace the MSH by the name of your emulation tools.

If a file is too large to fit on a floppy, you can use misc/unix/bsplit*
from Aminet to split it, and c:join under AmigaDOS to put it back together.

If you'd like some additional info to be included in this FAQ, contact
umueller@wuarchive.wustl.edu.  -Urban Dominik Mueller

