Now that I'm in, I'm going to look around and see what the SURAnet FTP site has to offer.
(BTW, you can see a list of all of the acceptable commands for your FTP client by typing "help")
On most FTP clients, the command to list the contents of the current directory on the remote machine is just
>>>PORT 130,160,4,100,212,230 200 PORT command successful >>>LIST 150 Opening ASCII mode data connection for /bin/ls. total 728 drwxrwx--x 3 0 0 512 Aug 5 01:55 bin drwxr-xr-x 2 0 1 512 May 10 12:47 etc drwxrwxrwx 6 0 10 512 Oct 21 11:37 incoming drwxr-xr-x 2 0 0 8192 Feb 15 1992 lost+found -rw-r--r-- 1 0 1 350142 Oct 25 00:00 ls-lR drwxrwxr-r 24 0 100 512 May 3 13:25 pubThis is a listing of all of the stuff in the current directory. Let's take a look at the first entry and see if we can figure out what all of this means:
What does that mean? Well, pretend that the FTP site is simply a big house. You walk into the house through the front door, and you find yourself standing in an entry hall. The entry hall may have some neat stuff in it, but it also has doors leading to other rooms throughout the house.
The subdirectories -- the "d"s -- are just doors to other "rooms" at the FTP site, and the files -- the "-"s -- are the neat stuff that you can get while you are at the site.
Getting back to our example,
Let's look at one more example:
Let's get back to the main SURAnet directory contents:
drwxrwx--x 3 0 0 512 Aug 5 01:55 bin drwxr-xr-x 2 0 1 512 May 10 12:47 etc drwxrwxrwx 6 0 10 512 Oct 21 11:37 incoming drwxr-xr-x 2 0 0 8192 Feb 15 1992 lost+found -rw-r--r-- 1 0 1 350142 Oct 25 00:00 ls-lR drwxrwxr-r 24 0 100 512 May 3 13:25 pubI want to change this main directory and get into a subdirectory. To change directories on most FTP clients, you use the command
Since I am interested in public information, I'm going to get into "pub" directory ("pub" is the standard FTP abbreviation for "public"). I type
>>>CWD PUB 550 PUB: No such file or directory.Uhhh ... what happened?
One of the unfortunate shortcomings of FTP is that, for most of you, FTP is case sensitive. My "cd PUB" command did not work because there is no "PUB" directory ... but there is a "pub" directory :)
Let's try it again. I type
>>>CWD pub 250 CWD command successful.Cool! It worked!
Now I need to see the contents of this new directory that I just entered. Do you remember what FTP command I should use? (Hint: it is "dir")
I type "dir", and the following appears on my screen:
>>>PORT 130,160,4,100,215,140 200 PORT command successful. >>>LIST 150 Opening ASCII mode data connection for /bin/ls. Total 56 -rw-rw-r-- 1 1023 100 4052 Apr 22 1994 README drwxrwsr-x 2 1023 100 512 Aug 6 1993 SURAnet drwxrwxr-x 6 1020 120 512 Mar 3 1992 archie drwxrwxr-x 2 1034 120 512 Feb 15 1992 articles drwxrwxr-x 2 1007 110 512 Jun 22 15:40 books ... <stuff deleted by me>Whoa! That first file -- README -- looks pretty important. I bet it contains some important information that will make my life a whole bunch easier (Good rule of thumb: if you see a file that contains the words README or INDEX, it is an important file).
I need to get this README file.
To get a file using FTP, you use the
Since I want to get the README file, I type
This is a problem that some of you may have when you try to get "one word" files. Some local Internet service providers require files stored on their machines to have some sort of extension or type. Your can't have a file whose name is just README ... it has to be README.<type> (i.e. README.DOC, README.TXT, etc).
Since the "get README" command did not work, I'm going to have to use the
So, I type
>>>PORT 130,160,4,100,218,90 200 PORT command successful. >>>RETR README 150 Opening ASCII mode data connection for README (4502 bytes).After a few additional seconds, the following is added to my screen:
226 Transfer complete. 4637 bytes transferred. Transfer rate 6.14 Kbytes/sec.YIPPEE! It worked!! Let's quit FTP and see what we did.
To quit ftp, you need to use either the "bye" or "quit" commands.
On my client, the command is "quit", so I type
221 Goodbye. Ready; T=0.54/0.96 01:45:53Okay .. I got the file. But where is it? It is sitting on my account on my service provider's system!
Depending on your system, it is either easy or hard to get into the files that get from FTP (in Unix, type "ls"; in VM, type "fl"). Your local Internet service provider can tell you a little more about how to access, read, and print these files.
Looking at this new file that I just got from FTP, I discover that the contents of the README file are a brief explanation of what is in every subdirectory off of the pub directory (cool!):
The following items are available anonymous ftp from ftp.sura.net:
Directories found under pub:
I want to go back and get one of the articles in the SURAnet newsletter. Thanks to what I learned from the README file, I now know that the files that I am looking for are in "pub" directory and in the "articles" subdirectory.
In FTP notation, I can write this as
Let's go back to SURAnet and get some newsletter articles!
I type
Connecting to ftp.sura.net 128.167.254.179, port 21 220 nic.sura.net FTP server (Version wu-2.4(1) Fri May 20 10:20:58 EDT 1994) ready. USER (identify yourself to the host):Since I do not have an account on the SURAnet machine, I type
>>>USER anonymous 331 Guest login ok, send your complete e-mail address as password. Password:I type my full Internet address -- pcrispe1@ua1vm.ua.edu -- as my password, and the following appears on my screen:
>>>PASS ******** 230- SURAnet ftp server running wuarchive experimental ftpd 230- 230-Welcome to the SURAnet ftp server. If you have any problems with 230-the server please mail the to systems@sura.net. If you do have problems, 230-please try using a dash (-) as the first character of your password 230- -- this will turn off the continuation messages that may be confusing 230-your ftp client. ... 230 Guest login ok, access restrictions apply. Command:I know that I want to get into the "pub" directory, and then into the "articles" subdirectory. I could type "cd pub" and then "cd articles" to get into the subdirectory that I want, but it would be easier to just jump into the "articles" directory with one command.
I can make such a jump using the /pub/articles notation introduced a few minutes ago. If I type
>>>CWD /pub/articles 250 CWD command successful. Command:Since I have no idea what is in the "articles" subdirectory that I just entered, I type
>>>PORT 130,160,4,100,222,127 200 PORT command successful >>>LIST 150 Opening ASCII mode data connection for /bin/ls. Total 382 -rw-rw-r-- 1 0 120 1510 Jan 3 1992 editors.box.text -rw-rw-r-- 1 0 120 46167 Jan 3 1992 fall91.issue -rw-rw-r-- 1 0 120 52864 Jan 3 1992 spring91.issue -rw-rw-r-- 1 0 120 1515 Jan 3 1992 sub.form.txt -rw-rw-r-- 1 0 120 36418 Jan 3 1992 summer91.issue -rw-rw-r-- 1 0 120 53606 Jan 3 1992 winter90.issue 226 Transfer completeCOOL! These files already have extensions (winter90.issue, etc.), so getting them is going to be a breeze!
Let's get the Fall '91 issue. Since I want the file "fall91.issue", I type
>>>PORT 130,160,4,100,224,34 200 PORT command successful >>>RETR fall91.issue 150 Opening ASCII mode data connection for fall91.issue (46167 bytes).After a few seconds, the following is added to my screen:
226 Transfer complete. 47151 bytes transferred. Transfer rate 16.58 Kbytes/sec.IT WORKED!!! YAY!!! :)
I then quit FTP by typing either "bye" or "quit", and I am done! The file "fall91.issue" is now sitting in my account on my local Internet service provider's machine!!
(\__/) .~ ~. )) /O O `./ .' PATRICK DOUGLAS CRISPEN {O__, \ { PCRISPE1@UA1VM.UA.EDU / . . ) \ THE UNIVERSITY OF ALABAMA |-| '-' \ } )) .( _( )_.' Roadmap: Copyright 1994 Patrick Crispen. '---.~_ _ _& All rights reserved. The views expressed in this letter do not necessarily represent the views of the University of Alabama - Tuscaloosa.
Go back to the Syllabus
MAP15: FTPMAIL
MAP13: FTP (Part One)