List of 60 useful FTP Client Commands to access server


Posted on : Tue, 13th Oct 15 06:23 am (Updated on : Tue, 13th Oct 15 06:23 am) UTC
Author : Code2care
2314 votes

FTP stands for File Transfer Protocol, it is a TCP network layer protocol used to access/exchange data from a remote server to your system using FTP Client. It works on Port 21 (data is send to the client by port 20).

Some most commonly used FTP Clients are FileZilla (Works with Windows, Mac OS X and Linux), FireFTP and WinSCP (Windows)
When you connect to the server remotely you would have noticed the FTP logs, have you ever noticed what AUTH, EPSV, TLS, SMNT e.t.c means? They are all are FTP Commands that are send to the FTP server that follow RFC 959 Specifications by IETF.

Status:       	Connecting to 192.168.0.145...
Status:       	Connection established, waiting for welcome message...
Trace:        	CFtpControlSocket::OnReceive()

Response: 	220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
Response: 	220-You are user number 5 of 500 allowed.
Response: 	220-Local time is now 07:39. Server port: 21.
Response: 	220-This is a private system - No anonymous login
Response: 	220 You will be disconnected after 3 minutes of inactivity.

Trace:        	CFtpControlSocket::SendNextCommand()
Command: 	AUTH TLS
Trace:        	CFtpControlSocket::OnReceive()
Response: 	234 AUTH TLS OK.
Status:       	Initializing TLS...
Trace:        	CTlsSocket::Handshake()
Trace:        	CTlsSocket::ContinueHandshake()
Trace:        	CTlsSocket::OnSend()
Trace:        	CTlsSocket::OnRead()
Trace:        	TLS Handshake successful
Trace:        	Protocol: TLS1.0, Key exchange: RSA, Cipher: AES-256-CBC, MAC: SHA1
Status:       	Verifying certificate...
Status:       	TLS connection established.
Trace:        	CFtpControlSocket::SendNextCommand()
Command: 	USER m6ef4918
Trace:        	CTlsSocket::OnRead()
Trace:        	CFtpControlSocket::OnReceive()
Response: 	331 User m6ef4918 OK. Password required
Trace:        	CFtpControlSocket::SendNextCommand()

Command: 	PASS *************
Trace:        	CTlsSocket::OnRead()
Trace:        	CFtpControlSocket::OnReceive()
Response: 	230 OK. Current restricted directory is /
Trace:        	CFtpControlSocket::SendNextCommand()
Command: 	OPTS UTF8 ON
Trace:        	CTlsSocket::OnRead()
Command: 	PBSZ 0
Trace:        	CTlsSocket::OnRead()
Trace:        	CFtpControlSocket::OnReceive()
Response: 	200 PBSZ=0
Trace:        	CFtpControlSocket::SendNextCommand()
Command: 	PROT P
Trace:        	CTlsSocket::OnRead()
Trace:        	CFtpControlSocket::OnReceive()
Response: 	200 Data protection level set to "private"
Status:       	Connected
Trace:        	CFtpControlSocket::ResetOperation(0)
Trace:        	Measured latency of 96 ms
Status:       	Retrieving directory listing...
Trace:        	CFtpControlSocket::SendNextCommand()
Trace:        	CFtpControlSocket::ChangeDirSend()
Command: 	PWD
Trace:        	  state = 1
Command: 	TYPE I
Trace:        	CTlsSocket::OnRead()
Trace:        	CFtpControlSocket::OnReceive()
Response: 	200 TYPE is now 8-bit binary
Trace:        	CFtpControlSocket::TransferParseResponse()
Command: 	PASV
Trace:        	  code = 2
Trace:        	  state = 2
Trace:        	CFtpControlSocket::SendNextCommand()
Trace:        	CFtpControlSocket::TransferSend()
Trace:        	  state = 4
Command: 	MLSD

Comprehensive List of FTP Commands :

CommandDescription
ABORThis command is used to abort an active file transfer or abort previously fired command.
ACCTIt is an Account request command send to the server with account name parameter.
ADATIt stands for Authentication/Security Data : Base64 encoding is used in ADAT
ALLOCommand to allocate sufficient disk space to receive a file.
APPECommand Append is used to tell the server to append data transferred via the data connection to the existing file.
AUTHIt is an Authentication/Security Mechanism Command
CCCClear Command Channel command makes the secured channel revert back to plaintext i.e. unsecured.
CDUPThis command changes the servers working directory to Parent Directory.
CONFConfidentiality Protection
CWDThis command is used to change the current working directory.
DELEWhen a file is deleted from the FTP client Delete file command is send using this command.
ENCPrivacy Protected Channel
EPRTSpecifies an extended address and port to which the server should connect.
EPSVThis command tells the server to enter extended passive mode.
FEATCommand to get feature list implemented from the server.
HELPThis command returns help documentation.
LANGLanguage Negotiation : A new command added to FTP that lets command set to allow server-FTP to determine in which language to present server greetings and the textual part of command responses.
LISTReturns information of a file or directory if specified, else information of the current working directory is returned. If the server supports the '-R' command (e.g. 'LIST -R') then a recursive directory listing will be returned.
LPRTSpecifies a long address and port to which the server should connect.
LPSVCommand tells server to enter long passive mode.
MDTMThis command return the last-modified time of a specified file.
MICIntegrity Protected Command
MKDThis command is used to make a new directory at server.
MLSDLists the contents of a directory if a directory is named.
MLSTProvides data about exactly the object named on its command line and no others.
MODESets the transfer mode (Stream, Block, or Compressed).
NLSTThis command returns a list of file names in a specified directory.
NOOPNo operation (dummy packet; used mostly as keepalives).
OPTSSelect options for a feature.
PASSTo send authentication password.
PASVCommand makes server enter passive mode.
PBSZProtection Buffer Size
PORTSpecifies an address and port to which the server should connect.
PROTData Channel Protection Level
PWDPrint Working Directory. It return current directory of the host.
QUITTo disconnect.
REINThis command is used to re-initialize the connection.
RESTRestart transfer from the specified point.
RETRRetrieve a copy of the file.
RMDRemove a directory.
RNFRRename from.
RNTORename to.
SITESends site specific commands to remote server.
SIZEReturn the size of a file.
SMNTMount file structure.
STATReturns the current status.
STORAccept data and store data as a file at the server site.
STOUStore file uniquely.
STRUSet file transfer structure.
SYSTReturn system type.
TYPESets the transfer mode (ASCII/binary).
USERAuthentication username.
XCUP[Deprecated] Change to the parent of the current working directory.
XMKD[Deprecated] Command to Make/Create a directory at server.
XPWD[Deprecated] Command to print current working directory.
XRCP[Deprecated] RFC describes an extension to FTP which allows the user of an ITS FTP server.
XRMD[Deprecated] Remove directory from the server.
XRSQ[Deprecated] XRSQ command is used to specify recipients after a scheme is chosen
XSEM[Deprecated] Command to send, mail if cannot.
XSEN[Deprecated] Command to send to terminal.

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +