The easiest way to copy files from one disk to another is to use the cp
command. However, often I am interested in copying files from one computer
to another. The ftp command uses the File Transfer Protocol
(FTP) to transfer data over a network connection.
To use ftp you open a connection to a remote computer.
The remote computer runs its own version of ftp, but
you are in control of it. Within the ftp program you can list
the files in the remote computer's directory, get copies of files on
the remote computer, put copies of files from your computer onto the remote
computer, and even delete files on the remote computer.
Here is an example of a FTP session:
ftp baboon (1)
Connected to baboon.ecn.purdue.edu.
220 baboon.ecn.purdue.edu FTP server (Version 4.178 Tue Jun 18 13:30:39
EST 1991) ready.
Name (baboon:taylor): taylor (2)
331 Password required for taylor.
230 User taylor logged in.
ftp> cd tex/manual (3)
250 CWD command successful.
ftp> get chap1.tex chap1.tex.bak (4)
200 PORT command successful.
150 ASCII data connection for chap1.tex (8612 bytes).
226 ASCII Transfer complete.
local: chap1.tex.bak remote: chap1.tex
8848 bytes received in 0.45 seconds (19 Kbytes/s)
ftp> quit (5)
- This starts the ftp program and tells it to open a connection
with the computer called baboon.1
- Here you need to type in the name of your account on the remote
computer. If the name of your account on the remote computer is
the same as the account on your local computer, you don't need to
type in the account name but can just hit <enter>.
- The cd command works like it does in Unix with one exception
that we won't go into here.
- This copies the file chap1.tex from the remote computer to
chap1.tex.bak in your local working directory.
If no destination file is given the get command gives the file
the same name on the local computer.
The put command will send a file from the local computer
to the remote computer. The get and put commands don't
like wildcards. If you want to copy a
number of files that have
similar names but don't have the energy to type in all the names
individually the suggestion of mget and mput may
make you very happy that you read this manual.
- Typing quit gets you out of the ftp program.
A short explanation of the available commands can be coaxed onto your screen
by typing help at the ftp> prompt.
1 If you are attempting to open a connection
with a computer outside of the domain, you will need to include
the entire internet address. In this case it would be
© 1993-1998 Christopher C. Taylor