FTP协议命令+返回值+返回值解析

FTP message format:
FTP commands are Telnet strings terminated by the Telnet end of line code. The command codes themselves are alphabetic character strings terminated by the character <Space> if parameters follow and <CRLF> otherwise.
FTP Commands:
命令    描述                                                                                 响应码
_________________________________________________________________________________________________________________
ABOR Abort.
           中断数据连接程序
_________________________________________________________________________________________________________________
ACCT Account.                                                                            202,230,421,500,501,502,503,530
           系统特权账号       
_________________________________________________________________________________________________________________
ADAT Authentication/Security Data.
_________________________________________________________________________________________________________________
ALLO Allocate.
          为服务器上的文件存储器分配字节
_________________________________________________________________________________________________________________
APPE Append.
          添加文件到服务器同名文件
_________________________________________________________________________________________________________________
AUTH Authentication/Security Mechanism.
_________________________________________________________________________________________________________________
CCC Clear Command Channel.
_________________________________________________________________________________________________________________
CDUP Change to parent directory.                                              250,421,500,502,530,550
           改变服务器上的父目录
_________________________________________________________________________________________________________________
CONF Confidentiality Protected Command.
_________________________________________________________________________________________________________________
CWD Change working directory.                                                  250,421,500,501,502,530,550
           改变服务器上的工作目录
_________________________________________________________________________________________________________________
DELE Delete.                                                                               250,421,502,530,550
          删除服务器上的指定文件
_________________________________________________________________________________________________________________
ENC   Privacy Protected Command.
_________________________________________________________________________________________________________________
EPRT Extended Data port.
_________________________________________________________________________________________________________________
EPSV Extended Passive.
_________________________________________________________________________________________________________________
FEAT Feature.
_________________________________________________________________________________________________________________
HELP Help.
          返回指定命令信息
_________________________________________________________________________________________________________________
LANG Language negotiation.
_________________________________________________________________________________________________________________
LIST List.                                                                                     125,150,226,250,421,425,426,450, 451,500,501,502,530
        如果是文件名列出文件信息,如果是目录则列出文件列表
_________________________________________________________________________________________________________________
LPRT Long data port.
_________________________________________________________________________________________________________________
LPSV Long passive.
_________________________________________________________________________________________________________________
MDTM File modification time.
_________________________________________________________________________________________________________________
MIC Integrity Protected Command.
_________________________________________________________________________________________________________________
MKD Make directory.
        在服务器上建立指定目录
_________________________________________________________________________________________________________________
MLSD
_________________________________________________________________________________________________________________
MLST       列出指定目录内容                                                         同LIST命令
_________________________________________________________________________________________________________________
MODE Transfer mode.
             传输模式(S=流模式,B=块模式,C=压缩模式)
_________________________________________________________________________________________________________________
NLST   Name list.
_________________________________________________________________________________________________________________
NOOP No operation.                                                                     200,421,500
            无动作,除了来自服务器上的承认
_________________________________________________________________________________________________________________
OPTS Options.
_________________________________________________________________________________________________________________
PASS Password.                                                                            202,230,332,421,500,501,530
          系统登录密码          
_________________________________________________________________________________________________________________
PASV Passive mode.                                                                    227,421,500,501,503
          请求服务器等待数据连接                             
_________________________________________________________________________________________________________________
PBSZ Protection Buffer Size.
_________________________________________________________________________________________________________________
PORT Data port.                                                                          200,421,500,501,530
          IP 地址和两字节的端口 ID
_________________________________________________________________________________________________________________
PROT Data Channel Protection Level.
_________________________________________________________________________________________________________________
PWD Print working directory.                                                       257,421,500,501,502,550
        显示(打印)当前工作目录
_________________________________________________________________________________________________________________
QUIT Logout.
         从 FTP 服务器上退出登录
_________________________________________________________________________________________________________________
REIN Reinitialize.                                                                          120,220,421,500,502
         重新初始化登录状态连接
_________________________________________________________________________________________________________________
REST Restart of interrupted transfer.                                           350,421,500,501,502,530
          由特定偏移量重启文件传递
_________________________________________________________________________________________________________________
RETR Retrieve.                                                                            110,125,150,226,250,421,425,426, 450,451,500,501,504,530,550
          从服务器上找回(复制)文件                           
