Document directory
- Common commands
- Less common commands
- Abor
- Acct *
- Allo
- Appe
- Cdup
- CWD
- Dele
- Help
- List
- MDTM
- MKD
- Mode
- NLST
- Noop
- Pass
- PASV
- Port
- PWD
- Quit
- Rein *
- Rest
- RETR
- RMD
- RNFR
- RNTO
- Site *
- Size
- Stat
- Stor
- STOU
- Stru
- Syst
- Type
- User
Note that commands marked with a * are not implemented in a number of FTP servers.
Common commands
- Abor-AborT a File Transfer
- CWD-CHangeWOrkingDIrectory
- Dele-DeleTe A Remote File
- List-ListRemote files
- MDTM-returnMODIficationTIME of a file
- MKD-MAKE a remoteDIrectory
- NLST-NAMELIStOf remote directory
- Pass-sendPassWord
- PASV-enterPASSiVE mode
- Port-open a dataPort
- PWD-PRINTWOrkingDIrectory
- Quit-terminate the connection
- Retr-RETRIeve a Remote File
- RMD-REMOve a remoteDIrectory
- RNFR-RENAMEFROm
- RNTO-RENAMETo
- Site-Site-Specific commands
- Size-returnSizeOf a file
- Stor-StorE a file on the remote host
- Type-set transferType
- User-sendUserName
Less common commands
- Acct *-sendACCOunTInformation
- Appe-AppeNd to a remote file
- Cdup-CWD to the parent of the current directory
- Help-returnHelpOn using the server
- Mode-set transferMode
- Noop-do nothing
- Rein *-ReinItialize the connection
- Stat-return serverStatUs
- STOU-StoRe a fileUNiquely
- Stru-set File TransferStruCture
- Syst-returnSystEm type
Abor
Syntax:
Abor
Aborts a file transfer currently in progress.
Acct *
Syntax:
AcctAccount-Info
This command is used to send account information on systems that require it. Typically sent after a PASS command.
Allo
Syntax:
AlloSize[RMax-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.
Appe
Syntax:
AppeRemote-filename
Append 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 port or PASV command so that the server knows where to receive data from.
Cdup
Syntax:
Cdup
Makes the parent of the current directory be the current directory.
CWD
Syntax:
CWDRemote-directory
Makes the given directory be the current directory on the remote host.
Dele
Syntax:
DeleRemote-filename
Deletes the given file on the remote host.
Help
Syntax:
Help [Command]
IfCommandIs given, returns help on that command; otherwise, returns general help for the FTP server (usually a list of supported commands ).
List
Syntax:
List [Remote-filespec]
IfRemote-filespecRefers to a file, sends information about that file. IfRemote-filespecRefers to a directory, sends information about each file in that directory.Remote-filespecUlts to the current directory. This command must be preceded by a port or PASV command.
MDTM
Syntax:
MDTMRemote-filename
Returns the last-modified time of the given file on the remote host in the format"Yyyymmddhhmmss":YyyyIs the four-digit year,MmIs the month from 01 to 12,DdIs the day of the month from 01 to 31,HHIs the hour from 00 to 23,MmIs the minute from 00 to 59, andSSIs the second from 00 to 59.
MKD
Syntax:
MKDRemote-directory
Creates the named directory on the remote host.
Mode
Syntax:
ModeMode-Character
Sets the transfer mode to one:
- S-stream
- B-block
- C-compressed
The default mode is stream.
NLST
Syntax:
NLST [Remote-directory]
Returns a list of filenames in the given directory (defaulting to the current directory), with no other information. must be preceded by a port or PASV command.
Noop
Syntax:
Noop
Does nothing response t return a response.
Pass
Syntax:
PassPassword
After sending the USER command, send this command to complete the login process. (note, however, that an ACCT command may have to be used on some systems .)
PASV
Syntax:
PASV
Tells 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)
WhereA1.A2.A3.A4Is the IP address andP1* 256 +P2Is the port number.
Port
Syntax:
PortA1,A2,A3,A4,P1,P2
Specifies the host and port to which the server shocould connect for the next file transfer. This is interpreted as IP AddressA1.A2.A3.A4, PortP1* 256 +P2.
PWD
Syntax:
PWD
Returns the name of the current directory on the remote host.
Quit
Syntax:
Quit
Terminates the command connection.
Rein *
Syntax:
Rein
Reinitializes the command connection-cancels the current user/password/account information. shocould be followed by a user command for another login.
Rest
Syntax:
RestPosition
Sets the point at which a file transfer shoshould start; useful for resuming interrupted transfers. for nonstructured files, this is simply a decimal number. this command must immediately precede a data transfer command (RETR or stor only); I. e. it must come after any port or PASV command.
RETR
Syntax:
RETRRemote-filename
Begins transmission of a file from the remote host. must be preceded by either a PORT command or a PASV command to indicate where the server shocould send data.
RMD
Syntax:
RMDRemote-directory
Deletes the named directory on the remote host.
RNFR
Syntax:
RNFRFrom-filename
Used when renaming a file. Use this command to specify the file to be renamed; follow it with an RNTO command to specify the new name for the file.
RNTO
Syntax:
RNTOTo-filename
Used when renaming a file. after sending an RNFR command to specify the file to rename, send this command to specify the new name for the file.
Site *
Syntax:
SiteSite-specific-command
Executes a site-specific command.
Size
Syntax:
SizeRemote-filename
Returns the size of the remote file as a decimal number.
Stat
Syntax:
Stat [Remote-filespec]
If invoked without parameters, returns general status information about the FTP server process. if a parameter is given, acts like the LIST Command, parameter t that data is sent over the control connection (no port or PASV command is required ).
Stor
Syntax:
StorRemote-filename
Begins transmission of a file to the remote site. must be preceded by either a PORT command or a PASV command so the server knows where to accept data from.
STOU
Syntax:
STOU
Begins 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.
Stru
Syntax:
StruStructure-Character
Sets the file structure for transfer to one:
- F-file (No structure)
- R-record Structure
- P-Page Structure
The default structure is file.
Syst
Syntax:
Syst
Returns a word identifying the system, the word "type:", and the default transfer type (as wocould be set by the Type COMMAND). For example:UNIX type: l8
Type
Syntax:
TypeType-Character[Second-type-Character]
Sets the type of file to be transferred.Type-CharacterCan be any:
- A-ASCII text
- E-ebcdic text
- I-image (binary data)
- L-local format
For A and E,Second-type-CharacterSpecifies how the text shocould be interpreted. It can be:
- N-non-print (not destined for printing). This is the default ifSecond-type-CharacterIs omitted.
- T-Telnet format Control (<CR>,<FF>, Etc .)
- C-ASA carriage Control
For l,Second-type-CharacterSpecifies the number of bits per byte on the local system, and may not be omitted.
User
Syntax:
UserUsername
Send this command to begin the login process.UsernameShocould be a valid username on the system, or "anonymous" to initiate an anonymous login.