How to Use FTP
FTP stands for File Transfer Proctocol, and is the Unix standard way of shipping
files about.
There are two kinds of files that will concern us, textual files, and pictures,
usually stored as .jpeg or .gif files.
The latter need special handling.
- Text File Transfers
Let's say that you wish to send me a file.
My address is login.sp.uconn.edu.
You know that I am up and waiting for you (my computer and I are inseparable).
From your command line you issue the command
ftp login.sp.uconn.edu
and respond with my password.
Ah Hah. Right.
You can not send me a file unless I gave you the password to allow you to write on my disk!
OK, so let's say I did it, and you have my password.
So now you're logged onto my machine's account in ftp mode.
Let's say your file is junk.pl
You issue the command
put junk.pl
and the file will be sent to me.
Then you can issue the `quit' command, and that's all there is, you sent the file.
Had you issued the command
get your_junk.pl
the file on my disk called `your_junk.pl' would have been gotten and placed on your
current directory (the one you were in when you issued the ftp command.
- Picture (Binary) File Transfers
Using get and put are exactly the same, but first, you issue the command
binary
to force the transfer to binary mode.
Then issue the `get' or `put' instruction.
Gif and Jpeg files need to be transferred this way, and you can transfer perl or html
files this way with impunity also.
By the way, you have the right to change directories before issuing either `get' or `put'.
Issuing
cd next_directory
will move you up the directory tree to a /cdavid/next_directory/ subdirectory.
Issuing
lcd next_directory
will move the local directory, yours, up to /you/next_directory/
and so it goes.
The rest is just practice.
When in doubt, issue
pwd
to see which directory you are in!
"Advanced" Topics in ftp
- mget
This is the command for getting more than one file.
mget * will get every file in a directory.
mget *.gif will get every gif file in a directory.
megt prob*.* will get all files starting with the characters `prob'.
- mput
This is the command for putting files on the remote server.
The mget scheme (above) works here identically.
- prompt
This is a binary switch, which each time it is executed changes
the prompt status.
Execute once, it turns prompting off, since on is the default.
This command is useful if you are using mget or mput, since it avoids
answering a question per item being sent or received.
Return to the main book TOC.