_________________________________________________________________________________________________________________
RMD Remove directory.
         在服务器上删除指定目录
_________________________________________________________________________________________________________________
RNFR Rename from.
           对旧路径重命名
_________________________________________________________________________________________________________________
RNTO Rename to.
           对新路径重命名
_________________________________________________________________________________________________________________
SITE Site parameters.
         由服务器提供的站点特殊参数
_________________________________________________________________________________________________________________
SIZE File size.
_________________________________________________________________________________________________________________
SMNT Structure mount.
           挂载指定文件结构
_________________________________________________________________________________________________________________
STAT Status.                                                                                211,212,213,421,450,500,501,502,530
           在当前程序或目录上返回信息
_________________________________________________________________________________________________________________
STOR Store.     110,125,150,226,250,421,425,426,450,451,452,500,501,504,530,532,550,551,552,553
           储存(复制)文件到服务器上                           
_________________________________________________________________________________________________________________
STOU Store unique.
           储存文件到服务器名称上
_________________________________________________________________________________________________________________
STRU File structure.
          数据结构(F=文件,R=记录,P=页面)
_________________________________________________________________________________________________________________
SYST System.
          返回服务器使用的操作系统
_________________________________________________________________________________________________________________
TYPE Representation type.                                                                         200,421,500,501,504,530
          数据类型(A=ASCII,E=EBCDIC,I=binary)
_________________________________________________________________________________________________________________
USER User name.                                                                                        230,331,332,421,500,501,530
          系统登录的用户名
_________________________________________________________________________________________________________________
XCUP Change to the parent of the current working directory.
_________________________________________________________________________________________________________________
XMKD Make a directory.
_________________________________________________________________________________________________________________
XPWD Print the current working directory.
_________________________________________________________________________________________________________________
XRCP
_________________________________________________________________________________________________________________
XRMD Remove the directory.
_________________________________________________________________________________________________________________
XRSQ
_________________________________________________________________________________________________________________
XSEM Send, Mail if cannot.
_________________________________________________________________________________________________________________
XSEN Send to terminal.
_________________________________________________________________________________________________________________
FTP服务器的响应是3位的响应码,其中第一位表示响应是好、是坏还是未完:
Code Description
_________________________________________________________________________________________________________________
1yz    Positive Preliminary reply.
        肯定的初步答复:这些状态代码指示一项操作已经成功开始,但客户端希望在继续操作新命令前得到另一个答复。
_________________________________________________________________________________________________________________
2yz    Positive Completion reply.
        肯定的完成答复:一项操作已经成功完成。客户端可以执行新命令。
_________________________________________________________________________________________________________________
3yz    Positive Intermediate reply.
        肯定的中间答复:该命令已成功,但服务器需要更多来自客户端的信息以完成对请求的处理。
_________________________________________________________________________________________________________________
4yz    Transient Negative Completion reply.
        瞬态否定的完成答复:该命令不成功,但错误是暂时的。如果客户端重试命令,可能会执行成功。
_________________________________________________________________________________________________________________
5yz    Permanent Negative Completion reply.
        永久性否定的完成答复:该命令不成功,错误是永久性的。如果客户端重试命令,将再次出现同样的错误。
_________________________________________________________________________________________________________________
响应码第二位表示了特定的分类,具体内容如下:
Code Description
_________________________________________________________________________________________________________________

x0z    Syntax. These replies refer to syntax errors, syntactically correct commands that don't fit any functional category, unimplemented or superfluous commands.
        语法错误,表示不符合任何功能分类的命令,可能是未实现的命令或者多余的命令。
_________________________________________________________________________________________________________________
x1z    Information. These are replies to requests for information, such as status or help.
        信息类型
_________________________________________________________________________________________________________________
x2z    Connections. Replies referring to the control and data connections.
        连接类型
_________________________________________________________________________________________________________________
x3z    Authentication and accounting. Replies for the login process and accounting procedures.
        与注册或者登陆相关命令的应答
_________________________________________________________________________________________________________________
x4z   未定义
_________________________________________________________________________________________________________________
x5z    File system. These replies indicate the status of the Server file system vis-a-vis the requested transfer or other file system action.
        文件系统状态
