List of FTP commands for the Microsoft command-line FTP client

转载 2012年05月22日 08:26:10

List of raw FTP commands

(Warning: this is a technical document, not necessary for most FTP use.)

Note that commands marked with a * are not implemented in a number of FTP servers.

Common commands

  • ABOR - abort a file transfer
  • CWD - change working directory
  • DELE - delete a remote file
  • LIST - list remote files
  • MDTM - return the modification time of a file
  • MKD - make a remote directory
  • NLST - name list of remote directory
  • PASS - send password
  • PASV - enter passive mode
  • PORT - open a data port
  • PWD - print working directory
  • QUIT - terminate the connection
  • RETR - retrieve a remote file
  • RMD - remove a remote directory
  • RNFR - rename from
  • RNTO - rename to
  • SITE - site-specific commands
  • SIZE - return the size of a file
  • STOR - store a file on the remote host
  • TYPE - set transfer type
  • USER - send username

Less common commands

  • ACCT* - send account information
  • APPE - append to a remote file
  • CDUP - CWD to the parent of the current directory
  • HELP - return help on using the server
  • MODE - set transfer mode
  • NOOP - do nothing
  • REIN* - reinitialize the connection
  • STAT - return server status
  • STOU - store a file uniquely
  • STRU - set file transfer structure
  • SYST - return system type

ABOR

Syntax: ABOR

Aborts a file transfer currently in progress.

ACCT*

Syntax: ACCT account-info

This command is used to send account information on systems that require it. Typically sent after a PASS command.

ALLO

Syntax: 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.

APPE

Syntax: APPE remote-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: CWD remote-directory

Makes the given directory be the current directory on the remote host.

DELE

Syntax: DELE remote-filename

Deletes the given file on the remote host.

HELP

Syntax: 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).

LIST

Syntax: 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 PORT or PASV command.

MDTM

Syntax: MDTM remote-filename

Returns 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.

MKD

Syntax: MKD remote-directory

Creates the named directory on the remote host.

MODE

Syntax: MODE mode-character

Sets the transfer mode to one of:

  • 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 except return a response.

PASS

Syntax: PASS password

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)
where a1.a2.a3.a4 is the IP address and p1*256+p2 is the port number.

PORT

Syntax: PORT a1,a2,a3,a4,p1,p2

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, port p1*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. Should be followed by a USER command for another login.

REST

Syntax: REST position

Sets 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 (RETR or STOR only); i.e. it must come after any PORT or PASV command.

RETR

Syntax: RETR remote-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 should send data.

RMD

Syntax: RMD remote-directory

Deletes the named directory on the remote host.

RNFR

Syntax: RNFR from-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: RNTO to-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: SITE site-specific-command

Executes a site-specific command.

SIZE

Syntax: SIZE remote-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, except that data is sent over the control connection (no PORT or PASV command is required).

STOR

Syntax: STOR remote-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: STRU structure-character

Sets the file structure for transfer to one of:

  • 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 would be set by the TYPE command). For example: UNIX Type: L8

TYPE

Syntax: TYPE type-character [second-type-character]

Sets the type of file to be transferred. type-character can be any of:

  • A - ASCII text
  • E - EBCDIC text
  • I - image (binary data)
  • L - local format
For A and E, the second-type-character specifies how the text should be interpreted. It can be:
  • N - Non-print (not destined for printing). This is the default if second-type-character is omitted.
  • T - Telnet format control (<CR>, <FF>, etc.)
  • C - ASA Carriage Control
For L, the second-type-character specifies the number of bits per byte on the local system, and may not be omitted.

USER

Syntax: USER username

Send this command to begin the login process. username should be a valid username on the system, or "anonymous" to initiate an anonymous login.

FTP返回码表示的含义

原创 SU整理(FTP)收藏  整理如下:  1开头-成功  2开头-成功  3开头-权限问题  4开头-文件问题  5开头-服务器问题  150...
  • wjacketcn
  • wjacketcn
  • 2015-09-30 13:50:01
  • 1164

FTP服务器和客户端源代码编写问题(ftp server client source)

其实FTP也就是普通的Socket程序,只是需要按照FTP协议(RFC959, 1635?可能我记错了)去做,也就是每个消息有固定的结构的,比如头3个字节必须是200,201,300,400之类的数...
  • wxqian25
  • wxqian25
  • 2013-11-18 14:24:48
  • 2082

RFC959阅读笔记

一.几个术语 1.权限控制:定义用户在系统中可使用的权限和对系统中文件的操作权限。 2.FTP有两种字节大小:文件的逻辑字节大小和数据传输字节大小。传输字节大小通常是8位,实验室不必与系统...
  • sever2012
  • sever2012
  • 2011-12-15 17:52:48
  • 2098

除非Microsoft FTP 服务(FTPSVC)正在运行,否则无法启动FTP站点。服务目前已停止

在自己电脑上搭建的ftp服务器,每次断电开机之后,ftp不能访问。计算机->右键管理->服务和应用程序->IIS管理器->网站 ->ftp 站点->启动出现错误“除非Microsoft FTP 服务(...
  • marywang56
  • marywang56
  • 2017-06-02 15:49:45
  • 838

linux下ftp的server/client的部署及使用

1.首先在一台linux机器上安装ftp服务端软件,例如proftpd,vsftpd等等 2.ftp客户端使用 (1)ftp remoteserver      通过ip或者主机名来来通过ftp协...
  • wangjianno2
  • wangjianno2
  • 2015-07-12 02:43:34
  • 2339

“除非Microsoft FTP 服务(FTPSVC)正在运行,否则无法启动FTP站点。服务目前已停止”问题解决

如果启动不了,出现“除非Microsoft FTP 服务(FTPSVC)正在运行,否则无法启动FTP站点。服务目前已停止”,就是你的ftp服务还未开启。   解决方法:控制面板-管理工具-服务-找下...
  • yiyihuazi
  • yiyihuazi
  • 2016-08-06 22:04:36
  • 3130

FTP命令:LIST

LIST命令用于列出指定目录中的子目录和文件信息,如果没有指定目录的名字就默认列出当前目录下的所有子目录和文件信息并返回给客户端。--如果路径名指定的是一个目录名,服务器会发送一份指定目录中的子目录和...
  • yhtppp
  • yhtppp
  • 2010-07-04 11:37:00
  • 6398

解析FTP的LIST命令发回的数据

FTP的“LIST”命令用来获得FTP上指定目录下的文件列表信息,Windows下FileZilla服务器发回的文件列表信息格式如下: drwxr-xr-x 1 ftp ftp            ...
  • milanleon
  • milanleon
  • 2014-01-14 13:04:59
  • 3078

使用apache的ftpserver搭建ftp服务器

不用框架的话,可以用windows自带的ftp工具搭建,不过要下载i386之类的组件。apache提供了一套ftp服务器工具。下载apache-ftpserver-1.0.6. 解压到ftpserv...
  • fangmingshijie
  • fangmingshijie
  • 2014-01-13 17:49:30
  • 1697

List of FTP user commands

FTP File Transfer Protocol Syntax FTP [-options] [-s:filename] [-w:buffer] [host] Key ...
  • tterminator
  • tterminator
  • 2015-10-16 14:24:46
  • 360
收藏助手
不良信息举报
您举报文章:List of FTP commands for the Microsoft command-line FTP client
举报原因:
原因补充:

(最多只允许输入30个字)