FTP
File Transfer Program
Date: 30 August 1995
ftp
The ftp operation can copy files from remote computers to your directory
or back. The name is File Transfer Program and it's a Unix command valid also
in non-Unix systems. It's a common operation of InterNet, the international
network of computers in the whole world. It comes from the ARPANET project.
connecting
In order to connect to the remote computer, you have to know it's name in
InterNet or it's IP number = a unique number given to each node in the network,
something like 132.72.40.20 or any other four part number. If you know it, you
type:
ftp
where stands for the name or the number of the remote computer, e.g.
ftp vm.tau.ac.il
which is the ftp site of Tel-Aviv University.
After the connection is established, the remote computer asks for a valid
uid (user identification, login name) in that computer. If you have a computer
account there, give your uid. If not, usually typing anonymous will do.
Sometimes guest may be the right key to open the doors. After that, the remote
computer may ask also for a password. If you are working under your id, give
your password there. If anonymous or guest, give your address in InterNet
(something like yankale@bgumail.bgu.ac.il). Now you get a response from the
remote site:
230 ANONYMOU logged in with no special access privileges
and the prompt from the FTP program, usually ftp> .
move around
To move in the remote computer, you type:
cd
where is the name of the required directory, e.g.
cd hank.400
and you get a message that your working directory is indeed the one you
specified.
BTW, hank.400 is a directory with many documents of InterNet.
To move up in the remote computer, you type:
cdup
and then you can cd to another directory, provided you are allowed to do it.
To change your local working directory, in the middle of the
communication, type:
lcd
and the files will be saved in or from directory . To know where you are
working locally, you can type:
pwd
which means Present Working Directory.
get remote files
If you want to copy a file from there, type:
get
where stands for the name of the file there, e.g.
get RFC.INDEX
and you get an acknowledgement which takes some time:
200 Port request OK.
150 Sending file 'RFC.INDEX'
250 Transfer completed successfully.
local: RFC.INDEX remote: RFC.INDEX
261376 bytes received in 85 seconds (3 Kbytes/s)
If you want, you can give the file another name in your directory, by giving
another argument:
get
where stands for the new name, e.g.
get RFC.INDEX list_of_RFCs
if a local name is not given, it will be the same as the remote one, possibly
in capital letters.
You can also get a group of files by the mget (multiple get) instruction
which will look something like this:
mget *.INDEX
which will get you all the files with the INDEX filetype.
The mget instruction does not allow for local names.
put files in there
If you want to put your local files in the remote computer, type:
put
where stands for the name of the file both locally and
there, e.g.
put MY.JUNK
and after sometime you get an acknowledgement. Of course you must have a write
permission in the remote directory, which is not the case in most ANONYMOUS
FTP sites.
You can give your file another name in the remote computer by giving another
argument:
put
the same as in the get instruction.
There is also the mput instruction to move many files from your computer
to the remote one.
list of files
To see the list of all the files in the remote computer, type:
dir
and you'll get (on the screen) a list of all the files, with a column of
filenames and a column of filetypes and columns for other properties of the
files.
If you need to keep this list, type:
dir
where stands for the name of the local file where you want to save the
list.
You can get also a short list of just file names, without the properties, by
typing:
ls
or
ls
respectively.
quitting
When you've finished getting and putting file, you quit by typing:
quit
and you get a response line:
221 Quitting command received
and you get back the prompt of your local system.
If you need to stop in the middle, ^C (CNTRL+c) will do it usually.
help
In the middle of your connection, you can get some help on the instructions
of FTP. You can type:
help
and get a list of the istructions. You can type:
?
where stands for the name of an instruction and get a short explanation
of that instruction (usually in one line).
data type
If you want to get (or put) binary files, you must type:
bin
before you issue any get or put instruction. If you try to tranfer compiled
programs without this instruction, the files will not be usable.
After working in binary mode, if you want to transfer regular files, type:
ascii
and you can transfer files consisting of normal ASCII characters. Transferring
ASCII files in binary mode is not recommended.
PostScript files with the PS filetype are ASCII files. Word Processing files
are binary (unless saved under the TEXT ONLY option).
type ahead
FTPing long files may take some time. When starting to send (or receive) a
file, FTP sometimes tells you the size of it. If it's more that 100KB don't
expect the process to finish soon. Also the load on InterNet nowadays is quite
high and sometimes even smaller files may take time which looks like hours.
While waiting for the process to finish, you may type the next instructions
for FTP to perform. It accepts type ahead of the next instructions and will
perform them in due time. Especially important is the option to start a long
process, type quit and go away (or move to another window in your
communication program) so that the connection will terminate once the file has
been moved.
find sites
The sites of FTP accumulations of files can be found with the help of the
archie service in InterNet. Also an old list can be found in WWW (another
InterNet service).
appending
If you want to add your file to a remote file, provided you have a
permission to do so, you type:
append
and the contents of your local file will be added to the remote file with that
filename and filetype, at the end.
deleting
To delete a remote file, provided you have permission to do so, type:
delete
and the remote file will be deleted.