_________________________________________________________________________________________________________________
响应码第三位是对第二位的分级,给出了差错的附加含义,具体内容如下:
Code Description
_________________________________________________________________________________________________________________
110    Restart marker reply.                              重新启动标记答复。
120    Service ready in nnn minutes.                      服务已就绪,在nnn分钟后开始。  
125    Data connection already open; transfer starting.   数据连接已打开,正在开始传输。
150    File status okay; about to open data connection.   文件状态正常,准备打开数据连接。
200    Command okay.                                      命令确定。
202    Command not implemented, superfluous at this site. 未执行命令,站点上的命令过多
211    System status, or system help reply.               系统状态,或系统帮助答复。
212    Directory status.                                  目录状态。
213    File status.                                       文件状态。
214    Help message.                                      帮助消息。
215    NAME system type.                    NAME系统类型,其中,NAME是Assigned Numbers文档中所列的正式系统名称。
220    Service ready for new user.                        服务就绪,可以执行新用户的请求。
221    Service closing control connection.                服务关闭控制连接。如果适当,请注销。
225    Data connection open; no transfer in progress.     数据连接打开,没有进行中的传输。
226    Closing data connection.                 关闭数据连接。请求的文件操作已成功(例如,传输文件或放弃文件)。
227    Entering Passive Mode <h1,h2,h3,h4,p1,p2>.         进入被动模式(h1,h2,h3,h4,p1,p2)。
228    Entering Long Passive Mode.
229    Extended Passive Mode Entered.
230    User logged in, proceed.                           用户已登录,继续进行。
250    Requested file action okay, completed.             请求的文件操作正确,已完成。
257    "PATHNAME" created.                                已创建“PATHNAME”。
331    User name okay, need password.                     用户名正确,需要密码。
332    Need account for login.                            需要登录帐户。
350    Requested file action pending further information. 请求的文件操作正在等待进一步的信息。
421    Service not available, closing control connection.
        服务不可用,正在关闭控制连接。如果服务确定它必须关闭,将向任何命令发送这一应答。
425    Can't open data connection.                        无法打开数据连接。
426    Connection closed; transfer aborted.               连接被关闭,数据传输中断。
450    Requested file action not taken.                   未执行请求的文件操作。文件不可用。
451    Requested action aborted. Local error in processing.请求的操作异常终止:正在处理本地错误。
452    Requested action not taken.                        未执行请求的操作。系统存储空间不够。
500    Syntax error, command unrecognized.      语法错误,命令无法识别。这可能包括诸如命令行太长之类的错误。
501    Syntax error in parameters or arguments.           在参数中有语法错误。
502    Command not implemented.                           未执行命令。
503    Bad sequence of commands.                          错误的命令序列。
504    Command not implemented for that parameter.        未执行该参数的命令。
521    Supported address families are <af1, .., afn>
522    Protocol not supported.
530    Not logged in.                                     未登录。
532    Need account for storing files.                    存储文件需要帐户。
550    Requested action not taken.                        未执行请求的操作。文件不可用。
551    Requested action aborted. Page type unknown.       请求的操作异常终止:未知的页面类型。
552    Requested file action aborted.                     请求的文件操作异常终止:超出存储分配(对于当前目录或数据集)。
553    Requested action not taken.                        未执行请求的操作。不允许的文件名。
554    Requested action not taken: invalid REST parameter.
555    Requested action not taken: type or struct mismatch.
_________________________________________________________________________________________________________________
        FTP响应通常是单行的,格式为"响应码+空格+提示信息+\r\n"。如果需要产生一条多行应答,第1行在第3位数字应答码之后包含一个连字号,而不是空格,最后一行包含相同的3位数字应答码,后跟一个空格字符。

