Newsgroups: bit.listserv.i-amiga
Date:         Sun, 26 Jul 1992 08:33:26 -0400
From:         Herbert I Brown <hibrown@CS.ALBANY.EDU>
Subject:      Re: FTP
X-To:         I-AMIGA@UBVM.cc.buffalo.edu

How to use ftp is a common question on this list. I wrote the following
for some of our students and it proved to be quite helpful to them. If
you want a copy sent to you by e-mail, send me an * e-mail * request.
Do not ask for it on this list by typing "me too".

Herb

---------------------------------------------------------------------------
Herb Brown  Math Dept  The Univ at Albany  Albany, NY 12222  (518) 442-4640
Director,                                          hibrown@sarah.albany.edu
Computer Assisted Instruction in Mathematics       hibrown@thor.albany.edu
---------------------------------------------------------------------------

************************* Using ftp *******************************
                 Using  ftp  (file transfer program)

The syntax is

> ftp [ -options ] [ hostname ]

***************

Example

Let's assume you are user abc123 and you wish to ftp to bst.albany.edu
(128.204.9.3). Type the following at your prompt:

> ftp bst.albany.edu <RETURN>

or

> ftp 128.204.9.3 <RETURN>

Either will result in the following appearing on your screen.

name (128.204.9.3:abc123): {TYPE YOUR NAME abc123 HERE}

331 Password required for abc123.

Password: {TYPE YOUR PASSWORD HERE}

230 User abc123 logged in.

ftp> {The remote machine is waiting for your commands}

***************

As you can see, ftp immediately attempts to establish a connection to
an ftp server on that host; otherwise, ftp enters its command
interpreter and awaits instructions from the user. When ftp is
awaiting commands from the user, it displays the prompt "ftp>".

Some of the options that may be specified at the command line, or to
the command interpreter are:

 -i  Turn off interactive prompting during multiple file transfers.

     Example: > ftp -i 128.204.9.3

 -v  Show all responses from the remote server, as well as report on
data transfer statistics. This is turned on by default if ftp is
running interactively with its input coming from the user's terminal.

***************

Some of the user commands available at the ftp prompt are:

 ! [ command ]
     Run "command" on the local machine. If no "command" is given,
invoke an interactive shell.

 append local-file [ remote-file ]
     Append a local file to a file on the remote machine. If remote-
file is left unspecified, the local file name is used in naming the
remote file after being altered.

 bell
     Sound a bell after each file transfer command is completed.

 binary
     Set the "representation type" to binary.

 bye or quit
     Terminate the ftp session with the remote server and exit ftp.

 cd remote-directory
     Change the working directory on the remote machine to remote-
directory.

 cdup
     Change the remote machine working directory to the parent of the
current remote machine working directory.

 close or disconnect
     Terminate the ftp session with the remote server, and return to
the command interpreter.

 delete remote-file
     Delete the file remote-file on the remote machine.

 dir [ remote-directory ] [ local-file ]
     Print a listing of the directory contents in the directory,
remote-directory, and, optionally, placing the output in local-file.
If no directory is specified, the current working directory on the
remote machine is used. If no local file is specified, output is sent
to the terminal.

 get remote-file [ local-file ] or recv remote-file [ local-file ]
     Retrieve the remote-file and store it on the local machine. If
the local file name is not specified, it is given the same name it has
on the remote machine.

 help [ command ] or ? [ command ]
     Print an informative message about the meaning of command.

 lcd [ directory ]
     Change the working directory on the local machine.

 ls [ remote-directory ] [ local-file ]
     Print an abbreviated listing of the contents of a directory on
the remote machine to the file local-file.

 mget remote-files
     Expand the remote-files on the remote machine and do a get for
each file name thus produced. Files are transferred into the local
working directory, which can be changed with "lcd directory"; new
local directories can be created with "! mkdir directory-name".

 mkdir directory-name
     Make a directory on the remote machine.

 mput local-files
     Expand the list of local files given as arguments and do a put
for each file in the resulting list.

 open host
     Establish a connection to the specified host FTP server.

 put local-file [ remote-file ] or send local-file [ remote-file ]
     Store a local file on the remote machine.

 pwd
     Print the name of the current working directory on the remote
machine.

 rename from to
     Rename the file from on the remote machine to have the name to.

 rmdir directory-name
     Delete a directory on the remote machine named directory-name.

 status
     Show the current status of ftp.

*************************

NOTES:

1. Command arguments which have embedded spaces may be quoted with (")
marks.

2. If any argument which is not indicated as being optional is not
specified, ftp will prompt for that argument.

3. To abort a file transfer, use CTRL-C.

*************************

                        A SAMPLE ftp SESSION

!> ftp 128.155.23.64
Connected to 128.155.23.64.
220 abcfd20 FTP server (Version 4.249 Fri Sep 14 15:07:02 EDT 1990) ready.
Name (128.155.23.64:hb136): anonymous
331 Anonymous login accepted, now type your actual login name.
Password:
230-Message of the day:
                         Welcome to the AB20 Archives.
           If this is your first visit, please read the /README file.
    A reverse chronological list of archive files is available in /FILES.Z.

 NOTICE: This archive is for the sharing of freely distributable files ONLY!

 Major areas of interest:
    /amiga   -- Commodore Amiga files
    /sun     -- Sun Microsystems files
    /pub     -- Miscellaneous files
    /usenet  -- Archives of some USENET code groups

 If you cannot find something, search /FILES.Z *before* posting a message.

230 Anonymous login complete; access is restricted.
ftp> cd /incoming/amiga
250 CWD command successful.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls (0 bytes).
total 29752
drwx------  3 13       8             512 Oct 27 13:39 .bad-files
drwxr-xr-x  2 13       8             512 Oct 27 17:17 0NEWSFLASH10
-rw-rw-rw-  1 5        8            5120 Oct  1 06:28 14mhz.lzh
-rw-r--r--  1 13       8           65671 Mar 20  1990 1990.lzh
.................etc......etc...........etc......etc...........
{I may now get, put, etc to my heart's content!!}
{When exhausted, I type bye}
ftp> bye
221 Goodbye.
>
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU