Menus Unix Shell Email Newsgroup Ftp WWW HomePages ISP

Ftp

What is FTP?

FTP (File Transfer Protocol) allows a person to transfer files between two computers, generally connected via the Internet. If your system has FTP and is connected to the Internet, you can access very large amounts of archives available on a number of systems. If you are on Bitnet or a UUCP host, you should look for servers that work through the mail. A good source of information on archives in general, is the Usenet newsgroup comp.archives.

What is Anonymous FTP?

Many systems throughout the Internet offer files through anonymous FTP. These include software, documents of various sorts, and files for configuring networks. Archives for electronic mailing lists are often stored available through anonymous FTP. Note that all this is subject to change.

Commands

All the normal FTP commands may be used to retrieve files. Some FTP commands are the same on different computers, but others are not. Usually, FTP will list the commands if you type "help" type a question mark (?). Also, your computer's help command may have information about FTP. Try man ftp or man ftpd.

Some useful commands available on most systems include:

get copy a file from the remote computer to yours ls/dir list the files in the current directory cd Change directory binary Switch to binary mode. For transferring binary files ascii Switch to ascii mode. Ascii mode is the default mode

Procedure

Anonymous ftp is a facility offered by many machines on the Internet. This permits you to log in with the user name 'anonymous' or the user name 'ftp'. When prompted for a password, type your e-mail address -- it's not necessary, but it's a courtesy for those sites that like to know who is making use of their facility. Be courteous.

You can then look around and retrieve files. (Most anonymous ftp sites do not permit people to store files)

Typically, a directory called 'pub' is where the interesting things are stored. Some sites will have a file with a name like ls-lR, that contains a complete list of the files on that site. Otherwise, you can type ls -lR and get such a listing -- for some sites, this can take a LONG time.

Usually, files are grouped in archive files, so you don't have to get many small files separately. The most common archival file format for the Internet is tar. Occasion- ally, people use shell archives (shar) instead. tar archives can be unpacked by running the tar command -- you may want to first do a 'tar t' on the file to see what it contains before unpacking it. Be careful when unpacking shell archives since they have to be run through the Bourne shell to unpack them. (The simplest way is to use the unshar com- mand)

Files are often stored compressed -- for Unix, the most common scheme is the compress program, indicated by a .Z suffix on the file name. Sometimes, people use programs like arc or zoo, which are combined archival and compression formats. (There are probably other archival formats as well - talk to the systems staff if you encounter them and don't know how to deal with them)

When retrieving non-text files, you must use binary mode, otherwise the file gets messed up. To do this, use the 'binary' command. (It's safe to set this for text files. If the site at the other end is non-Unix, you may need to use some other mode -- see the documents for that site and for ftp)

The simplest way to initiate FTP would be to give the command 'ftp <system-name>', where <system-name> is the remote system you are connecting to, either a name (wsmr- simtel20.army.mil, if you have an entry in /etc/hosts or are accessing a Domain-name Server) or the InterNet address (26.2.0.74, for Simtel20). After a short wait, you will be prompted for your username. If you do not have an account on the remote system, some systems allow you to use 'anonymous'. This gives you a restricted access path.

You would then be prompted for a password. Some sys- tems will tell you to send your real identity as the pass- word. What you type doesn't matter, but it is suggested to give your mail address. Other systems need a password of 'guest', or something similar.

After that, you should receive the FTP prompt (usually ftp>), and now have access. You can get a directory of files be giving a 'dir' command, or if the remote system is Unix-based, 'ls -l' will give the familiar output. On Sim- tel20, there is a file available in the default anonymous ftp directory that explains what Simtel20 is, and where files are located. The name is 'SIMTEL-ARCHIVES.INFO.nn, where ".nn" is a file generation number. You don't need to specify the file generation number when requesting the file. In fact, it's better not to because you will always get the latest generation that way.

Unix systems will all have the familiar directory structure, and moving around is done with the familiar 'cd' or 'cwd' command. TOPS-20 systems have a different struc- ture, but movement is still accomplished with the 'cd' command.

Different systems have different organizations for their files, and the above example is just the way I have it set up. By 'poking' around other systems, you can learn how their files are set up, and zip around much faster. Note, however, that FTP will not allow you outside the FTP 'root' directory, usually ~ftp on most systems. So, poking about the entire system is not permitted.

Send mail to webmaster@nyx.net with questions or comments about this web site.

Copyright © 1999 - 2000 Nyx Net
Last modified: July 11, 1998