FTP规范的更多相关文章

  1. ftp (文件传输协议)

    ftp (文件传输协议) 锁定 本词条由“科普中国”百科科学词条编写与应用工作项目 审核 . FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议” ...

  2. 运维安全系列基础服务之 FTP 服务(系列一)

    做了多年运维工程师,积攒了一些经验,和大家分享下.个人认为,运维安全话题的系列,主要包括下面四个方面: 基础服务 网络层 应用层 云安全 今天主要讲的是基础服务里面的[FTP服务][ftp]. 文件传 ...

  3. FTP详解

    概述 FTP 是File Transfer Protocol(文件传输协议)的英文简称,而中文简称为“文传协议”.用于Internet上的控制文件的双向传输.同时,它也是一个应用程序(Applicat ...

  4. FTP软件FileZilla 3.38.1下载

    FTP软件FileZilla 3.38.1下载 filezilla软件简介 FileZilla是一个免费开源的FTP软件,分为客户端版本和服务器版本,具备所有的FTP软件功能,具备极好的可控性及条理性 ...

  5. Serv-U FTP版本控制服务器 - 目录规范

    背景 公司要组建一个版本控制服务器,选定了serv-u,初始目的是应用于war级的一些标准组件的版本控制/测试交付/统一对外发布渠道. 项目过程图: 如果不使用版本控制会出现什么问题? War标准组件 ...

  6. C# FTP/SFTP文件传输控件FTP for .NET/.NET CF 详细介绍

    FTP for .NET将FTP客户端功能添加到您的应用程序之中..NET控件的FTP支持所有常用的FTP服务器以及代理服务器,包括可扩展的目录解析.同步以及异步操作.主动与被动模式.以VB.NET与 ...

  7. [Redis]Redis 概述及基本使用规范.

    1 nosql的简介 1.1 nosql简介 随着互联网Web2.0网站的兴起,传统的关系数据库在应付Web2.0网站,特别是超大规模和高并发的SNS类型的Web2.0纯动态网站已经显得力不从心,暴露 ...

  8. c/s模式 (C#)下Ftp的多文件上传及其上传进度

    因为项目要求,制作的一个多文件上传,并显示进度条一段代码(vs2005环境).(只为粗略的实现,代码并不规范) 当多个文件上传的时候,需要依次队列形式一个个上传,当上传某个文件的时候,锁定进程,上传完 ...

  9. [iOS翻译]Cocoa编码规范

        简介: 本文整理自Apple文档<Coding Guidelines for Cocoa>.这份文档原意是给Cocoa框架.插件及公共API开发者提供一些编码指导,实质上相当于Ap ...

随机推荐

  1. php实现多线程

    php实现多线程 感谢 3lian8 的投递 时间:2014-01-21 来源:三联教程 有没有办法在php中实现多线程呢?假设你正在写一个基于多台服务器的php应用,理想的情况时同时向多台服务器发送 ...

  2. PHP文件操作 之往一个文件写入数据

    //打开一个文件 $f = fopen($filename,'wb'); $filename:打开一个文件,不存在则自动创建,如果不能创建,说明指定的文件目录有错误 wb:写入的方式 ---- 覆盖原 ...

  3. Environment Variables

    https://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx Every process has an ...

  4. Andrew Ng机器学习公开课笔记 -- Mixtures of Gaussians and the EM algorithm

    网易公开课,第12,13课 notes,7a, 7b,8 从这章开始,介绍无监督的算法 对于无监督,当然首先想到k means, 最典型也最简单,有需要直接看7a的讲义   Mixtures of G ...

  5. mysql中文字段转拼音首字母,以及中文拼音模糊查询

    创建存储过程,将中文字段转拼音首字母 CREATE DEFINER=`root`@`%` FUNCTION `fristPinyin`(P_NAME VARCHAR(255)) RETURNS var ...

  6. android imageButton 点击按钮前中后,按钮颜色的变化

    我们在开发的过程中,往往为了美化界面的需要,会修改按钮的默认外观,而因为Android中的按钮有三种状态—默认,被点击,被选中.所以,如果要改变按钮的外观,需要对这三种情况都做出修改,也许在以往,我们 ...

  7. Excel VBA

    =COUNTIF(Y3:Y212,"=11") =SUMIF(Y3:Y212,"=11",AA3:AA212) =SUMPRODUCT((Y3:Y212=&qu ...

  8. Mysql 只导出数据,不包含表结构

    mysqldump -u${user} -p${passwd} --no-create-info --database ${dbname} --table ${tablename} > ${ta ...

  9. 兼容IE的CSS的”引入方式“

    1.给IE浏览器的7版本来提供需要引用的样式(如果把7去掉则给所有的IE浏览器提供样式) <!--[if IE 7]> <Link type="text/css" ...

  10. YUM Installation PostgreSQL

    PostgreSQL can be installed using RPMs (binary) or SRPMs (source) managed by YUM. This is available ...