Trapped in a frame?
Break free now!

[Infinite Ink logo]
FTP

ARCHIE, FTP,
AND UNCOMPRESSION

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 

Archie, FTP, and Uncompression Basics
by Nancy McGough,  16 August 1993


This document is a quick reference for:
 * using an Archie client to find files
 * using FTP to get files
 * uncompressing files
 * using the less and more commands
 * deciding whether a file is ascii or binary

It is not intended to be a comprehensive guide.  For more detailed
information see the Unix manual pages which are available online
with the man command.


NOTATION
* Text after a colon (:) is something you type (except the word "or"
  which I use when you have a choice of what to type).
* <string> stands for text you supply -- do not type the less-than
  or greater-than symbols.


TERMINOLOGY
"on the Internet"
A machine that is "on the Internet" has an IP (Internet Protocol) 
address, and can directly participate in the Internet.  For example, 
it may be able to receive mail and news, and connect to other Internet 
machines using ftp and telnet.

desktop computer
The machine you are physically working on.  If this machine is 
not on the Internet then it needs to use communication software 
to connect to a machine on the Internet.

local and remote host 
These two terms are relative.  When you connect from a machine 
on the Internet to another machine on the Internet the one you 
start at is the "local host" and the one you connect to from 
the local host is the "remote host."

bang
"Exclamation mark" or "!".  In Unix an exclamation mark can be used to 
go out to your shell and run a program while you are in the midst 
of running another program, such as ftp.  

pipe
The symbol "|" (which is often a shifted backslash (\) on keyboards).
In Unix, and some other operating systems, the pipe is used when you
want the output of one commmand to be the input of another command.
For example "ls -CF |less" means use the output of the "ls -CF"
command as the input of the "less" command.


ASSUMPTIONS
* Local host has an Archie client.  (If it doesn't you might want to ask 
  your system administrator to install one.)
* Local host is running Unix.  If not replace all commands following
  a bang (!) with commands appropriate for your local operating system.
* Local host has the less command on it.  See "Appendix 1: Less and More" 
  for more information on this.


FINDING INTERESTING HOSTS
*  Read Internet newsgroups about topics you're interested in.  Articles,
   especially FAQs, often contain pointers to ftp sites.
*  Read books about the Internet.
*  Read "Internet Services Frequently Asked Questions & Answers (FAQ)"
   by Kevin M. Savetz.
*  Read "Updated Internet Services List" by Scott A. Yanoff.
(The last two are regularly posted to alt.internet.services and 
archived on rtfm.mit.edu in pub/usenet/alt.internet.services.)


SEARCHING ANONYMOUS FTP HOSTS
In these examples I use the -t flag which orders the results inverted by date.

To get a quick help screen for Archie, type:  archie
To search for an exact match:  	archie -et <filename> |less
To search for a substring, ignoring case:  archie -st <substring> |less


CONNECTING
1.  ftp 
2.  o <HostName>
3.  At login prompt, type either:  ftp  or  anonymous
4.  At password prompt, type:  <YourEmailAddress>


GETTING HELP FROM WITHIN FTP
For a list of FTP commands, type:  ?
For brief help about a command, type:  ? command
For brief help about the remote system type:  remotehelp


WHAT'S IN THE DIRECTORY?
On remote host:  ls -CF
On remote host, if there's more than 1 page:  ls -CF |less 
On local host:  !ls -CF
(Note: -C means list in columns; -F means flag directories with slash (/))

On remote host, to see time stamp, size, etc:  dir
On remote host, to see time stamp, etc, if more than 1 page:  dir . |less


SHOW EVERYTHING ON THE REMOTE HOST
1. To go to the top:  cd /
2. To list everything:  ls -RCF |less
3. To search for <string> in the list (within less):  /<string>


WHAT DIRECTORY AM I IN?
On remote host:  pwd
On local host:  !pwd


CHANGING THE DIRECTORY
On remote host:  cd <DirName>
On local host:  lcd <DirName>
To go home on local host:  lcd


READING A FILE
On remote host:  get <filename> |less
On local host:  !less <filename>


GETTING A FILE
1.   Be sure you are in the correct directory on both the local and 
     remote hosts.
2.   To set the file type, type either:  ascii  or  binary
     (For more info see "Appendix 2: Ascii or Binary Transfer?")
3a.  To get one file:  get <filename>
3b.  To get more than one file:  mget <filenames>
     (can use wildcards)
