home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / roadmap.zip / RMMAP14.TXT < prev    next >
Text File  |  1995-04-12  |  13KB  |  392 lines

  1.  
  2. MAP14: FTP (PART TWO)
  3.  
  4.  
  5.      "Technology ... the knack of so arranging the world that we need
  6.       not experience it." -- Max Frisch, Homo Faber
  7.  
  8.  
  9. Yesterday I told you that the basic steps in an FTP session are:
  10.  
  11.      1. Start-up your FTP client
  12.      2. Give your FTP client an address to connect to (and, just
  13.         like TELNET, step one and two can be combined into one
  14.         easy step).
  15.      3. Identify yourself to the remote site
  16.      4. Give the remote site your password
  17.      5. Look around the directory for files
  18.      6. Change Directories
  19.      7. Set the transfer mode (optional)
  20.      8. Get the file(s) you want
  21.      9. Quit
  22.  
  23. I've accessed SURAnet's FTP site (ftp.sura.net), told the site that
  24. I am "anonymous", and given the site my full Internet address as
  25. my password.
  26.  
  27. Now that I'm in, I'm going to look around and see what the SURAnet
  28. FTP site has to offer.
  29.  
  30. (BTW, you can see a list of all of the acceptable commands for
  31. your FTP client by typing "help")
  32.  
  33. On most FTP clients, the command to list the contents of the current
  34. directory on the remote machine is just
  35.  
  36.           dir
  37.  
  38. My FTP client accepts and uses the "dir" command, so I type
  39.  
  40.           dir
  41.  
  42. and the following appears on my screen:
  43.  
  44.    >>>PORT 130,160,4,100,212,230
  45.    200 PORT command successful
  46.    >>>LIST
  47.    150 Opening ASCII mode data connection for /bin/ls.
  48.    total 728
  49.    drwxrwx--x   3 0        0              512 Aug  5 01:55 bin
  50.    drwxr-xr-x   2 0        1              512 May 10 12:47 etc
  51.    drwxrwxrwx   6 0        10             512 Oct 21 11:37 incoming
  52.    drwxr-xr-x   2 0        0             8192 Feb 15  1992 lost+found
  53.    -rw-r--r--   1 0        1           350142 Oct 25 00:00 ls-lR
  54.    drwxrwxr-r  24 0        100            512 May  3 13:25 pub
  55.  
  56. This is a listing of all of the stuff in the current directory.
  57. Let's take a look at the first entry and see if we can figure out
  58. what all of this means:
  59.  
  60.    drwxrwx--x   3 0        0              512 Aug  5 01:55 bin
  61.  
  62. If the line begins with a "-" instead of a "d", it is a file.
  63. The letter "d" at the beginning of this example tells me that this
  64. is not a file -- it is a subdirectory.
  65.  
  66. What does *THAT* mean? Well, pretend that the FTP site is simply
  67. a big house. You walk into the house through the front door, and
  68. you find yourself standing in an entry hall. The entry hall may
  69. have some neat stuff in it, but it also has doors leading to other
  70. rooms throughout the house.
  71.  
  72. The subdirectories -- the "d"s -- are just doors to other "rooms"
  73. at the FTP site, and the files -- the "-"s -- are the neat stuff
  74. that you can get while you are at the site.
  75.  
  76. Getting back to our example,
  77.  
  78.    drwxrwx--x   3 0        0              512 Aug  5 01:55 bin
  79.  
  80. the "drwxrwx--x" tells us that this entry is a subdirectory (the
  81. "rwxrwx--x" part is just some security stuff). The "512" tells
  82. us the size of the subdirectory in bytes.  The "Aug  5 01:55" tells
  83. us the date and time that this subdirectory was last updated. The
  84. last part -- the "bin" -- tells us the name of the subdirectory.
  85.  
  86. Let's look at one more example:
  87.  
  88.    -rw-r--r--   1 0        1           350142 Oct 25 00:00 ls-lR
  89.  
  90. There is a "-" instead of a "d", so this is a file. The "350142"
  91. tells us that the size of this file is 350,142 bytes, the file
  92. was last updated at midnight on October 25, and the name of this
  93. file is "ls-lR".
  94.  
  95. Let's get back to the main SURAnet directory contents:
  96.  
  97.    drwxrwx--x   3 0        0              512 Aug  5 01:55 bin
  98.    drwxr-xr-x   2 0        1              512 May 10 12:47 etc
  99.    drwxrwxrwx   6 0        10             512 Oct 21 11:37 incoming
  100.    drwxr-xr-x   2 0        0             8192 Feb 15  1992 lost+found
  101.    -rw-r--r--   1 0        1           350142 Oct 25 00:00 ls-lR
  102.    drwxrwxr-r  24 0        100            512 May  3 13:25 pub
  103.  
  104. I want to change this main directory and get into a subdirectory.
  105. To change directories on most FTP clients, you use the command
  106.  
  107.           cd <directory>
  108.  
  109. and replace <directory> with the name of the directory that you
  110. want to access.
  111.  
  112. Since I am interested in public information, I'm going to get
  113. into "pub" directory ("pub" is the standard FTP abbreviation
  114. for "public"). I type
  115.  
  116.           cd PUB
  117.  
  118. and the following appears on my screen:
  119.  
  120.    >>>CWD PUB
  121.    550 PUB: No such file or directory.
  122.  
  123. Uhhh ... what happened?
  124.  
  125. One of the unfortunate shortcomings of FTP is that, for most of you,
  126. FTP is *case sensitive*. My "cd PUB" command did not work because
  127. there is no "PUB" directory ... but there *IS* a "pub" directory :)
  128.  
  129. Let's try it again. I type
  130.  
  131.           cd pub
  132.  
  133. and the following appears on my screen:
  134.  
  135.    >>>CWD pub
  136.    250 CWD command successful.
  137.  
  138. Cool! It worked!
  139.  
  140. Now I need to see the contents of this new directory that I just
  141. entered. Do you remember what FTP command I should use? (Hint: it is
  142. "dir")
  143.  
  144. I type "dir", and the following appears on my screen:
  145.  
  146.    >>>PORT 130,160,4,100,215,140
  147.    200 PORT command successful.
  148.    >>>LIST
  149.    150 Opening ASCII mode data connection for /bin/ls.
  150.    Total 56
  151.    -rw-rw-r--   1 1023     100           4052 Apr 22  1994 README
  152.    drwxrwsr-x   2 1023     100            512 Aug  6  1993 SURAnet
  153.    drwxrwxr-x   6 1020     120            512 Mar  3  1992 archie
  154.    drwxrwxr-x   2 1034     120            512 Feb 15  1992 articles
  155.    drwxrwxr-x   2 1007     110            512 Jun 22 15:40 books
  156.    ... <stuff deleted by me>
  157.  
  158. Whoa! That first file -- README -- looks pretty important. I bet
  159. it contains some important information that will make my life a
  160. whole bunch easier (Good rule of thumb: if you see a file that
  161. contains the words README or INDEX, it is an important file).
  162.  
  163. I need to get this README file.
  164.  
  165. To get a file using FTP, you use the
  166.  
  167.           get filename
  168.  
  169. command, replacing <filename> with the name of the file that you
  170. want to get. The get command retrieves the file from the remote
  171. site and stores the file on your service provider's system.
  172.  
  173. Since I want to get the README file, I type
  174.  
  175.           get README
  176.  
  177. (making sure to use the correct case), and the following appears
  178. on my screen:
  179.  
  180.    Invalid local filename; use 'name.type.mode' or 'name.type'
  181.  
  182. Now what?!?
  183.  
  184. This is a problem that some of you may have when you try to get
  185. "one word" files. Some local Internet service providers require
  186. files stored on their machines to have some sort of extension or
  187. type. Your can't have a file whose name is just README ... it
  188. has to be README.<type> (i.e. README.DOC, README.TXT, etc).
  189.  
  190. Since the "get README" command did not work, I'm going to have to
  191. use the
  192.  
  193.           get <filename> <name I want it saved as>
  194.  
  195. command, replacing <remote file name> with README, and replacing
  196. <name I want it saved as> with the name that I want the file to
  197. be saved as on my service provider's computer.
  198.  
  199. So, I type
  200.  
  201.           get README README.DOC
  202.  
  203. and the following appears on my screen:
  204.  
  205.    >>>PORT 130,160,4,100,218,90
  206.    200 PORT command successful.
  207.    >>>RETR README
  208.    150 Opening ASCII mode data connection for README (4502 bytes).
  209.  
  210. After a few additional seconds, the following is added to my screen:
  211.  
  212.    226 Transfer complete.
  213.    4637 bytes transferred. Transfer rate 6.14 Kbytes/sec.
  214.  
  215. YIPEE! It worked!! Let's quit FTP and see what we did.
  216.  
  217. To quit ftp, you need to use either the "bye" or "quit" commands.
  218.  
  219. On my client, the command is "quit", so I type
  220.  
  221.           quit
  222.  
  223. and the following appears on my screen:
  224.  
  225.    221 Goodbye.
  226.    Ready; T=0.54/0.96 01:45:53
  227.  
  228. Okay .. I got the file. But where is it? It is sitting on my
  229. account on my service provider's system!
  230.  
  231. Depending on your system, it is either easy or hard to get into
  232. the files that get from FTP (in Unix, type "ls"; in VM, type "fl").
  233. Your local Internet service provider can tell you a little more
  234. about how to access, read, and print these files.
  235.  
  236. Looking at this new file that I just got from FTP, I discover that
  237. the contents of the README file are a brief explanation of what is
  238. in every subdirectory off of the pub directory (cool!):
  239.  
  240.    The following items are available anonymous ftp from
  241.    ftp.sura.net:
  242.  
  243.    Directories found under pub:
  244.  
  245.    archie/          Information on the archie service as well as client
  246.                     software to use archie.
  247.  
  248.    articles/        Text versions of articles in the SURAnet newsletter.
  249.  
  250.    books/           Subdirectory containing information on ordering
  251.                     discounted books through SURAnet.
  252.  
  253.    databases/       The databases in raw format that are also offered
  254.                     through our WAIS server.
  255.  
  256.    dns/             Software and documentation to help setup the Domain
  257.                     Name Server software on Unix machines (BIND)
  258.  
  259.    fdic/            The Federal Deposit Insurance Corporation's ftp
  260.                     archive.
  261.    ... <<stuff deleted by me>>
  262.  
  263. NEAT! :)
  264.  
  265. I want to go back and get one of the articles in the SURAnet newsletter.
  266. Thanks to what I learned from the README file, I now know that the
  267. files that I am looking for are in "pub" directory and in the
  268. "articles" subdirectory.
  269.  
  270. In FTP notation, I can write this as
  271.  
  272.           /pub/articles
  273.  
  274. This means the same thing as saying "in the pub directory, in
  275. the articles subdirectory" and, as you will soon see, this notation
  276. will eventually even save me a few steps.
  277.  
  278. Let's go back to SURAnet and get some newsletter articles!
  279.  
  280. I type
  281.  
  282.           ftp ftp.sura.net
  283.  
  284. and the following appears on my screen:
  285.  
  286.    Connecting to ftp.sura.net 128.167.254.179, port 21
  287.    220 nic.sura.net FTP server (Version wu-2.4(1) Fri May 20 10:20:58
  288.    EDT 1994) ready.
  289.    USER (identify yourself to the host):
  290.  
  291. Since I do not have an account on the SURAnet machine, I type
  292.  
  293.           anonymous
  294.  
  295. and the following appears on my screen:
  296.  
  297.    >>>USER anonymous
  298.    331 Guest login ok, send your complete e-mail address as password.
  299.    Password:
  300.  
  301. I type my full Internet address -- pcrispe1@ua1vm.ua.edu -- as
  302. my password, and the following appears on my screen:
  303.  
  304.    >>>PASS ********
  305.    230-    SURAnet ftp server running wuarchive experimental ftpd
  306.    230-
  307.    230-Welcome to the SURAnet ftp server.  If you have any problems with
  308.    230-the server please mail the to systems@sura.net. If you do have problems,
  309.    230-please try using a dash (-) as the first character of your password
  310.    230- -- this will turn off the continuation messages that may be confusing
  311.    230-your ftp client.
  312.    ...
  313.    230 Guest login ok, access restrictions apply.
  314.    Command:
  315.  
  316. I know that I want to get into the pub directory, and then into
  317. the articles subdirectory. I could type "cd pub" and then "cd articles"
  318. to get into the subdirectory that I want, but it would be easier to
  319. just jump into the "articles" directory with one command.
  320.  
  321. I can make such a jump using the /pub/articles notation introduced a
  322. few minutes ago. If I type
  323.  
  324.           cd /pub/articles
  325.  
  326. I jump straight into the "articles" directory, and the following appears
  327. on my screen:
  328.  
  329.    >>>CWD /pub/articles
  330.    250 CWD command successful.
  331.    Command:
  332.  
  333. Since I have no idea what is in the "articles" subdirectory that I
  334. just entered, I type
  335.  
  336.           dir
  337.  
  338. and the following appears on my screen:
  339.  
  340.    >>>PORT 130,160,4,100,222,127
  341.    200 PORT command successful
  342.    >>>LIST
  343.    150 Opening ASCII mode data connection for /bin/ls.
  344.    Total 382
  345.    -rw-rw-r--   1 0      120          1510 Jan  3  1992 editors.box.text
  346.    -rw-rw-r--   1 0      120         46167 Jan  3  1992 fall91.issue
  347.    -rw-rw-r--   1 0      120         52864 Jan  3  1992 spring91.issue
  348.    -rw-rw-r--   1 0      120          1515 Jan  3  1992 sub.form.txt
  349.    -rw-rw-r--   1 0      120         36418 Jan  3  1992 summer91.issue
  350.    -rw-rw-r--   1 0      120         53606 Jan  3  1992 winter90.issue
  351.    226 Transfer complete
  352.  
  353. COOL! These files already have extensions (winter90.issue, etc.), so
  354. getting them is going to be a breeze!
  355.  
  356. Let's get the Fall '91 issue. Since I want the file "fall91.issue", I type
  357.  
  358.           get fall91.issue
  359.  
  360. and the following appears on my screen:
  361.  
  362.    >>>PORT 130,160,4,100,224,34
  363.    200 PORT command successful
  364.    >>>RETR fall91.issue
  365.    150 Opening ASCII mode data connection for fall91.issue (46167 bytes).
  366.  
  367. After a few seconds, the following is added to my screen:
  368.  
  369.    226 Transfer complete.
  370.    47151 bytes transferred. Transfer rate 16.58 Kbytes/sec.
  371.  
  372. IT WORKED!!! YAY!!! :)
  373.  
  374. I then quit FTP by typing either "bye" or "quit", and I am done!
  375. The file "fall91.issue" is now sitting in my account on my
  376. local Internet service provider's machine!!
  377.  
  378. TOMORROW:
  379.  
  380.      - ASCII and Binary files
  381.      - getting multiple files
  382.      - file compression and unpacking
  383.      - *FTP using nothing but e-mail*
  384.  
  385.  
  386.    PATRICK DOUGLAS CRISPEN    THE VIEWS EXPRESSED IN THIS LETTER DO NOT
  387.     PCRISPE1@UA1VM.UA.EDU      NECESSARILY REPRESENT THE VIEWS OF THE
  388.   THE UNIVERSITY OF ALABAMA      UNIVERSITY OF ALABAMA - TUSCALOOSA
  389.  
  390.       ROADMAP: COPYRIGHT PATRICK CRISPEN 1994. ALL RIGHTS RESERVED.
  391.  
  392.