分类: LINUX
2011-04-19 12:51:37
Note that commands marked with a * are not implemented in a number of FTP servers.
Common commandsAborts a file transfer currently in progress.
ACCT*Syntax: ACCT account-infoThis command is used to send account information on systems that require it. Typically sent after a command.
ALLOSyntax: ALLO size [R max-record-size]Allocates sufficient storage space to receive a file. If the maximum size of a record also needs to be known, that is sent as a second numeric parameter following a space, the capital letter "R", and another space.
APPESyntax: APPE remote-filenameAppend data to the end of a file on the remote host. If the file does not already exist, it is created. This command must be preceded by a or command so that the server knows where to receive data from.
CDUPSyntax: CDUPMakes the parent of the current directory be the current directory.
CWDSyntax: CWD remote-directoryMakes the given directory be the current directory on the remote host.
DELESyntax: DELE remote-filenameDeletes the given file on the remote host.
HELPSyntax: HELP [command]If a command is given, returns help on that command; otherwise, returns general help for the FTP server (usually a list of supported commands).
LISTSyntax: LIST [remote-filespec]If remote-filespec refers to a file, sends information about that file. If remote-filespec refers to a directory, sends information about each file in that directory. remote-filespec defaults to the current directory. This command must be preceded by a or command.
MDTMSyntax: MDTM remote-filenameReturns the last-modified time of the given file on the remote host in the format "YYYYMMDDhhmmss": YYYY is the four-digit year, MM is the month from 01 to 12, DD is the day of the month from 01 to 31, hh is the hour from 00 to 23, mm is the minute from 00 to 59, and ss is the second from 00 to 59.
MKDSyntax: MKD remote-directoryCreates the named directory on the remote host.
MODESyntax: MODE mode-characterSets the transfer mode to one of:
Returns a list of filenames in the given directory (defaulting to the current directory), with no other information. Must be preceded by a or command.
NOOPSyntax: NOOPDoes nothing except return a response.
PASSSyntax: PASS passwordAfter sending the command, send this command to complete the login process. (Note, however, that an command may have to be used on some systems.)
PASVSyntax: PASVTells the server to enter "passive mode". In passive mode, the server will wait for the client to establish a connection with it rather than attempting to connect to a client-specified port. The server will respond with the address of the port it is listening on, with a message like:
227 Entering Passive Mode (a1,a2,a3,a4,p1,p2)
where a1.a2.a3.a4 is the IP address and p1*256+p2 is the port number.
Specifies the host and port to which the server should connect for the next file transfer. This is interpreted as IP address a1.a2.a3.a4, portp1*256+p2.
PWDSyntax: PWDReturns the name of the current directory on the remote host.
QUITSyntax: QUITTerminates the command connection.
REIN*Syntax: REINReinitializes the command connection - cancels the current user/password/account information. Should be followed by a command for another login.
RESTSyntax: REST positionSets the point at which a file transfer should start; useful for resuming interrupted transfers. For nonstructured files, this is simply a decimal number. This command must immediately precede a data transfer command ( or only); i.e. it must come after any or command.
RETRSyntax: RETR remote-filenameBegins transmission of a file from the remote host. Must be preceded by either a command or a command to indicate where the server should send data.
RMDSyntax: RMD remote-directoryDeletes the named directory on the remote host.
RNFRSyntax: RNFR from-filenameUsed when renaming a file. Use this command to specify the file to be renamed; follow it with an command to specify the new name for the file.
RNTOSyntax: RNTO to-filenameUsed when renaming a file. After sending an command to specify the file to rename, send this command to specify the new name for the file.
SITE*Syntax: SITE site-specific-commandExecutes a site-specific command.
SIZESyntax: SIZE remote-filenameReturns the size of the remote file as a decimal number.
STATSyntax: STAT [remote-filespec]If invoked without parameters, returns general status information about the FTP server process. If a parameter is given, acts like the command, except that data is sent over the control connection (no or command is required).
STORSyntax: STOR remote-filenameBegins transmission of a file to the remote site. Must be preceded by either a command or a command so the server knows where to accept data from.
STOUSyntax: STOUBegins transmission of a file to the remote site; the remote filename will be unique in the current directory. The response from the server will include the filename.
STRUSyntax: STRU structure-characterSets the file structure for transfer to one of:
Returns a word identifying the system, the word "Type:", and the default transfer type (as would be set by the command). For example: UNIX Type: L8
TYPESyntax: TYPE type-character [second-type-character]Sets the type of file to be transferred. type-character can be any of:
Send this command to begin the login process. username should be a valid username on the system, or "anonymous" to initiate an anonymous login.