Using FTP in MS-DOS:

The following is an example transcript using the FTP application in MS_DOS.
Note that when using FTP in a Unix shell from a telnet session, users are already logged into a remote host, and therefore, the "local" directory is remote from the particular computer from which the user is executing the telnet session, and as such, directories local to that machine (i.e. the hard drive) are inaccessible to the user. This allows users to transfer files from one remote host to another.

Many typical Unix and DOS commands are available to allow users extend the basic functions listed below.



To begin an FTP session in MS-DOS, open the DOS prompt and type "FTP", followed by the name of the remote host.

Once connected, users are prompted for their username and password.

Microsoft(R) Windows 95
(C)Copyright Microsoft Corp 1981-1996.

C:\WINDOWS>ftp ea.uci.edu
Connected to ea.oac.uci.edu.
220 taurus.oac.uci.edu FTP server (Version wu-2.6.1(1) Wed Jul 12 09:40:28 PDT 2
000) ready.
User (ea.oac.uci.edu:(none)): panteater
331 Password required for panteater.
Password:
230 User panteater logged in.

After you are logged in, you may change the local working directory using the "lcd" command (lcd <directory>)

and the remote directory using the "cd" command. (cd <directory>)

The "pwd" command lists the current remote directory.

ftp> pwd
257 "/ea/lost_souls/panteater" is current directory.
ftp> lcd desktop
Local directory now C:\WINDOWS\DESKTOP
ftp> cd public_html
250 CWD command successful.

To list the contents of the current remote directory, type "dir"

ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 240
-rw-r--r-- 1 ea 2607 Apr 23 15:35 FileA.gif
-rw-r--r-- 1 ea 2774 Apr 23 15:37 FileB.htm
-rw-r--r-- 1 ea 11549 Mar 17 20:04 FileC.gif
-rw-r--r-- 1 ea 5707 Apr 23 15:34 FileD.html
-rw-r--r-- 1 ea 416 Mar 17 19:11 index.html
-rw-r--r-- 1 ea 55651 Sep 1 23:54 FileE.jpg
-rw-r--r-- 1 ea 4483 Apr 23 15:37 FileF.ico
226 Transfer complete.
625 bytes received in 0.22 seconds (2.84 Kbytes/sec)

To transfer a file from the current remote directory to the current local directory, use either the "get" or "recv" command (get <filename>)

ftp> get FileE.jpg
200 PORT command successful.
150 Opening ASCII mode data connection for FileE.jpg (55651 bytes).
226 Transfer complete.
55778 bytes received in 0.27 seconds (206.59 Kbytes/sec)

To transfer a file from the current local directory to the current remote directory, use either the "put" or "send" command (put <filename>)

ftp> get FileE.jpg
200 PORT command successful.
150 Opening ASCII mode data connection for FileE.jpg (55651 bytes).
226 Transfer complete.
55778 bytes received in 0.27 seconds (206.59 Kbytes/sec)

To delete a file from the current remote directory, type "del <filename>"

ftp> del FileE.jpg
250 DELE command successful.
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 128
-rw-r--r-- 1 ea 2607 Apr 23 15:35 FileA.gif
-rw-r--r-- 1 ea 2774 Apr 23 15:37 FileB.htm
-rw-r--r-- 1 ea 11549 Mar 17 20:04 FileC.gif
-rw-r--r-- 1 ea 5707 Apr 23 15:34 FileD.html
-rw-r--r-- 1 ea 416 Mar 17 19:11 index.html
-rw-r--r-- 1 ea 4483 Apr 23 15:37 FileF.ico
226 Transfer complete.
560 bytes received in 0.16 seconds (3.50 Kbytes/sec)

To display a list of available commands, type "help" or "help <command>" to get help on a specific command

ftp> help
Commands may be abbreviated. Commands are:

!

delete

literal

prompt

send

?

debug

ls

put

status

append

dir

mdelete

pwd

trace

ascii

disconnect

mdir

quit

type

bell

get

mget

quote

user

binary

glob

mkdir

recv

verbose

bye

hash

mls

remotehelp

 

cd

help

mput

rename

 

close

lcd

open

rmdir

 

ftp> help lcd
lcd change local working directory

Finally, to exit the FTP session, Type "bye"

ftp> put FileE.jpg 200 PORT command successful.
150 Opening ASCII mode data connection for FileE.jpg.
226 Transfer complete.
55778 bytes sent in 0.11 seconds (507.07 Kbytes/sec)
ftp> dir
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 240
-rw-r--r-- 1 ea 2607 Apr 23 15:35 FileA.gif
-rw-r--r-- 1 ea 2774 Apr 23 15:37 FileB.htm
-rw-r--r-- 1 ea 11549 Mar 17 20:04 FileC.gif
-rw-r--r-- 1 ea 5707 Apr 23 15:34 FileD.html
-rw-r--r-- 1 ea 416 Mar 17 19:11 index.html
-rw-r--r-- 1 ea 55651 Sep 1 23:54 FileE.jpg
-rw-r--r-- 1 ea 4483 Apr 23 15:37 FileF.ico
226 Transfer complete.
625 bytes received in 0.16 seconds (3.91 Kbytes/sec)
ftp> bye
221-You have transferred 111429 bytes in 2 files.
221-Total traffic for this session was 114362 bytes in 5 transfers.

C:\WINDOWS>


For more information, see:

Unix is a Four Letter Word... and Vi is a Two Letter Abbreviation

ICS Computing Support FTP Information

UCI Unix User's Guide

Unix User's Guide on File Protection



Explanation of useful commands:

ascii: change transfer mode to ascii. It is used for files that are strictly ascii text.

binary: change transfer mode to binary.
     This mode is used for files that aren't strictly ascii text.
     If your file becomes unreadable when transferring in ascii mode, you might want to try binary

bye: logout and exit FTP

cd: change the remote working directory

close: close connection to remote host

delete: delete a file from the current remote directory

dir: display the current remote working directory

disconnect: close connection to remote host

get: copy a file from the current remote directory to the current local directory

help: display a list of commands (can be used in conjunction with a command-i.e. help lcd- to display help on a command)

lcd: change the current local directory

ls: display contents of current remote directory (see 'dir')

mdelete: delete multiple files at once from current remote directory

mget: copy multiple files from current remote directory to current local directory

mkdir: create a new remote directory

mput: copy multiple files from current local directory to current remote directory

open: open a connection to a remote host

put: copy a file from the current local directory to the current remote directory

pwd: display the name of the current remote directory

quit: exit the FTP program

recv: see 'get'

rename: rename a file in the current remote directory

rmdir: remove a directory from the current remote directory

send: see 'put'

type: display the current transfer mode (ascii or binary)