4.   If you want to transfer a file from your local host to your desktop 
     computer you need to use your communications software.  Be sure to
     use the correct file type for this transfer too!  (For information 
     about doing this with Kermit, see my "Transferring Files with DOS 
     Kermit.")


LEAVING FTP
Type:  bye



UNCOMPRESSING A FILE
Files at FTP sites are often compressed to save space.  The table 
below lists some common types of compression.

Extension     Uncompress Program
---------     ------------------
.gz           gunzip
.tar          tar -xvf
.Z            uncompress or gunzip
.z            gunzip  (or sometimes unpack)
.zip or .ZIP  PKUNZIP.EXE (on DOS)  or  gunzip (on Unix sometimes)

If your local host does not have an uncompress program you might want
to ask your system administrator to install it.  

Sometimes (depending on the remote host) you can uncompress a file 
before transferring it.  To do this type:  get <filename-without-suffix>
For example to uncompress and get foo.gz you would type:  get foo


FOR MORE INFORMATION
*  Read news.newusers.questions, alt.internet.services, alt.bbs.internet, 
   comp.compression, and your local help newsgroups.

*  Read the man pages for ftp, archie, less, and specific compression 
   programs by typing:  man <command> |less

*  For information about compression programs, and where to get them, 
   read comp.compression's Frequently Asked Questions (part 1/3).

*  Read my docs: "Some Internet Terminology," "Essential Unix Commands," 
   and "Transferring Files with DOS Kermit."  (Coming soon to an ftp
   site near you...)


APPENDIX 1: LESS AND MORE
Less and more are paging commands on Unix and some other operating systems.  
Less is more powerful than more.  For example, less allows you to page
backward as well as forward -- more only pages forward.  If you are on a 
Unix system that doesn't have less, you might want to ask your system 
administrator to intall it.

When you pipe the output of an ftp command through other commands, such as 
less or more, you need to keep the following in mind:
* The commands after the pipe need to be installed on your local host.
* If there are any spaces after the pipe, then the pipe and everything
  after it must be enclosed in quotes.  For example:  dir . "|grep \^d"
  (This shows all lines that begin with the letter d, i.e., all the
  directories.)
* On some systems you need to use quotes even when there are no spaces
  after the pipe.  For example:  dir . "|less"

Here are some useful commands you can use within less and more.

When you want to...           In less type...    In more type...
-------------------           ---------------    ---------------
get help                      h                  h
go down a page                [space]            [space]
go up a page                  b                  n/a
go to top                     g                  n/a
go to bottom                  G                  n/a
search forward for <string>   /<string>          /<string>
search backward for <string>  ?<string>          n/a
repeat last search            n                  n
quit                          q                  q



APPENDIX 2: ASCII OR BINARY TRANSFER?
To the computer a file is just a sequence of 0s and 1s.  When
you do a binary transfer this sequence is preserved.  When you
do an ascii transfer you are telling FTP that this is
a human-readable file and in order for it to be read on the 
local host some translation may need to be done.  FTP will do
the appropriate translation, which depends on the operating 
systems of the remote and local hosts.  Sometimes files that
most humans don't actually read need to be transferred as
ascii -- for example postscript (.ps) and rich text format (.rtf)
files.  This is because the programs that use these files as input 
are expecting them to be "human-readable" text files.

Here is a list of some file types and the transfer mode you should use:

File Type                                                  Transfer Mode
---------                                                  --------------
Unformatted text file (README, *.txt, etc.)                ascii
Postscript (.ps)                                           ascii
Rich Text Format (.rtf)                                    ascii
UUencoded file                                             ascii
Script or Batch file (no extension, .bat, .cmd, etc.)      ascii
Formatted document  (.w4w, .wp, .xls, etc.)                binary
Compressed file (.gz, .tar, .Z, .z, .zip, .zoo, etc.)      binary
Compiled executable file (no extension, .exe, .com, etc.)  binary


 
 

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Infinite Ink logo]      
top of this page

about ii ... directory ... getting in touch ... we're looking for ...
... bookstore ... linking & mirrors ... legal notices ... thanks!

 

 


Copyright © 1992-1997 Infinite Ink and Nancy McGough
Last significant update August 11, 1997
Last tweak August 11, 1997
www.ii.com/internet/ftp/archie_ftp_uncompression/
www.best.com/~ii/internet/ftp/archie_ftp_uncompression/