FTP


by David Noack

When it comes to Files­whether they are audio, video or plain old text­there¹s no better place than the Internet. You¹ll find tons of files and programs in all sorts of nooks and crannies on the Net.

From the Constitution of the State of California, recipes, shareware, freeware and public domain programs, images of everything from dogs to dinosaurs to even the latest versions of the most popular games.

Most of these files are kept in what is known as anonymous FTP or File Transfer Protocol sites or libraries. These are publicly-accessible sites created by businesses, educational institutions, individuals, corporations, non-profit organizations and government agencies that allow access to certain files and programs.

For the most part today, people get files on the Internet using Graphical User Interface (GUI) client programs, such as Microsoft¹s Explorer, Netscape¹s Navigator, CuteFTP for the PC and Fetch for the Macintosh.

These client programs allow you to point-and-click your way to the files. But what if don¹t have access to a SLIP (Serial Line Interface Protocol) or PPP (Point-to-Point Protocol), but rely on a trusty Unix dial-up shell account?

Here I¹ll show you some of the basics of how to download files from FTP sites via a Unix shell. It¹s not complicated and if you know a few basic Unix commands, that will make things a little easier. Don¹t forget that downloading files via a Unix shell is a two-step process, first to the local host computer (your ISP) and then to your computer.

It¹s also important to note that since we are dealing with Unix, you must type commands and file names they appear because Unix is case sensitive. So a file with the name apple.zip is not the same as APPLE.zip. To Unix, these are two completely different files.

If you have been using a dial-up Unix shell account, your familiar with the Unix prompt. To get the FTP client program started, just type ftp at the prompt and press enter. The prompt will now display ftp and wait for your next command. You can type 'open¹ and hit enter and a 'to¹ prompt will appear. At the 'to¹ prompt, type in the address of the FTP site.

A shortcut to accessing an FTP site is to type ftp (space) followed by the address. For example, let¹s say I wanted to go the anonymous FTP site at The Oak Software Repository, which is a service of Oakland University in Rochester, Minnesota. I would type this at the Unix prompt: ftp.oak.oakland.edu

The Oak Repository is a primary mirror of Simtel.Net, Keith Petersen¹s world-wide distribution network for Shareware, Freeware, and Public Domain programs for MS-DOS, Windows 3.x, and Windows 95. I¹ll explain shortly to how to get to the SimTel site.

Once the connected to an FTP site, you¹ll be prompted for your name, and since this is anonymous FTP, just type the word anonymous at the prompt and hit enter. After that, you¹ll be asked for a password. In some cases, you can type guest and that will suffice. But in some instances, you will need to type in your full e-mail address to gain access to the file site.

After typing in either guest or your e-mail address, press enter. At that point, you¹ll be back at the ftp prompt. In order to see what directories and files exist, you can type either ls for list or dir for directory.

In most cases, either will work. After you type the ls or dir command at the prompt, you¹ll then see a list of directories and files. Directories start with the letter d and a files begin with a hyphen or what appears to be a minus sign, followed by a series of permission symbols.

On anonymous ftp sites, files available to the public are normally housed in a directory called pub. In order to find out what directories, subdirectories and files are in pub, all you have to do at the ftp prompt is type cd (space) pub or cd (space) /pub. That will take you to the pub directory. Once again you will enter either the ls or dir command to see what¹s available in the pub directory. To make sure your in the pub directory, type pwd (print working directory) and that will show the directory your currently in.

To access SimTel, you are doing to have to type cd pub at the prompt and then cd simtelnet to connect to that FTP archive site. That will take you to the SimTel site. Let¹s say that you are looking for some new screen savers for Windows 95. The Windows 95 files are in a directory called win95. To get into that directory, type cd win95 and hit enter.

Many times you will find that the there are so many subdirectories and files in a directory that they scroll off the screen and you can¹t really tell what¹s available. In that case, you can use the more command to slow things down to a screenful at a time.

There are dozens of directories and files in the win95 directory. To see a screenful of information at a time, all you do is type ls, followed by a space, /pub/simtelnet/win95 (the name of the current directory) and | (pipe symbol) and the word more. It looks like this: ls /pub/simtelnet/win95 |more. That will allow the information to be displayed one screen at a time. At the bottom of the screen you will see the word 'more¹, just hit the space bar to see the next page.

Now let¹s go after those screen savers.

There is a directory named scrsave. You know it¹s a directory because of the d at the beginning at the far left hand side of the column. In order see what files are in this directory, type cd scrsave. There is a index file in this directory. It¹s always a good rule of thumb to check out any readme or index files because they may save you time by providing valuable information about what is in a particular directory or help you locate a file more quickly.

To view this index file, type get 00_ index.txt |more. This text file tells us what kinds of screen saving programs are in this directory. There are 15 screen saver files. Another reminder, since this is Unix you have to type everything as you see it. If a file is in all capital letters or upper and lower case, type it just the way it appears.

When it comes to downloading files, make sure the proper mode is working. The two transfer modes are ASCII, which is plain text, and binary, which is for programs. To change from one mode to another, type either binary or ASCII at the prompt. All the files in scrsave are binary files.

To download a single file, type get websave1.zip and that file will be transferred to the home directory on your local host computer. Since this file comes with a .zip extension at the end, it is a compressed file. Once you have this file on your own computer, you will need to use Pkunzip program to open the file.

Let¹s say you wanted to download a few screen saver programs at one time. In that case, you¹d use the mget command.

The files you want to download are: hidethat.zip, psych30.zip, and lights95.zip. To get them on your local host computer, your would type mget, (space) followed by the first file name (space) second file name (space) third file name and press enter. You¹ll then be prompted if you want to proceed with each file download.

Once a file is downloaded to your local host, you can either leave the file on your local host or download it to your computer. If it¹s a binary file, it¹s better to download the file or program to your computer so you can use it. If it¹s a text file that you simply want to read, you can display it on your local host and leave it there.

In order to download a file from your ISP, first check your home directory or whatever directory the file (files) are located, then at the Unix prompt, type in sz (space) file name, and that will activate the Zmodem protocol and begin the downloading process to the hard drive of your computer. This may take some time depending on the size of the file.

Getting files using the Unix FTP client program is an important tool to keep current with the latest programs and is a fun way to maintain your Unix skills. You never know when your going to need them.

©1996 David Noack