home *** CD-ROM | disk | FTP | other *** search
/ The Best Internet Programs / BESTINTERNET.bin / internet / lrn_inet / li_ftp.txt < prev    next >
Encoding:
Text File  |  1994-10-05  |  14.4 KB  |  361 lines

  1.  ftp 
  2.  
  3. ftp is the mla (multi-letter acronym) for File Transfer
  4. Protocol, a very important part of the TCP/IP suite of
  5. protocols.  It allows you to transfer any sort of file
  6. from any of thousands of remote computer systems to your
  7. own.  You can transfer executable computer programs, 
  8. grpahics, sound, video or any other sort of files from 
  9. remote archives to your own Internet host computer.
  10.  
  11. And it's all free.
  12.  
  13.  
  14.  
  15.  
  16.  Which Way Is Up? 
  17.  
  18. When you transfer a file from a remote computer to your own,
  19. you say "I downloaded a file."  When you transfer from your
  20. own computer to another one, you say "I uploaded a file."
  21. Down = to you; Up = away from you.  These terms can be con-
  22. fusing. 
  23.  
  24. It is even more confusing when you dial in to the
  25. Internet, because downloading will bring the file to your
  26. Internet host computer, not to your home PC or MAC.   There
  27. is another step involved in downloading the file once again
  28. to your home computer.
  29.  
  30.  
  31.  I Wish To Remain Anonymous 
  32.  
  33. As with telnet, the restriction to using remote computers is
  34. that you must have authorization to use them (an account, 
  35. a user ID and a password).  FTP gets around this problem by
  36. allowing a service called "anonymous ftp."  That is, when you
  37. connect to a remote computer that allows anonymous ftp you
  38. enter your user ID as "anonymous."  When asked for a password
  39. enter your full email address, eg: efudd@coyote.csusm.edu.
  40. Some systems verify your email address, some do not, but in
  41. any event it is proper netiquette to provide it to the
  42. remote host.
  43.  
  44.  
  45.  
  46.  Ye Be Properly Warned Says I 
  47.  
  48. Two warnings about ftp.
  49.    1) Once you see all the goodies you can get with ftp you
  50.       are likely to go crazy and download way more than you
  51.       can ever look at or use.  Practice restraint.  If you
  52.       are working under a disk quota system (you probably 
  53.       are) you will rapidly exhaust your disk space alloca-
  54.       tion, or exasperate the system administator, or both. 
  55.  
  56.    2) Many ftp archives do not check their offerings for 
  57.       viruses.  Before running any ftped file scan it with a
  58.       good, current virus checker.  The best one around is
  59.       shareware from McAfee.  Ftp it from mcafee.com.
  60.  
  61.  ftp ftp 
  62.  
  63. ftp allows access to the world's largest library--the library
  64. of freely available computer files spanning thousands of 
  65. computers.  To start ftp type the command ftp followed by 
  66. the address of the host to which you wish to connect. 
  67.  
  68. For example, ftp mcafee.com
  69.  
  70. Many ftp servers are set up separately on the Internet, so
  71. their address looks like ftp.spies.com.  Therefore the com-
  72. mand to connect to ftp.spies.com is: ftp ftp.spies.com.  
  73. This is confusing, but that's the way it is.
  74.  
  75.  
  76.  Logging In To An ftp Host 
  77.  
  78. When you make connections with an ftp host, the host will
  79. ask for your name with a prompt like:
  80.  
  81.      Name(mcafee.com:efudd):
  82.  
  83. This is where you type "anonymous," even though the host
  84. knows who you are.  When it asks for a password, enter your
  85. full email address.  It will not echo the password to the
  86. screen so type carefully.  
  87.  
  88. Be sure to read the informational screen that appears next.
  89. These screens are usually VERY important.
  90.  
  91.  The Rules Change 
  92.  
  93. Once on an ftp host, the commands for file handling change
  94. from the unix commands on your home computer.  To see a 
  95. listing of files in a certain directory enter: dir, not ls
  96. as in unix.  To change to a certain subdirectory enter:
  97. cd [name of subdirectory].  Subdirectory paths are separated
  98. (as in Unix, but not in DOS) with forward slashes. For ex-
  99. ample to change to the directory /pub/win3 enter: cd pub/win3.
  100.  
  101. If the file you want is a binary file (a computer program, 
  102. graphic, sound, or other non-text file) you must enter the
  103. command image (or i for short) first.  You will see the
  104. message File Type set to I.  This is critical.
  105.  
  106.  Getting Stuff 
  107.  
  108. To get a file, enter the command get [filename].  To get a
  109. group of files with similar names enter the command
  110. mget [filename pattern].  For example, to get all the files
  111. in a directory with the file extension .zip you would enter
  112. the command: mget *.zip.  (Careful.  This would probably do
  113. more than you think and download a ton of files).
  114.  
  115. Let's practice these concepts with a sample ftp session.  We 
  116. are going to simulate getting that antivirus program from
  117. McAfee Associates mentioned above.
  118.  
  119. Press PgDn to log in and start the ftp session...
  120.  
  121.  Archie 
  122.  
  123. The quantity of free software available via anonymous ftp is
  124. truly vast, but if you don't know where a program is located,
  125. how do you find it?  Answer: archie.  Archie is a program
  126. that searches the "Internet Archive Database" (which is up-
  127. dated about weekly).  It will look for exact or partial 
  128. matches to program names that you supply and report back to
  129. you the program's location.  Then you can ftp to that site
  130. and obtain the program.  Archie also has a whatis service,
  131. which searches a much smaller database of program descrip-
  132. tions.  Archie has been called the card catalog to the 
  133. largest library in the world.
  134.  
  135.  
  136.  Using Archie 
  137.  
  138. You begin by telnetting to a public archie server.  The
  139. printed summary to this lesson has a list of them, as
  140. does the resource section of this program.  Log in as
  141. archie.  You will see the archie> prompt.  To see a summary
  142. of available commands enter: help ?.
  143.  
  144. To use archie you must first set it up.  There are a 
  145. number of parameters that you should set--and different
  146. archie servers use different defaults--so you need to check.
  147. To see them enter the command: show.
  148.  
  149.  
  150.  
  151.  Archie Parameters 
  152.  
  153. There are three types of archie parameters: boolean, numeric
  154. and string.  (Don't let the weird terminology throw you!)
  155. Boolean parameters will either be set or not.  The one you
  156. care most about is one called "pager."  When pager is set, the
  157. output of archie is delivered one screen at a time, using the
  158. paging program called "less."  If pager is not set, and you
  159. want it set, enter the command: set pager.  The numeric para-
  160. meter you care most about is "maxhits."  It controls the
  161. number of "hits" returned by the search.  It is usually set
  162. to 100 when you begin.  You should set it to a smaller num-
  163. ber, like 10.  Entering the command "set maxhits 10" is 
  164. what you should do.
  165.  
  166.  More Parameters 
  167.  
  168. String parameters are parameters that have word values--
  169. "string" is computerese for "word."  The two most important
  170. are the "search" and "sortby" parameters.  You should set
  171. the search parameter to "sub."  (Set search sub, is the 
  172. command).  This instructs archie to search for a partial
  173. match to the search term you enter.  The other important
  174. string parameter is the sortby parameter.  You can set it
  175. to filename, hostname, size, date, time, or none, depending
  176. on how you want to see your output.  If you are going to 
  177. be doing a lot of archie searching you should also set the
  178. "mailto" parameter with your email address.  That way when
  179. you issue the mail command you will not have to enter it.
  180.  
  181.  Searching 
  182.  
  183. To search with archie issue the command: find [searchterm].
  184. Different archie servers run different versions of the archie
  185. software, however, and some do not recognize the "find"
  186. command.  (It is newer).  If this is the case with the server
  187. you are using use the "prog" command instead.  Archie was 
  188. originally designed to find programs only (thus "prog"), but
  189. archie now searches for many types of documents in addition
  190. to programs, so newer versions of the software have changed
  191. the command to "find."  Once you have issued this command,
  192. be prepared for a wait.  Archie servers are very busy and the
  193. searches can take substantial time.  To break out of a search
  194. before it is finished press Control-C.
  195.  
  196.  Output 
  197.  
  198. If pager is set you can review your archie output one screen
  199. at a time, browsing back and forth using the "less" program
  200. commands.  (Less has numerous commands.  From archie you can
  201. read about them by entering the command: man less, and then
  202. mailing the results to yourself.)  The two less commands you
  203. must know are: spacebar = show next page; q = quit.  Once 
  204. your output has been displayed you can mail it to yourself
  205. by issuing the "mail" command.  If you have not set the
  206. "mailto" parameter you will have to enter your email address
  207. each time you issue the mail command.
  208.  
  209. Now that you know it all, let's practice...
  210.  
  211.  File Types 
  212.  
  213. This lesson may seem particularly technical, but it is 
  214. unavoidably so.  If you are using ftp to get files from
  215. archived sites, or downloading files from Usenet newsgroups,
  216. you will come across a bewildering variety of archived,
  217. compressed, zipped and encoded files.  To get the real 
  218. benefit of using the Internet you need to understand how
  219. to work with these file types.  The aim of this lesson is
  220. to clarify the difference between these vaious file types
  221. and to tell you how to handle them.
  222.  
  223.  
  224.  
  225.  
  226.  Compressed Files 
  227.  
  228. A compressed file is one that has been squeezed to a smaller
  229. size by use of a program that uses special compression algo-
  230. rithms.  Why?  So that it will take up less space to store 
  231. and transfer the file.  Before it can be a useful file again,
  232. however, it has to be unsqueezed and restored to normal.  So
  233. for every compression program there is an uncompress program.
  234. In fact two of the most common Unix utilities for squeezing
  235. and unsqueezing files are called "compress" and "uncompress."
  236. Other compression programs you need to know about are
  237. gzip/gunzip, pkzip/pkunzip, and a utility called zcat, which
  238. allows reading of compressed files before they are uncom-
  239. pressed.  Gzip is for unix.  Pkzip for MS-DOS files.
  240.  
  241.  Archived Files 
  242.  
  243. An archived file is a file made up of several other files all
  244. strung together.  Many programs are actually not a single 
  245. file but a system of files including program, graphics,
  246. data, and text files.  To store and keep track of so many 
  247. files is difficult, so they are archived together into a
  248. single file for storage and transfer purposes.  In unix the
  249. archiving utility is called "tar" (which means tape archive
  250. program).  It's MS-DOS relative is the same pkzip mentioned
  251. above.  pkzip both compresses AND archives.  Bear in mind
  252. however, an archived file is not necessarily a compressed
  253. file.  In fact the tar program does not perform compression.
  254.  
  255.  
  256.  File Extensions 
  257.  
  258. Because you can't tell from a superficial look at a file 
  259. whether it is compressed, archived, both or neither, certain
  260. naming conventions have been established.  A cryptic "file
  261. extension" (one or more letters following a period appended
  262. to a file name) indicates what has been done to the file.
  263. If a file has been archived with the unix tar program it has
  264. a file extension of ".tar."  If it has been compressed with
  265. the compress program it has a file extension of ".Z."  If
  266. it has been compressed with the gzip program it has a file
  267. extension of ".gz," unless it is specifically an MS-DOS file
  268. in which case it has the extension of ".z."  If it has been
  269. archived/compressed with pkzip it's extension is ".zip."
  270.  
  271.  Some Examples, Please 
  272.  
  273.   filename.tar   - A group of files archived into one file
  274.                    using the unix "tar" program.
  275.  
  276.   filename.Z     - A single file compressed using the unix
  277.                    program "compress."
  278.  
  279.   filename.tar.Z - A file which was first a group of files
  280.                    archived into a single file with "tar" and
  281.                    then compressed with "compress."
  282.  
  283.   filename.zip   - A file compressed with the MS-DOS program
  284.                    "pkzip." 
  285.  
  286.  Archive (.tar) Files 
  287.  
  288. To archive a group of files from the unix prompt enter the
  289. following command:
  290.      tar -cvf filename.tar file1 file2 file3 ...
  291. Note the unix switches after the tar command.  The c means
  292. "create" an archive, the v means report back "verbosely,"
  293. and the f means the name of the archive is immediately
  294. "following."  After the .tar file name enter the names of
  295. the files to be archived, separated by spaces.
  296.  
  297. To unarchive a tar file, use this command:
  298.    tar -xvf filename.tar
  299. The x means "extract." Tar will not remove the original file.
  300.  
  301.  Compress (.Z) Files 
  302.  
  303. To compress a file enter this command:
  304.      compress filename
  305. where filename is the name of the file you want compressed.
  306. The results will be a file called: filename.Z.  The original
  307. file will be removed.  To uncompress this file:
  308.      uncompress filename.Z
  309. The results will be an uncompressed file without the ".Z"
  310. extension.  The original compressed file will be removed.
  311.  
  312. To read a .Z (or .gz) file before it is uncompressed use
  313. the unix utility zcat if the file is a compressed text
  314. file.  Zcat won't help if the file is a binary file.
  315.  
  316.  Archived Compressed Files (.tar.Z) 
  317.  
  318. Files which have been both archived and compressed with the
  319. unix "tar" and "compress" utilities will be called:
  320.    filename.tar.Z (or .gz, if gzip was used).  MS-DOS files
  321. are processed in this way using the pkzip program.  They have
  322. a file extension of ".zip."  
  323.  
  324. The unix programs tar and compress/uncompress are standard on
  325. unix systems and you will have access to them if your host is
  326. a unix computer.  Pkzip/pkunzip are MS-DOS programs distrib-
  327. uted as shareware, like this program, which means you can get
  328. it and use it free, and if you like it must send the author a 
  329. small fee.  You can get pkzip from most any ftp archive.
  330.  
  331.  Uuencoded Files 
  332.  
  333. Usenet news and standard unix mail work only with text files,
  334. so if you want to mail a binary file, or post a binary file
  335. to a Usenet news group, you must first convert it to a text
  336. file.  This is what the program uuencode does.  Uuencoded
  337. files are often given the file extension ".uue."  To decode
  338. the file on the other end use the unix program uudecode.
  339. Uedecode does not remove the original encoded file from
  340. your directory after decoding.
  341.  
  342. Another unix program that does the same job is "btoa" (binary
  343. to ascii).  To go the other way use the command:
  344.    btoa -a filename.
  345.  
  346.  Tarmail 
  347.  
  348. Many unix installations offer a program that will archive,
  349. compress, and mail (using standard unix mail's SMTP) a
  350. set of files all with one command.  It is called "tarmail."
  351. For example,
  352.    tarmail fudd@tel.com 'This Is It' file1 file2 file3 ...
  353. The part within the single quotes becomes the mail subject
  354. line.  When you receive tarmailed mail first save it to a
  355. file, and then issue the command: untarmail filename.
  356.  
  357. There is a great deal more that could be said about file
  358. types, but your head is probably already spinning.  This
  359. lesson's printed summary will help you further.
  360.  
  361.