Searches via File Transfer Protocol
File Transfer Protocol (FTP) is a set of commands by which you can interact with another machine in order to get, put, rename or delete (depending on your level of permission) files on that machine. Like gopher, FTP allows you to get information or programs stored another machine and download them to your own. One kind of FTP that you will be using forthis class will be anonymous FTP. Anonymous FTP generally involves downloading files from a machine on which you do not have an account. For example, you might want to download software (games, utilities, or communicatiions programs, for example) that are archived on a machine in another state or another country. If the person(s) maintaining the account where the software is stored allows it, you can download the software and use it on your own computer. There are literally thousands of Anonymous FTP hosts that archive many many files that might be of iterest to you.
Prior to connecting to an Anonymous FTP host, you might want to do an Archie search to find the location files that might be of interest to you. You can find instructions for using archie by clicking here.
FTP via Unix shell
To FTP you need to use the ftp program on the unix machine at u.cc.utah.edu (assuming you have an account on that machine). To begin, you need to be in a unix shell. For u.cc.utah.edu users, that means you have to type "t" and then hit return at the mian menu. You should see a Unix prompt:
At this point, you need to start the ftp program. There are two different ways to do this:
1. Type "ftp" followed by the name of the machine you are trying to access. For example, you could type:
At this point you will see something like :
At this point, you need to type "anonymous" in order to let the machine know you are not a regular user and that you are attempting an Anonymous FTP. After typing "anonymous" hit return and you should see something like:
This means that the FTP server has approved the userid "anonymous" and is asking for your e-mail address as a password. At this point, you need to type in your e-mail address and hit return. Many FTP servers will not allow you to log in if your password does not look like an e-mail address. Once you have done this, you should see something like:
Occaisionally, your login request will be refused, often because the server is down or because there are already the maximum number of anonymous logins allowed at one time. In such a case, you will often be advised to try again later or to attempt your Anonymous FTP via a mirror site. Mirror sites are machines that carry duplicate copies of the files you want in order to facilitate the demand for these files. Mirror sites are particularly common for much sought files, such as popular games (like the Doom series) or for widely used communications programs like Netscape.
Once you have successfully logged on to the machine you are seeking, you will need to use a number of commands in order to get the file(s) you want.
Once you are finished with your Anonymous FTP session, you need to close the connection. To do so, simply type "bye" at the ftp prompt. To quit the ftp program, type "quit" at the ftp prompt
2. You could just type "ftp":
The program will start, but will not make a connection. At this point you will need to type "open" followed by the name of the machine to which you seek to connect. For example, you might type
At this point the ftp program will open a connection to the machine you desire and you should follow the directions for logging in anonymously described above.
Useful Commands for Working within the FTP Environment
Here are some commands you will need to know in order to work effectively in an FTP environment. You can click here for an abbreviated list of these commands.
dir
Once you are connected to the ftp host, you want to find out the contents of the directory you are in, you can use the dir command by typing dir at the ftp prompt.
The ftp host will then return a list of files and/or directories, giving you some idea of where you can go fromthere in your search for the file(s) you desire.
cd
cd stands for "change directory" and is the command you will use to get into the directory where the file you want is located. To change the directory to the one you want, simply type cd followed by the directory you want.
Typing this will tell the computer that you want to move to the directory titled "bin." From there you can move down another level by first typing dir to view the contents of the bin directory to find another directory you want and then typing cd followed by the name of that directory.
As a shortcut, you can move down several directories at once by typing them all in a row with slashes in between each descending sub-direcotry as such:
This command will tell the ftp program to change to the directory containing board games that is located in the games directory of the mac sub-directory of the bin directory on the machine you are using. This is particularly useful if you alead know where the file you want is located, like when you are following up on the results of an Archie search.
There are a number of other arguments you can use following the cd command.
Typing cd by itself, as in your Unix shell, will take you back to the default directory (i.e. the one at which you statered when you logged into the ftp host.
Typing cd / will take you to the root directory. Here you can usually find a README and/or an index file that will give more information about the ftp site.
Typing cdup will take you to the directory on step up from them one you are in. For example, if in the games directory of the preceding example and type cdup, you will then be in mac directory.
pwd / !pwd
If you are not sure what directory you are in, you can have the FTP host print the working directory, along with its location in the directory hierarchy, by typing pwd at the ftp prompt.
You can also find the name of the working directory in your Unix acount by typing !pwd at the ftp prompt.
lcd
Sometimes you will want to keep different kinds of downloads in different directories on your acount to avoid having numerous different kinds of files making you home irectory an unorganized mess. If you need to change the directory on your Unix account pior to downloading files, you can do so by using the lcd (local change directory). Simply type lcd followed by the desired directory name at the ftp prompt.
Of course, you need to be sure that such a directory exists, otherwise the directory change can not occur.
binary / ascii
Once you are in the directory where the file you want is located, you will then want to make sure that the ftp program is prepared to send you the file in the appropriate format. If you are requesting a binary file, such as software or a picture, you will want to tell the computer this by typing binary at the ftp prompt.
If you are requesting a text or ascii file, you can do so by typing ascii at the ftp prompt
get / mget
Once you have set the file type option to the appropriate setting, you can now get the file by using the get command. To use this command, simply type get followed by the filename you want.
To change the name of the file once it is downloaded to your account, simply type get and the filename on the FTP host followed by the name you want fot it.
Eiether way, once you have sent the get command, you will then see a message that tells you that the file is being downloaded from the host to the home directory on your account.
If you want to down load several files at once, you can use the mget command followed by the names of all of te files you want separated by a space:
This command will ask the computer to download three files to you account. You can shorten your argument string if the names of the files you are seeking have a distinct similarity by using the * wildcard. Using this wildcard with the mget command will tell the program to download all of the files that share a particular patttern. Briefly, this works because the asterisk character (*) matches zero or more charachters, so that if you want to download all of the files in a direcotry that begin with son, you would simply type
at the ftp prompt. Care should be taken in using this wildcard in that you couldinadvertently download far more than you want.
put / mput
In some cases, you might want to uplaod files from your account to an ftp host. Will most Anonymous FTP hosts will not allow you to do this, some that archive fan-based information (song lyrics to popular songs, for example) might. In order to upload, you will use the put command. This command functions very much like get, except in reverse. Once you are in the directory where you wish to upload the file, simply type put followed by the filename.
The command mput allows you to do upload several files at once. To use it, simply type mput followed by the filenames separated by a space.
You can also use the * wildcard to upload several similarly titled files at once. Remember that all of the files in the directory (on your account) from which you upload that share that particular pattern will be uploaded. If only the files I want to upload end in ".txt" I could type the follwing, thus saving time and keystrokes.
!
At times you may need to return to the Unix shell without disconnecting from the ftp host. If at any time you need to temporarily leave the ftp program and access the Unix shell, simply type ! at the ftp prompt.
To return to your ftp conection, press CNTRL-D to terminate the Unix shell. If this does not work, try the exit command.