FTP From A Shell Account

Dr. Pratap Reddy

What is FTP?

Types of FTP programs

Graphical User Interface--WS FTP95, Fetch, etc.

Non-GUI: ftp available on a UNIX machine.

Anonymous FTP program from a shell account

Type What's in boldface.

rvcc>ftp wuarchive.wustl.edu

At the login user name prompt type

anonymous

At the password prompt, type your complete e-mail address.

You should see a message -- Guest login OK, restrictions apply.

Now at the ftp prompt type:

ftp>cd multimedia/graphics/gif/a

The above command changes directory to "a" which is located under "gif" subdirectory, which in turn is under "graphics" and the subdirectory graphics is under multimedia. Now Type:

ftp>ls

The above command shows a listing of all the files in the subdirectory "a".

You will notice files such as "animals.gif", etc.

These are Graphical Interface Format files, i.e., they are graphics. Therefore, before you download them to your UNIX machine, you have to issue the command "binary" or "bin". This will set the file transfer to binary mode.

ftp>binary

Now you could start downloading the file by typing the following:

ftp>get animals.gif

After the file transfer is complete you can quit ftp session by typing "bye" as follows:

ftp>bye

How do you transfer text files?

After locating a text file that you want to download type the following at the ftp prompt.

ftp>ascii

The above command prepares for .txt file transfer. A text file could be transferred by binary mode but not vice versa. That is, if you a have a graphics file such as .jpg, or .gif, or .wav make sure you set the file file transfer mode to "binary".

Now you type:

ftp>get resume.txt

Where resume.txt is the file name that exists on the ftp server and you have already changed to the appropriate directory where this file exists.

How to View a text file before Downloading it?

ftp>get resume.txt |more

In the above line give one blank space after get and one blank space after the file name then the pipe character immediately followed by the word more.

To View a list of files one page at a time

ftp>dir . |more

In the above line dir is followed by a space then a period then another space then a pipe character immediately followed by the word more.

How to ftp a file from rvcc to rvcc2>

At the rvcc prompt type:

rvcc>ftp rvcc2.raritanval.edu

After entering your login name and password, at the ftp prompt type:

ftp>put resume.txt

The above will transfer resume.txt file from the machine rvcc to rvcc2.

Similarly

ftp>get resume.txt

The above will transfer resume.txt from rvcc2 to rvcc.


Some FTP Commands


get x		Gets the file x
put x		Puts the file x
cd x		Change directory to x
mput x, y  	puts multiple files: x, y, etc.
mget x, y	gets multiple files x, y, etc.
close		Closes ftp connection
open rvcc	opens connection to rvcc
bye		disconnects from the ftp server
binary		sets file transmission mode to binary
ascii		sets file transmission mode to ascii


Back to Course Syllabus