tnftp手册翻译-程序员宅基地

技术标签: 文档/手册  Linux/Unix系统编程手册  软件使用  linux  

原文链接:https://blog.csdn.net/qq_51470638/article/details/137849594

1. SYNOPSIS

tnftp [-46AadefginpRtVv?] [-N netrc] [-o output] [-P port] [-q quittime]
      [-r retry] [-s srcaddr] [-T dir,max[,inc]] [-x xfersize]
      [[user@]host [port]] [[user@]host:[path][/]] [file:///path]
      [ftp://[user[:password]@]host[:port]/path[/][;type=type]]
      [http://[user[:password]@]host[:port]/path]
      [https://[user[:password]@]host[:port]/path] ...
tnftp -u url file ...
tnftp [-46AadefginpRtVv?] [-N netrc] [-o 输出] [-P 端口] [-q 退出时间]
	[-r 重试次数] [-s 源地址] [-T 目录,最大值[,增量]] [-x 传输大小]
	[[user@]host [port]] [[user@]host:[path][/]] [file:///path]
	[ftp://[user[:password]@]host[:port]/path[/][;type=type]]
	[http://[user[:password]@]host[:port]/path]
	[https://[user[:password]@]host[:port]/path] ...
tnftp -u url file ...

2. DESCRIPTION

tnftp是互联网标准FTP协议的用户接口。
这它允许用户和和网络站点之间进行文件传输。

最后五个参数将通过FTPHTTP协议或直接复制文件到当前目录。
这很适用于脚本。有关更多信息,请参阅下面的AUTO-FETCHING FILES部分。

选项可以在命令行上指定,也可以在命令解释器中指定。

  1. -4

    • 强制 tnftp 仅使用 IPv4 地址。
  2. -6

    • 强制 tnftp 仅使用 IPv6 地址。
  3. -A

    • 强制使用主动模式FTP。默认情况下,tnftp会尝试使用被动模式FTP,如果服务器不支持被动模式,则会回退到主动模式。此选项导致tnftp始终使用主动连接。它只对连接到非常旧的服务器有用,这些服务器不能正确实现被动模式。
  4. -a

    • 导致tnftp绕过正常的登录程序,而使用匿名登录。
  5. -d

    • 启用调试模式。
  6. -e

    • 禁用命令行编辑。这对Emacs的ange-ftp模式很有用。
  7. -f

    • 强制重新加载缓存,用于通过FTP或HTTP代理进行的传输。
  8. -g

    • 禁用文件名通配符扩展。
  9. -i

    • 在多个文件传输期间关闭交互提示。
  10. -N netrc

    • 使用netrc文件而不是~/.netrc文件。有关更多信息,请参阅THE .netrc FILE
  11. -n

    • 对于非自动获取传输,阻止tnftp在初始连接时尝试“自动登录”。如果启用了自动登录,则tnftp将在用户的主目录中检查.netrc文件(请参阅下文)中的条目,这个条目描述了远程计算机上的帐户。如果没有条目存在,tnftp将提示输入远程计算机的登录名(默认为本地计算机上的用户身份),并在必要时提示输入密码和登录时要使用的帐户。要覆盖自动登录的自动获取传输,请根据需要指定用户名(以及可选的密码)。
  12. -o output

    • 在自动获取文件时,将内容保存在output文件中。output文件根据下面的FILE NAMING CONVENTIONS进行解析。如果output文件不是“-”,或者不以“|”开头,则只有第一个指定的文件将被检索到输出文件中;所有其他文件将被检索到其远程名称的基本名称中。
      13, -P port
    • 将端口号设置为指定的port。
  13. -p

    • 启用被动模式操作,用于在连接过滤防火墙后使用。此选项已被弃用,因为tnftp现在默认尝试使用被动模式,如果服务器不支持被动连接,则回退到主动模式。
  14. -u url file ...

    • 将命令行上的文件上传到url,其中url是由自动获取支持的’ftp://'URL类型之一(对于单个文件上传,还可以指定目标文件名),而file是要上传的一个或多个本地文件。
  15. -V

    • 禁用详细信息和进度显示,这会覆盖终端的默认设置(当输出到终端时是默认启用的)
  16. -v

    • 启用详细信息和进度显示。这是默认设置,如果输出到终端(并且在进度的情况下,tnftp是前台进程)。强制tnftp显示来自远程服务器的所有响应,以及报告数据传输统计信息。
  17. -x xfersize

    • 将套接字发送和接收缓冲区的大小设置为xfersize。有关更多信息,请参阅xferbuf
  18. -?

    • 将帮助显示到stdout,并退出。

  • 可以在命令行上指定tnftp要与之通信的客户主机。
  • 如果这样做,tnftp将立即尝试与那台主机上的FTP服务器建立连接;否则,tnftp将进入其命令解释器,并等待用户的指示。
  • 当tnftp正在等待用户的命令时,会向用户提供提示符ftp>

tnftp识别以下命令:

  1. ! [command [args]]
    Invoke an interactive shell on the local machine. If there are ar‐
    guments, the first is taken to be a command to execute directly,
    with the rest of the arguments as its arguments.

  2. $ macro-name [args]
    Execute the macro macro-name that was defined with the macdef com‐
    mand. Arguments are passed to the macro unglobbed.

  3. account [passwd]
    Supply a supplemental password required by a remote system for ac‐
    cess to resources once a login has been successfully completed. If
    no argument is included, the user will be prompted for an account
    password in a non-echoing input mode.

  4. append local-file [remote-file]
    Append a local file to a file on the remote machine. If remote-file
    is left unspecified, the local file name is used in naming the re‐
    mote file after being altered by any ntrans or nmap setting. File
    transfer uses the current settings for type, format, mode, and
    structure.

  5. ascii Set the file transfer type to network ASCII. This is the default
    type.

  6. bell Arrange that a bell be sounded after each file transfer command is
    completed.

  7. binary Set the file transfer type to support binary image transfer.

  8. bye Terminate the FTP session with the remote server and exit tnftp. An
    end of file will also terminate the session and exit.

  9. case Toggle remote computer file name case mapping during get, mget and
    mput commands. When case is on (default is off), remote computer
    file names with all letters in upper case are written in the local
    directory with the letters mapped to lower case.

  10. cd remote-directory
    Change the working directory on the remote machine to
    remote-directory.

  11. cdup Change the remote machine working directory to the parent of the
    current remote machine working directory.

  12. chmod mode remote-file
    Change the permission modes of the file remote-file on the remote
    system to mode.

  13. close Terminate the FTP session with the remote server, and return to the
    command interpreter. Any defined macros are erased.

  14. cr Toggle carriage return stripping during ascii type file retrieval.
    Records are denoted by a carriage return/linefeed sequence during
    ascii type file transfer. When cr is on (the default), carriage re‐
    turns are stripped from this sequence to conform with the UNIX sin‐
    gle linefeed record delimiter. Records on non-UNIX remote systems
    may contain single linefeeds; when an ascii type transfer is made,
    these linefeeds may be distinguished from a record delimiter only
    when cr is off.

  15. debug [debug-value]
    Toggle debugging mode. If an optional debug-value is specified it
    is used to set the debugging level. When debugging is on, tnftp
    prints each command sent to the remote machine, preceded by the
    string ‘–>’.

  16. delete remote-file
    Delete the file remote-file on the remote machine.

  17. dir [remote-path [local-file]]
    Print a listing of the contents of a directory on the remote ma‐
    chine. The listing includes any system-dependent information that
    the server chooses to include; for example, most UNIX systems will
    produce output from the command ‘ls -l’. If remote-path is left un‐
    specified, the current working directory is used. If interactive
    prompting is on, tnftp will prompt the user to verify that the last
    argument is indeed the target local file for receiving dir output.
    If no local file is specified, or if local-file is ‘-’, the output
    is sent to the terminal.

  18. disconnect A synonym for close.

  19. edit Toggle command line editing, and context sensitive command and file
    completion. This is automatically enabled if input is from a termi‐
    nal, and disabled otherwise.

  20. epsv, epsv4, epsv6
    Toggle the use of the extended EPSV and EPRT commands on all IP,
    IPv4, and IPv6 connections respectively. First try EPSV/EPRT, and
    then PASV/PORT. This is enabled by default. If an extended command
    fails then this option will be temporarily disabled for the duration
    of the current connection, or until epsv, epsv4, or epsv6 is exe‐
    cuted again.

  21. exit A synonym for bye.

  22. features Display what features the remote server supports (using the FEAT
    command).

  23. fget localfile
    Retrieve the files listed in localfile, which has one line per file‐
    name.

  24. form format
    Set the file transfer form to format. The default (and only sup‐
    ported) format is “non-print”.

  25. ftp host [port]
    A synonym for open.

  26. gate [host [port]]
    Toggle gate-ftp mode, which used to connect through the TIS FWTK and
    Gauntlet FTP proxies. This will not be permitted if the gate-ftp
    server hasn’t been set (either explicitly by the user, or from the
    FTPSERVER environment variable). If host is given, then gate-ftp
    mode will be enabled, and the gate-ftp server will be set to host.
    If port is also given, that will be used as the port to connect to
    on the gate-ftp server.

  27. get remote-file [local-file]
    Retrieve the remote-file and store it on the local machine. If the
    local file name is not specified, it is given the same name it has
    on the remote machine, subject to alteration by the current case,
    ntrans, and nmap settings. The current settings for type, form,
    mode, and structure are used while transferring the file.

  28. glob Toggle filename expansion for mdelete, mget, mput, and mreget. If
    globbing is turned off with glob, the file name arguments are taken
    literally and not expanded. Globbing for mput is done as in csh(1).
    For mdelete, mget, and mreget, each remote file name is expanded
    separately on the remote machine and the lists are not merged. Ex‐
    pansion of a directory name is likely to be different from expansion
    of the name of an ordinary file: the exact result depends on the
    foreign operating system and FTP server, and can be previewed by do‐
    ing ‘mls remote-files -’. Note: mget, mput and mreget are not meant
    to transfer entire directory subtrees of files. That can be done by
    transferring a tar(1) archive of the subtree (in binary mode).

  29. hash [size]
    Toggle hash-sign (‘#’) printing for each data block transferred.
    The size of a data block defaults to 1024 bytes. This can be
    changed by specifying size in bytes. Enabling hash disables
    progress.

  30. help [command]
    Print an informative message about the meaning of command. If no
    argument is given, tnftp prints a list of the known commands.

  31. idle [seconds]
    Set the inactivity timer on the remote server to seconds seconds.
    If seconds is omitted, the current inactivity timer is printed.

  32. image A synonym for binary.

  33. lcd [directory]
    Change the working directory on the local machine. If no directory
    is specified, the user’s home directory is used.

  34. less file A synonym for page.

  35. lpage local-file
    Display local-file with the program specified by the set pager op‐
    tion.

  36. lpwd Print the working directory on the local machine.

  37. ls [remote-path [local-file]]
    A synonym for dir.

  38. macdef macro-name
    Define a macro. Subsequent lines are stored as the macro
    macro-name; a null line (consecutive newline characters in a file or
    carriage returns from the terminal) terminates macro input mode.
    There is a limit of 16 macros and 4096 total characters in all de‐
    fined macros. Macro names can be a maximum of 8 characters. Macros
    are only applicable to the current session they are defined within
    (or if defined outside a session, to the session invoked with the
    next open command), and remain defined until a close command is exe‐
    cuted. To invoke a macro, use the $ command (see above).

             The macro processor interprets ‘$’ and ‘\’ as special characters.  A
             ‘$’ followed by a number (or numbers) is replaced by the correspond‐
             ing argument on the macro invocation command line.  A ‘$’ followed
             by an ‘i’ signals the macro processor that the executing macro is to
             be looped.  On the first pass ‘$i’ is replaced by the first argument
             on the macro invocation command line, on the second pass it is re‐
             placed by the second argument, and so on.  A ‘\’ followed by any
             character is replaced by that character.  Use the ‘\’ to prevent
             special treatment of the ‘$’.
    
  39. mdelete [remote-files]
    Delete the remote-files on the remote machine.

  40. mdir remote-files local-file
    Like dir, except multiple remote files may be specified. If inter‐
    active prompting is on, tnftp will prompt the user to verify that
    the last argument is indeed the target local file for receiving mdir
    output.

  41. mget remote-files
    Expand the remote-files on the remote machine and do a get for each
    file name thus produced. See glob for details on the filename ex‐
    pansion. Resulting file names will then be processed according to
    case, ntrans, and nmap settings. Files are transferred into the lo‐
    cal working directory, which can be changed with ‘lcd directory’;
    new local directories can be created with ‘! mkdir directory’.

  42. mkdir directory-name
    Make a directory on the remote machine.

  43. mls remote-files local-file
    Like ls, except multiple remote files may be specified, and the
    local-file must be specified. If interactive prompting is on, tnftp
    will prompt the user to verify that the last argument is indeed the
    target local file for receiving mls output.

  44. mlsd [remote-path]
    Display the contents of remote-path (which should default to the
    current directory if not given) in a machine-parsable form, using
    MLSD. The format of display can be changed with ‘remopts mlst …’.

  45. mlst [remote-path]
    Display the details about remote-path (which should default to the
    current directory if not given) in a machine-parsable form, using
    MLST. The format of display can be changed with ‘remopts mlst …’.

  46. mode mode-name
    Set the file transfer mode to mode-name. The default (and only sup‐
    ported) mode is “stream”.

  47. modtime remote-file
    Show the last modification time of the file on the remote machine,
    in RFC 2822 format.

  48. more file A synonym for page.

  49. mput local-files
    Expand wild cards in the list of local files given as arguments and
    do a put for each file in the resulting list. See glob for details
    of filename expansion. Resulting file names will then be processed
    according to ntrans and nmap settings.

  50. mreget remote-files
    As per mget, but performs a reget instead of get.

  51. msend local-files
    A synonym for mput.

  52. newer remote-file [local-file]
    Get the file only if the modification time of the remote file is
    more recent that the file on the current system. If the file does
    not exist on the current system, the remote file is considered
    newer. Otherwise, this command is identical to get.

  53. nlist [remote-path [local-file]]
    A synonym for ls.

  54. nmap [inpattern outpattern]
    Set or unset the filename mapping mechanism. If no arguments are
    specified, the filename mapping mechanism is unset. If arguments
    are specified, remote filenames are mapped during mput commands and
    put commands issued without a specified remote target filename. If
    arguments are specified, local filenames are mapped during mget com‐
    mands and get commands issued without a specified local target file‐
    name. This command is useful when connecting to a non-UNIX remote
    computer with different file naming conventions or practices. The
    mapping follows the pattern set by inpattern and outpattern.

             inpattern is a template for incoming filenames (which may have al‐
             ready been processed according to the ntrans and case settings).
             Variable templating is accomplished by including the sequences ‘$1’,
             ‘$2’, ..., ‘$9’ in inpattern.  Use ‘\’ to prevent this special
             treatment of the ‘$’ character.  All other characters are treated
             literally, and are used to determine the nmap [inpattern] variable
             values.  For example, given inpattern ‘$1.$2’ and the remote file
             name ‘mydata.data’, ‘$1’ would have the value ‘mydata’, and ‘$2’
             would have the value ‘data’.
    
             The outpattern determines the resulting mapped filename.  The se‐
             quences ‘$1’, ‘$2’, ..., ‘$9’ are replaced by any value resulting
             from the inpattern template.  The sequence ‘$0’ is replaced by the
             original filename.  Additionally, the sequence “[seq1, seq2]” is re‐
             placed by seq1 if seq1 is not a null string; otherwise it is re‐
             placed by seq2.  For example, the command
    
                   nmap $1.$2.$3 [$1,$2].[$2,file]
    
             would yield the output filename ‘myfile.data’ for input filenames
             ‘myfile.data’ and ‘myfile.data.old’, ‘myfile.file’ for the input
             filename ‘myfile’, and ‘myfile.myfile’ for the input filename
             ‘.myfile’.  Spaces may be included in outpattern, as in the example:
    
                   nmap $1 sed s/  *$// > $1
    
             Use the ‘\’ character to prevent special treatment of the ‘$’, ‘[’,‘]’, and ‘,’ characters.
    
  55. ntrans [inchars [outchars]]
    Set or unset the filename character translation mechanism. If no
    arguments are specified, the filename character translation mecha‐
    nism is unset. If arguments are specified, characters in remote
    filenames are translated during mput commands and put commands is‐
    sued without a specified remote target filename. If arguments are
    specified, characters in local filenames are translated during mget
    commands and get commands issued without a specified local target
    filename. This command is useful when connecting to a non-UNIX re‐
    mote computer with different file naming conventions or practices.
    Characters in a filename matching a character in inchars are re‐
    placed with the corresponding character in outchars. If the charac‐
    ter’s position in inchars is longer than the length of outchars, the
    character is deleted from the file name.

  56. open host [port]
    Establish a connection to the specified host FTP server. An op‐
    tional port number may be supplied, in which case, tnftp will at‐
    tempt to contact an FTP server at that port. If the set auto-login
    option is on (default), tnftp will also attempt to automatically log
    the user in to the FTP server (see below).

  57. page file Retrieve file and display with the program specified by the set
    pager option.

  58. passive [auto]
    Toggle passive mode (if no arguments are given). If auto is given,
    act as if FTPMODE is set to ‘auto’. If passive mode is turned on
    (default), tnftp will send a PASV command for all data connections
    instead of a PORT command. The PASV command requests that the re‐
    mote server open a port for the data connection and return the ad‐
    dress of that port. The remote server listens on that port and the
    client connects to it. When using the more traditional PORT com‐
    mand, the client listens on a port and sends that address to the re‐
    mote server, who connects back to it. Passive mode is useful when
    using tnftp through a gateway router or host that controls the di‐
    rectionality of traffic. (Note that though FTP servers are required
    to support the PASV command by RFC 1123, some do not.)

  59. pdir [remote-path]
    Perform dir [remote-path], and display the result with the program
    specified by the set pager option.

  60. pls [remote-path]
    Perform ls [remote-path], and display the result with the program
    specified by the set pager option.

  61. pmlsd [remote-path]
    Perform mlsd [remote-path], and display the result with the program
    specified by the set pager option.

  62. preserve Toggle preservation of modification times on retrieved files.

  63. progress Toggle display of transfer progress bar. The progress bar will be
    disabled for a transfer that has local-file as ‘-’ or a command that
    starts with ‘|’. Refer to FILE NAMING CONVENTIONS for more informa‐
    tion. Enabling progress disables hash.

  64. prompt Toggle interactive prompting. Interactive prompting occurs during
    multiple file transfers to allow the user to selectively retrieve or
    store files. If prompting is turned off (default is on), any mget
    or mput will transfer all files, and any mdelete will delete all
    files.

             When prompting is on, the following commands are available at a
             prompt:
    
                   a   Answer ‘yes’ to the current file, and automatically answer
                       ‘yes’ to any remaining files for the current command.
    
                   n   Answer ‘no’, and do not transfer the file.
    
                   p   Answer ‘yes’ to the current file, and turn off prompt mode
                       (as is “prompt off” had been given).
    
                   q   Terminate the current operation.
    
                   y   Answer ‘yes’, and transfer the file.
    
                   ?   Display a help message.
    
             Any other response will answer ‘yes’ to the current file.
    
  65. proxy ftp-command
    Execute an FTP command on a secondary control connection. This com‐
    mand allows simultaneous connection to two remote FTP servers for
    transferring files between the two servers. The first proxy command
    should be an open, to establish the secondary control connection.
    Enter the command ‘proxy ?’ to see other FTP commands executable on
    the secondary connection. The following commands behave differently
    when prefaced by proxy: open will not define new macros during the
    auto-login process, close will not erase existing macro definitions,
    get and mget transfer files from the host on the primary control
    connection to the host on the secondary control connection, and put,
    mput, and append transfer files from the host on the secondary con‐
    trol connection to the host on the primary control connection.
    Third party file transfers depend upon support of the FTP protocol
    PASV command by the server on the secondary control connection.

  66. put local-file [remote-file]
    Store a local file on the remote machine. If remote-file is left
    unspecified, the local file name is used after processing according
    to any ntrans or nmap settings in naming the remote file. File
    transfer uses the current settings for type, format, mode, and
    structure.

  67. pwd Print the name of the current working directory on the remote ma‐
    chine.

  68. quit A synonym for bye.

  69. quote [arg …]
    The arguments specified are sent, verbatim, to the remote FTP
    server.

  70. rate direction [maximum [increment]]
    Throttle the maximum transfer rate to maximum bytes/second. If
    maximum is 0, disable the throttle.

    direction may be one of:
          all  Both directions.
          get  Incoming transfers.
          put  Outgoing transfers.
    
    maximum can be modified on the fly by increment bytes (default:
    1024) each time a given signal is received:
    
          SIGUSR1  Increment maximum by increment bytes.
    
          SIGUSR2  Decrement maximum by increment bytes.  The result
                   must be a positive number.
    
    If maximum is not supplied, the current throttle rates are dis‐
    played.
    
    Note: rate is not yet implemented for ascii mode transfers.
    
  71. rcvbuf size
    Set the size of the socket receive buffer to size.

  72. recv remote-file [local-file]
    A synonym for get.

  73. reget remote-file [local-file]
    reget acts like get, except that if local-file exists and is smaller
    than remote-file, local-file is presumed to be a partially trans‐
    ferred copy of remote-file and the transfer is continued from the
    apparent point of failure. This command is useful when transferring
    very large files over networks that are prone to dropping connec‐
    tions.

  74. remopts command [command-options]
    Set options on the remote FTP server for command to command-options
    (whose absence is handled on a command-specific basis). Remote FTP
    commands known to support options include: MLST (used for MLSD and
    MLST).

  75. rename [from [to]]
    Rename the file from on the remote machine, to the file to.

  76. reset Clear reply queue. This command re-synchronizes command/reply se‐
    quencing with the remote FTP server. Resynchronization may be nec‐
    essary following a violation of the FTP protocol by the remote
    server.

  77. restart marker
    Restart the immediately following get or put at the indicated
    marker. On UNIX systems, marker is usually a byte offset into the
    file.

  78. rhelp [command-name]
    Request help from the remote FTP server. If a command-name is spec‐
    ified it is supplied to the server as well.

  79. rmdir directory-name
    Delete a directory on the remote machine.

  80. rstatus [remote-file]
    With no arguments, show status of remote machine. If remote-file is
    specified, show status of remote-file on remote machine.

  81. runique Toggle storing of files on the local system with unique filenames.
    If a file already exists with a name equal to the target local file‐
    name for a get or mget command, a ‘.1’ is appended to the name. If
    the resulting name matches another existing file, a ‘.2’ is appended
    to the original name. If this process continues up to ‘.99’, an er‐
    ror message is printed, and the transfer does not take place. The
    generated unique filename will be reported. Note that runique will
    not affect local files generated from a shell command (see below).
    The default value is off.

  82. send local-file [remote-file]
    A synonym for put.

  83. sendport Toggle the use of PORT commands. By default, tnftp will attempt to
    use a PORT command when establishing a connection for each data
    transfer. The use of PORT commands can prevent delays when perform‐
    ing multiple file transfers. If the PORT command fails, tnftp will
    use the default data port. When the use of PORT commands is dis‐
    abled, no attempt will be made to use PORT commands for each data
    transfer. This is useful for certain FTP implementations which do
    ignore PORT commands but, incorrectly, indicate they’ve been ac‐
    cepted.

  84. set [option value]
    Set option to value. If option and value are not given, display all
    of the options and their values. The currently supported options
    are:

        anonpass     Defaults to $FTPANONPASS
    
        ftp_proxy    Defaults to $ftp_proxy.
    
        http_proxy   Defaults to $http_proxy.
    
        https_proxy  Defaults to $https_proxy.
    
        no_proxy     Defaults to $no_proxy.
    
        pager        Defaults to $PAGER.
    
        prompt       Defaults to $FTPPROMPT.
    
        rprompt      Defaults to $FTPRPROMPT.
    
  85. site [arg …]
    The arguments specified are sent, verbatim, to the remote FTP server
    as a SITE command.

  86. size remote-file
    Return size of remote-file on remote machine.

  87. sndbuf size
    Set the size of the socket send buffer to size.

  88. status Show the current status of tnftp.

  89. struct struct-name
    Set the file transfer structure to struct-name. The default (and
    only supported) structure is “file”.

  90. sunique Toggle storing of files on remote machine under unique file names.
    The remote FTP server must support FTP protocol STOU command for
    successful completion. The remote server will report unique name.
    Default value is off.

  91. system Show the type of operating system running on the remote machine.

  92. tenex Set the file transfer type to that needed to talk to TENEX machines.

  93. throttle A synonym for rate.

  94. trace Toggle packet tracing.

  95. type [type-name]
    Set the file transfer type to type-name. If no type is specified,
    the current type is printed. The default type is network ASCII.

  96. umask [newmask]
    Set the default umask on the remote server to newmask. If newmask
    is omitted, the current umask is printed.

  97. unset option
    Unset option. Refer to set for more information.

  98. usage command
    Print the usage message for command.

  99. user user-name [password [account]]
    Identify yourself to the remote FTP server. If the password is not
    specified and the server requires it, tnftp will prompt the user for
    it (after disabling local echo). If an account field is not speci‐
    fied, and the FTP server requires it, the user will be prompted for
    it. If an account field is specified, an account command will be
    relayed to the remote server after the login sequence is completed
    if the remote server did not require it for logging in. Unless
    tnftp is invoked with “auto-login” disabled, this process is done
    automatically on initial connection to the FTP server.

  100. verbose Toggle verbose mode. In verbose mode, all responses from the FTP
    server are displayed to the user. In addition, if verbose is on,
    when a file transfer completes, statistics regarding the efficiency
    of the transfer are reported. By default, verbose is on.

  101. xferbuf size
    Set the size of the socket send and receive buffers to size.

  102. ? [command]
    A synonym for help.


命令参数中包含嵌入空格的情况可以用引号""括起来。

切换设置的命令可以采用显式的on或off参数来适当地设置该设置。

需要字节计数作为参数的命令(例如,hash、rate和xferbuf)支持参数上的可选后缀,该后缀更改参数的解释。支持的后缀包括:
b 不进行修改。(可选)
k Kilo;将参数乘以1024
m Mega;将参数乘以1048576
g Giga;将参数乘以1073741824

如果tnftp在传输正在进行时接收到SIGINFO(请参阅stty(1)status参数)或SIGQUIT信号,当前传输速率统计信息将被写入标准错误输出,格式与标准完成消息相同。

3. AUTO-FETCHING FILES

除了标准命令之外,这个版本的tnftp还支持自动获取功能。要启用自动获取,只需在命令行上传递主机名/文件列表。

以下格式是自动获取元素的有效语法:

  1. [user@]host:[path][/]
    “Classic” FTP format.

    • 如果路径包含通配符并且启用了通配符(参见glob),则执行等效于‘mget path’的操作。
    • 如果路径的目录组件不包含通配符,则它将以path的basename(参见basename(1))的名称存储在当前目录中。否则,完整的远程名称将作为本地名称相对于本地根目录使用。
  2. ftp://[user[:password]@]host[:port]/path[/][;type=type]

    • 一个FTP URL,如果set ftp_proxy没有被定义,则使用FTP协议检索。否则,通过在set ftp_proxy中定义的代理使用HTTP传输URL。如果未定义set ftp_proxy并且提供了user,则以user登录。在这种情况下,如果提供了password,则使用password,否则提示用户输入password

    • 如果提供了;type=A;type=I后缀,则传输类型将按照ascii或binary(分别)进行。默认传输类型为binary。

    • 为了符合RFC 3986,tnftp解释ftp://auto-fetch URL的path部分按照如下:

      • host[:port]后面的/被解释为路径之前的分隔符,而不是路径本身的一部分。

      • path被解释为以/分隔的名称组件列表。对于除最后一个部分之外的所有部分,tnftp执行等效于cd命令。对于最后一个path部分,tnftp执行等效于get命令。

      • 空名称组件,即路径中的//导致的或路径开头的额外/导致的,将导致等效于没有目录名的cd命令。这不太可能有用。

      • 路径组件中的任何%XX代码(根据RFC 3986)都会被解码,其中XX表示十六进制字符代码。此解码在路径被拆分为部分之后,但在每个部分被用于等效于cd或get命令之前进行。一些常用的代码是%2F(代表‘/’)和%7E(代表‘~’)。

    上述解释有以下后果:

    • path将相对于指定用户的默认登录目录或anonymous用户的默认登录目录进行解释。如果需要根目录,使用%2F作为路径的开头。如果需要用户的主目录(并且远程服务器支持该语法),则使用%7Euser’作为路径的开头。
      例如,要从localhost检索/etc/motd,作为用户myname,密码为mypass,请使用ftp://myname:mypass@localhost/%2fetc/motd

    • 可以通过仔细选择在哪里使用/和在哪里使用%2F(或%2f)来控制确切的cd和get命令。例如,以下URL对应于所示命令的等效项:

    ftp://host/dir1/dir2/file         “cd dir1”, “cd dir2”, “get file”.
    
    ftp://host/%2Fdir1/dir2/file      “cd /dir1”, “cd dir2”, “get file”.
    
    ftp://host/dir1%2Fdir2/file       “cd dir1/dir2”, “get file”.
    
    ftp://host/%2Fdir1%2Fdir2/file    “cd /dir1/dir2”, “get file”.
    
    ftp://host/dir1%2Fdir2%2Ffile     “get dir1/dir2/file”.
    
    ftp://host/%2Fdir1%2Fdir2%2Ffile  “get /dir1/dir2/file”.
    
    • 您必须对在等效于cd命令中使用的每个中间目录具有适当的访问权限。
  3. http://[user[:password]@]host[:port]/path

    • 一个HTTP URL,使用HTTP协议进行检索。如果定义了set http_proxy,则将其用作HTTP代理服务器的URL。如果需要HTTP授权来检索path,并且URL中提供了user(以及可选的password),则将它们用于第一次尝试进行身份验证。
  4. https://[user[:password]@]host[:port]/path

    • 一个HTTPS URL,使用HTTPS协议检索。如果设置了https_proxy,则将其用作HTTPS代理服务器的URL。如果需要HTTPS授权来检索path,并且URL中提供了user(以及可选的password),则将它们用于第一次尝试进行身份验证。目前没有证书验证和验证。
  5. file:///path

    • 本地URL,从本地主机的/path目录复制而来。
  6. about:topic

    • 显示有关主题的信息;不会为此自动获取的元素检索文件。支持的值包括:
      about:ftp 关于tnftp的信息。
      about:version tnftp的版本。在报告问题时很有用。

除非在上面另有说明,并且未提供-o output,否则文件将存储在当前目录中,文件名为pathbasename(1)。请注意,如果接收到HTTP重定向,则会使用服务器提供的新目标URL进行重试,相应地使用新path。建议使用显式的 -o output,以避免写入意外的文件名。

如果经典格式或FTP URL格式有一个尾部的/或空路径组件,则tnftp将连接到该站点并cd到作为路径给出的目录,并将用户留在交互模式中准备接受进一步输入。如果正在使用 set ftp_proxy,则此方法不起作用。

直接的HTTP传输使用HTTP 1.1。代理FTP和HTTP传输使用HTTP 1.0。

如果指定了 -R,则所有不通过FTP或HTTP代理进行的自动获取将重新启动。对于FTP,这是通过使用reget而不是get来实现的。对于HTTP,这是通过使用Range: bytes= HTTP/1.1指令来实现的。

如果需要WWW或代理WWW身份验证,将提示您输入用户名和密码进行身份验证。

在URL中指定IPv6数字地址时,需要将地址用方括号括起来。例如:ftp://[::1]:21/。这是因为冒号在IPv6数字地址中也被用作端口号的分隔符。

4. ABORTING A FILE TRANSFER

要中止文件传输,使用终端中断键(通常是Ctrl-C)。发送传输将立即停止。接收传输将通过向远程服务器发送FTP协议的ABOR命令来停止,并丢弃任何进一步接收的数据。完成此操作的速度取决于远程服务器对ABOR处理的支持程度。如果远程服务器不支持ABOR命令,则在远程服务器完成发送请求的文件之前,不会出现提示。

如果在tnftp等待远程服务器对ABOR处理的答复时使用终端中断键(通常是Ctrl-C),则连接将被关闭。这与传统行为不同(在此阶段忽略终端中断),但被认为更有用。

5. NAMING CONVENTIONS

指定为tnftp命令的参数的文件根据以下规则进行处理。

  1. 如果指定了文件名-,则使用stdin(用于读取)或stdout(用于写入)。

  2. 如果文件名的第一个字符是|,则将参数的其余部分解释为shell命令。然后,tnftp fork一个shell,使用**popen(3)**和提供的参数,并从stdout(stdin)读取(写入)。如果shell命令包含空格,则参数必须用引号括起来;例如 "| ls -lt"。这种机制的一个特别有用的示例是:dir "" |more

  3. 如果上述检查失败,并且启用了globbing,则根据csh(1)中使用的规则扩展本地文件名;参见glob命令。如果tnftp命令期望单个本地文件(例如put),则只使用通配符操作生成的第一个文件名。

  4. 对于mget命令和未指定本地文件名的get命令,本地文件名是远程文件名,可以通过casentransnmap设置进行更改。然后,如果runique打开,则可以更改生成的文件名。

  5. 对于mput命令和未指定远程文件名的put命令,远程文件名是本地文件名,可以通过ntrans或nmap设置进行更改。然后,如果sunique打开,则可以通过远程服务器更改生成的文件名。

6. FILE TRANSFER PARAMETERS

FTP规范指定了许多可能影响文件传输的参数。类型可以是“ascii”,“image”(二进制),“ebcdic”和“local byte size”(主要用于PDP-10和PDP-20)。tnftp支持ascii和image类型的文件传输,以及本地字节大小为8的tenex模式传输。

tnftp仅支持剩余文件传输参数的默认值:mode,form和struct。

7. THE .netrc FILE

.netrc文件包含自动登录过程使用的登录和初始化信息。它位于用户的主目录中,除非使用了 -N netrc 选项进行覆盖,或者在NETRC环境变量中指定。以下token被识别;它们可以用空格、制表符或换行符分隔:

  • machine name:标识远程主机名。自动登录过程在 .netrc 文件中搜索与在tnftp命令行上指定的远程主机匹配的machine token,或作为open命令参数指定。一旦匹配成功,后续的 .netrc 标记就会被处理,直到到达文件末尾或遇到另一个machinedefault token为止。

  • default:与 machine name 相同,只是 default 匹配任何名称。只能有一个default token,并且必须在所有machine token之后。通常用法是:

    default login anonymous password user@site
    
    

    从而使用户可以自动匿名登录到未在 .netrc 中指定的机器上。这可以通过使用 -n 标志来禁用自动登录来覆盖。

  • login name:标识远程机器上的用户。如果此标记存在,则自动登录过程将使用指定的name启动登录。

  • password string:提供一个密码。如果此标记存在,则在远程服务器要求密码作为登录过程的一部分时,自动登录过程将提供指定的字符串。请注意,如果此标记出现在 .netrc 文件中的任何非匿名用户中,而且有除此用户之外的任何人可读取 .netrc 文件,则tnftp将中止自动登录过程。

  • account string:提供额外的账户密码。如果此标记存在,则在远程服务器需要额外的账户密码时,自动登录过程将提供指定的字符串;如果不需要额外的账户密码,则自动登录过程将启动一个ACCT命令。

  • macdef name:定义一个宏。此标记的功能类似于tnftp的macdef命令功能。使用指定的名称定义一个宏;其内容从下一行开始,直到遇到空行(连续的换行符)。与 .netrc 文件中的其他标记一样,macdef仅适用于其前面的machine定义。一个macdef条目不能被多个机器定义使用;相反,它必须在每个要与之一起使用的machine后面进行定义。如果定义了一个名为init的宏,它将自动作为自动登录过程的最后一步执行。例如:

    default
    macdef init
    epsv4 off
    

    然后是一个空行。

8. COMMAND LINE EDITING

tnftp支持交互式命令行编辑,通过 editline(3) 库实现。它通过edit命令启用,并且如果输入来自tty,则默认启用。可以使用箭头键回溯和编辑先前的行,也可以使用其他GNU Emacs风格的编辑键。

editline(3)库通过.editrc文件进行配置 - 有关更多信息,请参阅editrc(5)。

tnftp提供了一个额外的键绑定,用于提供上下文敏感的命令和文件名补全(包括远程文件补全)。要使用这个功能,将一个键绑定到editline(3)命令ftp-complete。默认情况下,这个绑定是到TAB键。

9. COMMAND LINE PROMPT

默认情况下,tnftp向用户显示一个命令行提示符ftp> 。可以使用set prompt命令来更改它。

可以使用set rprompt命令在屏幕右侧(在命令输入后)显示提示符。

以下格式化序列将被给定的信息替换:

  • %/:当前远程工作目录。
  • %c[[0]n]%.[[0]n]:当前远程工作目录的尾部部分,或者如果给定了数字n,则为n个尾部部分。如果n以‘0’开头,则省略的部分数将在格式/<number>trailing中出现(对于%c)或...trailing(对于%.)。
  • %M:远程主机名。
  • %m:远程主机名,直到第一个点‘.’。
  • %n:远程用户名。
  • %%:一个百分号字符‘%’。

10. ENVIRONMENT

tnftp使用以下环境变量。

  • FTPANONPASS:在匿名FTP传输中发送的密码。默认为 “`whoami@`”

  • FTPMODE:覆盖默认操作模式。支持的值有:

    • active:仅使用主动模式FTP
    • auto:自动确定是被动模式还是主动模式(默认值)
    • gate:gate-ftp模式
    • passive:仅使用被动模式FTP
  • FTPPROMPT:要使用的命令行提示符。默认为‘ftp> ’。有关更多信息,请参阅COMMAND LINE PROMPT

  • FTPRPROMPT:要使用的命令行右侧提示符。默认为空字符串。有关更多信息,请参阅COMMAND LINE PROMPT

  • FTPSERVER:在gate启用时用作gate-ftp服务器的主机。

  • FTPSERVERPORT:在启用gate时连接到gate-ftp服务器时要使用的端口。默认值是通过 getservbyname(3) 查找"ftpgate/tcp"返回的端口。

  • FTPUSERAGENT:发送到HTTP User-Agent头的值。

  • HOME:用于默认的.netrc文件位置(如果存在)。

  • NETRC:.netrc文件的替代位置。

  • PAGER:用于各种命令显示文件。如果为空或未设置,则默认为more(1)。

  • SHELL:默认的shell。

  • ftp_proxy:在进行FTP URL请求时使用的FTP代理的URL(如果未定义,则使用标准的FTP协议)。

  • http_proxy:在进行HTTP URL请求时使用的HTTP代理的URL。如果需要代理身份验证,并且在此URL中有用户名和密码,则它们将自动用于第一次尝试对代理进行身份验证。如果用户名或密码中需要“不安全”的URL字符(例如‘@’或‘/’),请使用RFC 3986的‘%XX’编码进行编码。请注意,在ftp_proxy和http_proxy中使用用户名和密码可能与其他使用它的程序(如lynx(1))不兼容。注意:这不适用于交互式会话,仅适用于命令行获取。

  • https_proxy:在进行HTTPS URL请求时使用的HTTPS代理的URL。有关代理使用的进一步说明,请参阅http_proxy。

  • no_proxy:一个用空格或逗号分隔的主机(或域)列表,表示它们不希望使用代理。每个条目可能具有可选的尾部:port,用于将匹配限制为对该端口的连接。

11. EXTENDED PASSIVE MODE AND FIREWALLS

某些防火墙配置不允许tnftp使用扩展被动模式。
如果你发现即使是一个简单的ls命令打印了类似下面这样的消息后似乎挂起了:

229 Entering Extended Passive Mode (|||58551|)

那么你需要使用epsv4 off命令来禁用扩展被动模式。
请参阅上面的The .netrc File部分,了解如何使这个操作自动化。

12. SEE ALSO

 getservbyname(3), editrc(5), services(5), ftpd(8)

13. STANDARDS

tnftp attempts to be compliant with:

RFC 959   File Transfer Protocol

RFC 1123  Requirements for Internet Hosts - Application and Support

RFC 1635  How to Use Anonymous FTP

RFC 2389  Feature negotiation mechanism for the File Transfer Protocol

RFC 2428  FTP Extensions for IPv6 and NATs

RFC 2616  Hypertext Transfer Protocol -- HTTP/1.1

RFC 2822  Internet Message Format

RFC 3659  Extensions to FTP

RFC 3986  Uniform Resource Identifier (URI)

14. HISTORY

 The tnftp command appeared in 4.2BSD.

 Various features such as command line editing, context sensitive command and
 file completion, dynamic progress bar, automatic fetching of files and URLs,
 modification time preservation, transfer rate throttling, configurable command
 line prompt, and other enhancements over the standard BSD tnftp were implemented
 in NetBSD 1.3 and later releases by Luke Mewburn ⟨[email protected]⟩.

 IPv6 support was added by the WIDE/KAME project (but may not be present in all
 non-NetBSD versions of this program, depending if the operating system supports
 IPv6 in a similar manner to KAME).

15. BUGS

 Correct execution of many commands depends upon proper behavior by the remote
 server.

 An error in the treatment of carriage returns in the 4.2BSD ascii-mode transfer
 code has been corrected.  This correction may result in incorrect transfers of
 binary files to and from 4.2BSD servers using the ascii type.  Avoid this prob‐
 lem by using the binary image type.

 tnftp assumes that all IPv4 mapped addresses (IPv6 addresses with a form like
 ::ffff:10.1.1.1) indicate IPv4 destinations which can be handled by AF_INET
 sockets.  However, in certain IPv6 network configurations, this assumption is
 not true.  In such an environment, IPv4 mapped addresses must be passed to
 AF_INET6 sockets directly.  For example, if your site uses a SIIT translator for
 IPv6-to-IPv4 translation, tnftp is unable to support your configuration.

BSD April 25, 2021 BSD

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_51470638/article/details/137849594

智能推荐

攻防世界_难度8_happy_puzzle_攻防世界困难模式攻略图文-程序员宅基地

文章浏览阅读645次。这个肯定是末尾的IDAT了,因为IDAT必须要满了才会开始一下个IDAT,这个明显就是末尾的IDAT了。,对应下面的create_head()代码。,对应下面的create_tail()代码。不要考虑爆破,我已经试了一下,太多情况了。题目来源:UNCTF。_攻防世界困难模式攻略图文

达梦数据库的导出(备份)、导入_达梦数据库导入导出-程序员宅基地

文章浏览阅读2.9k次,点赞3次,收藏10次。偶尔会用到,记录、分享。1. 数据库导出1.1 切换到dmdba用户su - dmdba1.2 进入达梦数据库安装路径的bin目录,执行导库操作  导出语句:./dexp cwy_init/[email protected]:5236 file=cwy_init.dmp log=cwy_init_exp.log 注释:   cwy_init/init_123..._达梦数据库导入导出

js引入kindeditor富文本编辑器的使用_kindeditor.js-程序员宅基地

文章浏览阅读1.9k次。1. 在官网上下载KindEditor文件,可以删掉不需要要到的jsp,asp,asp.net和php文件夹。接着把文件夹放到项目文件目录下。2. 修改html文件,在页面引入js文件:<script type="text/javascript" src="./kindeditor/kindeditor-all.js"></script><script type="text/javascript" src="./kindeditor/lang/zh-CN.js"_kindeditor.js

STM32学习过程记录11——基于STM32G431CBU6硬件SPI+DMA的高效WS2812B控制方法-程序员宅基地

文章浏览阅读2.3k次,点赞6次,收藏14次。SPI的详情简介不必赘述。假设我们通过SPI发送0xAA,我们的数据线就会变为10101010,通过修改不同的内容,即可修改SPI中0和1的持续时间。比如0xF0即为前半周期为高电平,后半周期为低电平的状态。在SPI的通信模式中,CPHA配置会影响该实验,下图展示了不同采样位置的SPI时序图[1]。CPOL = 0,CPHA = 1:CLK空闲状态 = 低电平,数据在下降沿采样,并在上升沿移出CPOL = 0,CPHA = 0:CLK空闲状态 = 低电平,数据在上升沿采样,并在下降沿移出。_stm32g431cbu6

计算机网络-数据链路层_接收方收到链路层数据后,使用crc检验后,余数为0,说明链路层的传输时可靠传输-程序员宅基地

文章浏览阅读1.2k次,点赞2次,收藏8次。数据链路层习题自测问题1.数据链路(即逻辑链路)与链路(即物理链路)有何区别?“电路接通了”与”数据链路接通了”的区别何在?2.数据链路层中的链路控制包括哪些功能?试讨论数据链路层做成可靠的链路层有哪些优点和缺点。3.网络适配器的作用是什么?网络适配器工作在哪一层?4.数据链路层的三个基本问题(帧定界、透明传输和差错检测)为什么都必须加以解决?5.如果在数据链路层不进行帧定界,会发生什么问题?6.PPP协议的主要特点是什么?为什么PPP不使用帧的编号?PPP适用于什么情况?为什么PPP协议不_接收方收到链路层数据后,使用crc检验后,余数为0,说明链路层的传输时可靠传输

软件测试工程师移民加拿大_无证移民,未受过软件工程师的教育(第1部分)-程序员宅基地

文章浏览阅读587次。软件测试工程师移民加拿大 无证移民,未受过软件工程师的教育(第1部分) (Undocumented Immigrant With No Education to Software Engineer(Part 1))Before I start, I want you to please bear with me on the way I write, I have very little gen...

随便推点

Thinkpad X250 secure boot failed 启动失败问题解决_安装完系统提示secureboot failure-程序员宅基地

文章浏览阅读304次。Thinkpad X250笔记本电脑,装的是FreeBSD,进入BIOS修改虚拟化配置(其后可能是误设置了安全开机),保存退出后系统无法启动,显示:secure boot failed ,把自己惊出一身冷汗,因为这台笔记本刚好还没开始做备份.....根据错误提示,到bios里面去找相关配置,在Security里面找到了Secure Boot选项,发现果然被设置为Enabled,将其修改为Disabled ,再开机,终于正常启动了。_安装完系统提示secureboot failure

C++如何做字符串分割(5种方法)_c++ 字符串分割-程序员宅基地

文章浏览阅读10w+次,点赞93次,收藏352次。1、用strtok函数进行字符串分割原型: char *strtok(char *str, const char *delim);功能:分解字符串为一组字符串。参数说明:str为要分解的字符串,delim为分隔符字符串。返回值:从str开头开始的一个个被分割的串。当没有被分割的串时则返回NULL。其它:strtok函数线程不安全,可以使用strtok_r替代。示例://借助strtok实现split#include <string.h>#include <stdio.h&_c++ 字符串分割

2013第四届蓝桥杯 C/C++本科A组 真题答案解析_2013年第四届c a组蓝桥杯省赛真题解答-程序员宅基地

文章浏览阅读2.3k次。1 .高斯日记 大数学家高斯有个好习惯:无论如何都要记日记。他的日记有个与众不同的地方,他从不注明年月日,而是用一个整数代替,比如:4210后来人们知道,那个整数就是日期,它表示那一天是高斯出生后的第几天。这或许也是个好习惯,它时时刻刻提醒着主人:日子又过去一天,还有多少时光可以用于浪费呢?高斯出生于:1777年4月30日。在高斯发现的一个重要定理的日记_2013年第四届c a组蓝桥杯省赛真题解答

基于供需算法优化的核极限学习机(KELM)分类算法-程序员宅基地

文章浏览阅读851次,点赞17次,收藏22次。摘要:本文利用供需算法对核极限学习机(KELM)进行优化,并用于分类。

metasploitable2渗透测试_metasploitable2怎么进入-程序员宅基地

文章浏览阅读1.1k次。一、系统弱密码登录1、在kali上执行命令行telnet 192.168.26.1292、Login和password都输入msfadmin3、登录成功,进入系统4、测试如下:二、MySQL弱密码登录:1、在kali上执行mysql –h 192.168.26.129 –u root2、登录成功,进入MySQL系统3、测试效果:三、PostgreSQL弱密码登录1、在Kali上执行psql -h 192.168.26.129 –U post..._metasploitable2怎么进入

Python学习之路:从入门到精通的指南_python人工智能开发从入门到精通pdf-程序员宅基地

文章浏览阅读257次。本文将为初学者提供Python学习的详细指南,从Python的历史、基础语法和数据类型到面向对象编程、模块和库的使用。通过本文,您将能够掌握Python编程的核心概念,为今后的编程学习和实践打下坚实基础。_python人工智能开发从入门到精通pdf

推荐文章

热门文章

相关标签