Please Whitelist This Site?

I know everyone hates ads. But please understand that I am providing premium content for free that takes hundreds of hours of time to research and write. I don't want to go to a pay-only model like some sites, but when more and more people block ads, I end up working for free. And I have a family to support, just like you. :)

If you like The TCP/IP Guide, please consider the download version. It's priced very economically and you can read all of it in a convenient format without ads.

If you want to use this site for free, I'd be grateful if you could add the site to the whitelist for Adblock. To do so, just open the Adblock menu and select "Disable on". Or go to the Tools menu and select "Adblock Plus Preferences...". Then click "Add Filter..." at the bottom, and add this string: "@@||^$document". Then just click OK.

Thanks for your understanding!

Sincerely, Charles Kozierok
Author and Publisher, The TCP/IP Guide

NOTE: Using software to mass-download the site degrades the server and is prohibited.
If you want to read The TCP/IP Guide offline, please consider licensing it. Thank you.

The Book is Here... and Now On Sale!

Get The TCP/IP Guide for your own computer.
The TCP/IP Guide

Custom Search

Table Of Contents  The TCP/IP Guide
 9  TCP/IP Application Layer Protocols, Services and Applications (OSI Layers 5, 6 and 7)
      9  TCP/IP Key Applications and Application Protocols
           9  TCP/IP File and Message Transfer Applications and Protocols (FTP, TFTP, Electronic Mail, USENET, HTTP/WWW, Gopher)
                9  TCP/IP General File Transfer Protocols (FTP and TFTP)
                     9  File Transfer Protocol (FTP)
                          9  FTP Commands and Replies

Previous Topic/Section
FTP Commands and Replies
Previous Page
Pages in Current Topic/Section
Next Page
FTP Replies, Reply Code Format and Important Reply Codes
Next Topic/Section

FTP Internal Protocol Commands and Command Groups
(Page 2 of 2)

FTP Protocol Commands

Since the commands are based on the Telnet specifications, they are just sent as plain text as specified by Telnet's Network Virtual Terminal (NVT) conventions. I have provided below three tables that describe the FTP internal protocol commands in the order that they appear in the FTP standard (RFC 959). Table 225 covers FTP access control commands, Table 226 lists transfer parameter commands, and Table 227 service commands.

Table 225: FTP Access Control Commands

Command Code




User Name

Identifies the user attempting to establish an FTP session.



Specifies the password for the user given previously by the USER command during login authentication.



Specifies an account for an authenticated user during the FTP session. Only used on systems that require this to be separately identified; most select an account automatically based on the name entered in the USER command.


Change Working Directory

Allows the user to specify a different directory for file transfer during an FTP session.


Change To Parent Directory (“Change Directory Up”)

A special case of the CWD command that goes to the directory one level up in the server's directory structure. It is implemented separately to abstract out differences in directory structures between file systems; the user can just use CDUP instead of knowing the specific syntax for navigating up the directory tree on the server.


Structure Mount

Allows the user to mount a particular file system for access to different resources.



Reinitializes the FTP session, flushing all set parameters and user information. This returns the session to the state when the control connection is just established. It is, in essence, the opposite of the USER command. The next command issued is often USER, to log in a different user.



Terminates the FTP session and closes the control connection.

Note that the naming of this command “Logout” was unfortunate; the REIN command is really most similar to a conventional “logout” command, as it terminates a logged-in user and allows another user to log in. In contrast, the QUIT command shuts down the entire session.

Table 226: FTP Transfer Parameter Commands

Command Code




Data Port

Used to tell the FTP server that the client wants to accept an active data connection on a specific port number.



Requests that the FTP server allow the User-DTP to initiate passive data connections.


Representation 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).


File Structure

Specifies the data structure for the file (File, Record or Page).


Transfer Mode

Specifies the transmission mode to be used (Stream, Block or Compressed).

Table 227: FTP Service Commands

Command Code





Tells the server to send the user a file.



Sends a file to the server.


Store Unique

Like STOR, but instructs the server to make sure the file has a unique name in the current directory. This is used to prevent overwriting a file that may already exist with the same name. The server replies back with the name used for the file.


Append (with Create)

Like STOR, but if a file with the name specified already exists, the data being sent is appended to it instead of replacing it.



An optional command used to reserve storage on the server before a file is sent.



Restarts a file transfer at a particular server marker. Used only for Block or Compressed transfer modes.


Rename From

Specifies the old name of a file to be renamed. See the RNTO command just below.


Rename To

Specifies the new name of a file to be renamed. Used with the RNFR command.



Tells the server to abort the last FTP command and/or the current data transfer.



Deletes a specified file on the server.


Remove Directory

Deletes a directory on the server.


Make Directory

Creates a directory.


Print Working Directory

Displays the current server working directory for the FTP session; shows the user “where they are” in the server's file system.



Requests a list of the contents of the current directory from the server, including both names and other information. Similar in concept to the “DIR” command in DOS/Windows or the “ls” command in UNIX.


Name List

Like LIST, but returns only the names in a directory.


Site Parameters

Used to implement site-specific functions.



Requests that the server send to the client information about the server's operating system.



Prompts the server to send an indication of the status of a file or the transfer currently in progress.



Asks the server for any help information that might be useful in allowing the user to determine how the server should be used.


No Operation

Does nothing, other than prompting the server to send an “OK” response to verify that the control channel is alive.

Note: FTP commands are not case-sensitive, but have been shown in upper case for clarity.

FTP commands are all sent between FTP protocol elements; they are not usually issued directly by users. Instead, a special set of user commands is employed for this purpose. The FTP user interface implements the link between the user and the User-FTP process, including the translation of user commands into FTP protocol commands.

Previous Topic/Section
FTP Commands and Replies
Previous Page
Pages in Current Topic/Section
Next Page
FTP Replies, Reply Code Format and Important Reply Codes
Next Topic/Section

If you find The TCP/IP Guide useful, please consider making a small Paypal donation to help the site, using one of the buttons below. You can also donate a custom amount using the far right button (not less than $1 please, or PayPal gets most/all of your money!) In lieu of a larger donation, you may wish to consider purchasing a download license of The TCP/IP Guide. Thanks for your support!
Donate $2
Donate $5
Donate $10
Donate $20
Donate $30
Donate: $

Home - Table Of Contents - Contact Us

The TCP/IP Guide (
Version 3.0 - Version Date: September 20, 2005

Copyright 2001-2005 Charles M. Kozierok. All Rights Reserved.
Not responsible for any loss resulting from the use of this site.