|
|
|
|
The following commands are recognized(* =>'s unimplemented):
USER PORT
RETR MSND* ALLO
DELE SITE* XMKD CDUP
PASS PASV
STOR MSOM* REST*
CWD STAT* RMD XCUP
ACCT* TYPE
APPE MSAM* RNFR
XCWD HELP XRMD STOU
REIN* STRU
MLFL* MRSQ* RNTO
LIST NOOP PWD
QUIT MODE
MAIL* MRCP*
ABOR NLST MKD XPWD
AUTH ADAT
PROT PBSZ MIC
ENC CCC
The commands and replies are sent via the control connection, and are in NVT
ASCII. The commands are 3 to 4 bytes of uppercase ASCII, and to some of them
there is optional argument. Here are the meanings of some commonly used FTP
commands:
USER <username>
|
Identifies the user attempting to establish an FTP session.
|
PASS<password>
|
Specifies the password for the user given previously by the USER command.
|
QUIT
|
Terminates the FTP session and closes the control connection.
|
PORT
<n1,n2,n3,n4,n5,n6>
|
Client IP address (n1,n2,n3,n4) and port (n5 x 256 +n6).
|
PASV
|
Requests that the FTP server allow the User-DTP to initiate passive data
connections.
|
TYPE <type>
|
Specifies for the file to be transferred the data type (ASCII, EBCDIC, Image or
Local), and optionally the format control (Non Print, Telnet or Carriage
Control).
|
RETR
|
Tells the server to send the user a file.
|
STOR
|
Sends a file to the server.
|
SYST
|
Requests that the server return the system type
|
BSD Interface
The FTP RFC specifies how the user PI (protocol interpreter)
communicates with the server PI, but does not specify the user interface. Most
vendors use the BSD (Berkeley Software Distribution) interface.
The BSD interface for FTP support the
following commands:
Commands may be abbreviated.
!
|
delete
|
mdelete
|
proxy
|
runique
|
$
|
debug
|
mdir
|
sendport
|
send
|
account
|
dir
|
mget
|
put
|
size
|
append
|
disconnect
|
mkdir
|
pwd
|
status
|
ascii
|
form
|
mls
|
quit
|
struct
|
bell
|
get
|
mode
|
quote
|
sunique
|
binary
|
glob
|
modtime
|
recv
|
system
|
bye
|
hash
|
mput
|
remotehelp
|
tenex
|
case
|
help
|
nmap
|
rstatus
|
trace
|
cd
|
image
|
nlist
|
rhelp
|
type
|
cdup
|
lcd
|
ntrans
|
rename
|
user
|
close
|
ls
|
open
|
reset
|
verbose
|
cr
|
macdef
|
prompt
|
rmdir
|
?
|
clear
|
private
|
protect
|
safe
|
|
Though the number of commands is high, the use of them is not as complicated as
one might think. First of all because lots of the commands are rarely being
used if at all, for example the command "tenex" - TENEX is an operating system
with a different file representation then UNIX, and the command "tenex" was
needed to invoke translation. Now TENEX is no longer is use, and the command as
well. Also, because of the ability of FTP to handle different representations
of text files, some commands are needed to specify the representation that is
in use in the other side of the connection, so translation will be possible.
And finally, some of the commands in BSD interface are exactly identical, such
as "bye" and "quit" (to logoff from server) or "help" and "?" (to show the list
of available commands.
Here are the meanings of commonly used
commands in BSD interface:
?
|
to request help or information about the FTP commands
|
ascii
|
to set the mode of file transfer to ASCII
(this is the default and transmits seven bits per character)
|
binary
|
to set the mode of file transfer to binary
(the binary mode transmits all eight bits per byte and thus provides less
chance of a transmission error and must be used to transmit files other than
ASCII files)
|
bye
|
to exit the FTP environment (same as quit )
|
cd
|
to change directory on the remote machine
|
close
|
to terminate a connection with another computer
|
|
|
close brubeck
|
closes the current FTP connection with brubeck ,
but still leaves you within the FTP environment.
|
delete
|
to delete (remove) a file in the current remote directory (same as
rm in UNIX)
|
get
|
to copy one file from the remote machine to the local machine
|
|
|
get ABC DEF
|
copies file ABC in the current remote directory to (or on top of) a file named
DEF in your current local directory.
|
|
|
get ABC
|
copies file ABC in the current remote directory to (or on top of) a file with
the same name, ABC , in your current local directory.
|
help
|
to request a list of all available FTP commands
|
lcd
|
to change directory on your local machine (same as UNIX cd
)
|
ls
|
to list the names of the files in the current remote directory
|
mkdir
|
to make a new directory within the current remote directory
|
mget
|
to copy multiple files from the remote machine to the local machine;
you are prompted for a y / n answer before
transferring each file
|
|
|
mget *
|
copies all the files in the current remote directory to your current local
directory, using the same filenames. Notice the use of the wild card character,
* .
|
mput
|
to copy multiple files from the local machine to the remote machine;
you are prompted for a y / n answer before
transferring each file
|
open
|
to open a connection with another computer
|
|
|
open brubeck
|
opens a new FTP connection with brubeck ;
you must enter a username and password for a brubeck account
(unless it is to be an anonymous connection).
|
put
|
to copy one file from the local machine to the remote machine
|
pwd
|
to find out the pathname of the current directory on the remote
machine
|
quit
|
to exit the FTP environment (same as bye )
|
rmdir
|
to to remove (delete) a directory in the current remote directory
|
For more information check:
http://unixhelp.ed.ac.uk/CGI/man-cgi?ftp
http://www.networksorcery.com/enp/rfc/rfc959.txt


|