{
    "mode": "man",
    "parameter": "ftp",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/ftp/1/json",
    "generated": "2026-11-07T17:17:18Z",
    "synopsis": "tnftp  [-46AadefginpRtVv?]  [-N  netrc]  [-o  output]  [-P  port]  [-q  quittime]  [-r retry]\n[-s     srcaddr]     [-T dir,max[,inc]]     [-x     xfersize]      [[user@]host [port]]\n[[user@]host:[path][/]]                                                  [file:///path]\n[ftp://[user[:password]@]host[:port]/path[/][;type=type]]\n[http://[user[:password]@]host[:port]/path]\n[https://[user[:password]@]host[:port]/path] ...\ntnftp -u url file ...",
    "sections": {
        "NAME": {
            "content": "tnftp — Internet file transfer program\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "tnftp  [-46AadefginpRtVv?]  [-N  netrc]  [-o  output]  [-P  port]  [-q  quittime]  [-r retry]\n[-s     srcaddr]     [-T dir,max[,inc]]     [-x     xfersize]      [[user@]host [port]]\n[[user@]host:[path][/]]                                                  [file:///path]\n[ftp://[user[:password]@]host[:port]/path[/][;type=type]]\n[http://[user[:password]@]host[:port]/path]\n[https://[user[:password]@]host[:port]/path] ...\ntnftp -u url file ...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "tnftp is the user interface to the Internet standard File Transfer Protocol.  The program al‐\nlows a user to transfer files to and from a remote network site.\n\nThe last five arguments will fetch a file using the FTP or HTTP protocols, or by direct copy‐\ning, into the current directory.  This is ideal for scripts.  Refer to “AUTO-FETCHING  FILES”\nbelow for more information.\n\nOptions may be specified at the command line, or to the command interpreter.\n",
            "subsections": [
                {
                    "name": "-4",
                    "content": "",
                    "flag": "-4"
                },
                {
                    "name": "-6",
                    "content": "",
                    "flag": "-6"
                },
                {
                    "name": "-A",
                    "content": "fall back to active mode if passive is not supported by the server.  This  option\ncauses  tnftp to always use an active connection.  It is only useful for connect‐\ning to very old servers that do not implement passive mode properly.\n",
                    "flag": "-A"
                },
                {
                    "name": "-a",
                    "content": "stead.\n",
                    "flag": "-a"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-e",
                    "content": "",
                    "flag": "-e"
                },
                {
                    "name": "-f",
                    "content": "",
                    "flag": "-f"
                },
                {
                    "name": "-g",
                    "content": "",
                    "flag": "-g"
                },
                {
                    "name": "-i",
                    "content": "",
                    "flag": "-i"
                },
                {
                    "name": "-N _",
                    "content": "",
                    "flag": "-N"
                },
                {
                    "name": "-n",
                    "content": "auto-fetch transfers.  If auto-login is enabled, tnftp will check the .netrc (see\nbelow) file in the user's home directory for an entry describing  an  account  on\nthe remote machine.  If no entry exists, tnftp will prompt for the remote machine\nlogin  name  (default  is the user identity on the local machine), and, if neces‐\nsary, prompt for a password and an account with which to login.  To override  the\nauto-login  for  auto-fetch  transfers,  specify  the  username  (and optionally,\npassword) as appropriate.\n",
                    "flag": "-n"
                },
                {
                    "name": "-o _",
                    "content": "ing  to  the  “FILE  NAMING  CONVENTIONS” below.  If output is not ‘-’ or doesn't\nstart with ‘|’, then only the first file specified will be retrieved into output;\nall other files will be retrieved into the basename of their remote name.\n",
                    "flag": "-o"
                },
                {
                    "name": "-P _",
                    "content": "",
                    "flag": "-P"
                },
                {
                    "name": "-p",
                    "content": "This  option  has  been  deprecated as tnftp now tries to use passive mode by de‐\nfault, falling back to active mode if the server does not support passive connec‐\ntions.\n",
                    "flag": "-p"
                },
                {
                    "name": "-q _",
                    "content": "Quit if the connection has stalled for quittime seconds.\n",
                    "flag": "-q"
                },
                {
                    "name": "-R",
                    "content": "",
                    "flag": "-R"
                },
                {
                    "name": "-r _",
                    "content": "",
                    "flag": "-r"
                },
                {
                    "name": "-s _",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "-t",
                    "content": "",
                    "flag": "-t"
                },
                {
                    "name": "-T _",
                    "content": "Set the maximum transfer rate for direction to maximum bytes/second, and if spec‐\nified, the increment to increment bytes/second.  Refer to rate for more  informa‐\ntion.\n",
                    "flag": "-T"
                },
                {
                    "name": "-u _",
                    "content": "Upload  files  on  the  command  line to url where url is one of the ‘ftp://’ URL\ntypes as supported by auto-fetch (with an optional  target  filename  for  single\nfile uploads), and file is one or more local files to be uploaded.\n",
                    "flag": "-u"
                },
                {
                    "name": "-V",
                    "content": "a terminal.\n",
                    "flag": "-V"
                },
                {
                    "name": "-v",
                    "content": "in  the case of progress, tnftp is the foreground process).  Forces tnftp to show\nall responses from the remote server, as well as report on data transfer  statis‐\ntics.\n",
                    "flag": "-v"
                },
                {
                    "name": "-x _",
                    "content": "Set  the  size  of  the  socket  send  and receive buffers to xfersize.  Refer to\nxferbuf for more information.\n\n-?          Display help to stdout, and exit.\n\nThe client host with which tnftp is to communicate may be specified on the command line.   If\nthis  is  done,  tnftp will immediately attempt to establish a connection to an FTP server on\nthat host; otherwise, tnftp will enter its command interpreter and  await  instructions  from\nthe user.  When tnftp is awaiting commands from the user the prompt ‘ftp>’ is provided to the\nuser.  The following commands are recognized by tnftp:\n\n! [command [args]]\nInvoke  an  interactive  shell on the local machine.  If there are arguments, the\nfirst is taken to be a command to execute directly, with the rest  of  the  argu‐\nments as its arguments.\n\n$ macro-name [args]\nExecute the macro macro-name that was defined with the macdef command.  Arguments\nare passed to the macro unglobbed.\n\naccount [passwd]\nSupply  a  supplemental  password  required  by a remote system for access to re‐\nsources once a login has been successfully completed.   If  no  argument  is  in‐\ncluded,  the user will be prompted for an account password in a non-echoing input\nmode.\n\nappend local-file [remote-file]\nAppend a local file to a file on the remote machine.  If remote-file is left  un‐\nspecified,  the local file name is used in naming the remote file after being al‐\ntered by any ntrans or nmap setting.  File transfer uses the current settings for\ntype, format, mode, and structure.\n\nascii       Set the file transfer type to network ASCII.  This is the default type.\n\nbell        Arrange that a bell be sounded after each file transfer command is completed.\n\nbinary      Set the file transfer type to support binary image transfer.\n\nbye         Terminate the FTP session with the remote server and exit tnftp.  An end of  file\nwill also terminate the session and exit.\n\ncase        Toggle remote computer file name case mapping during get, mget and mput commands.\nWhen  case is on (default is off), remote computer file names with all letters in\nupper case are written in the local directory with the letters  mapped  to  lower\ncase.\n\ncd remote-directory\nChange the working directory on the remote machine to remote-directory.\n\ncdup        Change  the  remote machine working directory to the parent of the current remote\nmachine working directory.\n\nchmod mode remote-file\nChange the permission modes of the file remote-file on the remote system to mode.\n\nclose       Terminate the FTP session with the remote server, and return to the  command  in‐\nterpreter.  Any defined macros are erased.\n\ncr          Toggle  carriage  return stripping during ascii type file retrieval.  Records are\ndenoted by a carriage return/linefeed sequence during ascii type  file  transfer.\nWhen  cr is on (the default), carriage returns are stripped from this sequence to\nconform with the Unix single linefeed record delimiter.  Records on non-Unix  re‐\nmote  systems  may contain single linefeeds; when an ascii type transfer is made,\nthese linefeeds may be distinguished from a record delimiter only when cr is off.\n\ndebug [debug-value]\nToggle debugging mode.  If an optional debug-value is specified it is used to set\nthe debugging level.  When debugging is on, tnftp prints each command sent to the\nremote machine, preceded by the string ‘-->’.\n\ndelete remote-file\nDelete the file remote-file on the remote machine.\n\ndir [remote-path [local-file]]\nPrint a listing of the contents of a directory on the remote machine.  The  list‐\ning includes any system-dependent information that the server chooses to include;\nfor  example, most Unix systems will produce output from the command ‘ls -l’.  If\nremote-path is left unspecified, the current working directory is used.   If  in‐\nteractive prompting is on, tnftp will prompt the user to verify that the last ar‐\ngument  is  indeed  the  target local file for receiving dir output.  If no local\nfile is specified, or if local-file is ‘-’, the output is sent to the terminal.\n\ndisconnect  A synonym for close.\n\nedit        Toggle command line editing, and context sensitive command and  file  completion.\nThis  is  automatically  enabled if input is from a terminal, and disabled other‐\nwise.\n\nepsv, epsv4, epsv6\nToggle the use of the extended EPSV and EPRT commands on all IP, IPv4,  and  IPv6\nconnections  respectively.  First try EPSV/EPRT, and then PASV/PORT.  This is en‐\nabled by default.  If an extended command fails then this  option  will  be  tem‐\nporarily  disabled  for  the  duration  of the current connection, or until epsv,\nepsv4, or epsv6 is executed again.\n\nexit        A synonym for bye.\n\nfeatures    Display what features the remote server supports (using the FEAT command).\n\nfget localfile\nRetrieve the files listed in localfile, which has one line per filename.\n\nform format\nSet the file transfer form to format.  The default (and only supported) format is\n‘non-print’.\n\nftp host [port]\nA synonym for open.\n\ngate [host [port]]\nToggle gate-ftp mode, which used to connect through the TIS FWTK and Gauntlet FTP\nproxies.  This will not be permitted if  the  gate-ftp  server  hasn't  been  set\n(either  explicitly by the user, or from the FTPSERVER environment variable).  If\nhost is given, then gate-ftp mode will be enabled, and the gate-ftp  server  will\nbe  set to host.  If port is also given, that will be used as the port to connect\nto on the gate-ftp server.\n\nget remote-file [local-file]\nRetrieve the remote-file and store it on the local machine.  If  the  local  file\nname  is  not  specified, it is given the same name it has on the remote machine,\nsubject to alteration by the current case, ntrans, and nmap settings.   The  cur‐\nrent settings for type, form, mode, and structure are used while transferring the\nfile.\n\nglob        Toggle  filename  expansion  for mdelete, mget, mput, and mreget.  If globbing is\nturned off with glob, the file name arguments are taken  literally  and  not  ex‐\npanded.   Globbing for mput is done as in csh(1).  For mdelete, mget, and mreget,\neach remote file name is expanded separately on the remote machine and the  lists\nare not merged.  Expansion of a directory name is likely to be different from ex‐\npansion  of the name of an ordinary file: the exact result depends on the foreign\noperating system and FTP server, and can be previewed by doing ‘mls  remote-files\n-’.   Note: mget, mput and mreget are not meant to transfer entire directory sub‐\ntrees of files.  That can be done by transferring a tar(1) archive of the subtree\n(in binary mode).\n\nhash [size]\nToggle hash-sign (‘#’) printing for each data block transferred.  The size  of  a\ndata  block  defaults  to  1024 bytes.  This can be changed by specifying size in\nbytes.  Enabling hash disables progress.\n\nhelp [command]\nPrint an informative message about the meaning of command.   If  no  argument  is\ngiven, tnftp prints a list of the known commands.\n\nidle [seconds]\nSet  the inactivity timer on the remote server to seconds seconds.  If seconds is\nomitted, the current inactivity timer is printed.\n\nimage       A synonym for binary.\n\nlcd [directory]\nChange the working directory on the local machine.  If no directory is specified,\nthe user's home directory is used.\n\nless file   A synonym for page.\n\nlpage local-file\nDisplay local-file with the program specified by the set pager option.\n\nlpwd        Print the working directory on the local machine.\n\nls [remote-path [local-file]]\nA synonym for dir.\n\nmacdef macro-name\nDefine a macro.  Subsequent lines are stored as the macro macro-name; a null line\n(consecutive newline characters in a file or carriage returns from the  terminal)\nterminates  macro input mode.  There is a limit of 16 macros and 4096 total char‐\nacters in all defined macros.  Macro names can be  a  maximum  of  8  characters.\nMacros  are only applicable to the current session they are defined within (or if\ndefined outside a session, to the session invoked with the  next  open  command),\nand remain defined until a close command is executed.  To invoke a macro, use the\n$ command (see above).\n\nThe macro processor interprets ‘$’ and ‘\\’ as special characters.  A ‘$’ followed\nby  a  number (or numbers) is replaced by the corresponding argument on the macro\ninvocation command line.  A ‘$’ followed by an ‘i’ signals  the  macro  processor\nthat  the executing macro is to be looped.  On the first pass ‘$i’ is replaced by\nthe first argument on the macro invocation command line, on the second pass it is\nreplaced by the second argument, and so on.  A ‘\\’ followed by any  character  is\nreplaced by that character.  Use the ‘\\’ to prevent special treatment of the ‘$’.\n\nmdelete [remote-files]\nDelete the remote-files on the remote machine.\n\nmdir remote-files local-file\nLike  dir, except multiple remote files may be specified.  If interactive prompt‐\ning is on, tnftp will prompt the user to verify that the last argument is  indeed\nthe target local file for receiving mdir output.\n\nmget remote-files\nExpand  the  remote-files  on  the remote machine and do a get for each file name\nthus produced.  See glob for details on the filename expansion.   Resulting  file\nnames will then be processed according to case, ntrans, and nmap settings.  Files\nare  transferred  into the local working directory, which can be changed with lcd\ndirectory; new local directories can be created with ! mkdir directory.\n\nmkdir directory-name\nMake a directory on the remote machine.\n\nmls remote-files local-file\nLike ls, except multiple remote files may be specified, and the  local-file  must\nbe specified.  If interactive prompting is on, tnftp will prompt the user to ver‐\nify that the last argument is indeed the target local file for receiving mls out‐\nput.\n\nmlsd [remote-path]\nDisplay  the  contents  of  remote-path  (which  should  default  to  the current\ndirectory if not given) in a machine-parsable form, using MLSD.   The  format  of\ndisplay can be changed with ‘remopts mlst ...’.\n\nmlst [remote-path]\nDisplay  the  details  about  remote-path  (which  should  default to the current\ndirectory if not given) in a machine-parsable form, using MLST.   The  format  of\ndisplay can be changed with ‘remopts mlst ...’.\n\nmode mode-name\nSet  the  file transfer mode to mode-name.  The default (and only supported) mode\nis ‘stream’.\n\nmodtime remote-file\nShow the last modification time of the file on the remote machine,  in  RFC  2822\nformat.\n\nmore file   A synonym for page.\n\nmput local-files\nExpand  wild cards in the list of local files given as arguments and do a put for\neach file in the resulting list.  See glob for  details  of  filename  expansion.\nResulting  file  names  will  then be processed according to ntrans and nmap set‐\ntings.\n\nmreget remote-files\nAs per mget, but performs a reget instead of get.\n\nmsend local-files\nA synonym for mput.\n\nnewer remote-file [local-file]\nGet the file only if the modification time of the remote file is more recent that\nthe file on the current system.  If the file does not exist on the  current  sys‐\ntem,  the  remote file is considered newer.  Otherwise, this command is identical\nto get.\n\nnlist [remote-path [local-file]]\nA synonym for ls.\n\nnmap [inpattern outpattern]\nSet or unset the filename mapping mechanism.  If no arguments are specified,  the\nfilename  mapping  mechanism  is unset.  If arguments are specified, remote file‐\nnames are mapped during mput commands and put commands issued without a specified\nremote target filename.  If arguments are specified, local filenames  are  mapped\nduring  mget  commands  and  get commands issued without a specified local target\nfilename.  This command is useful when connecting to a non-Unix  remote  computer\nwith  different  file  naming  conventions or practices.  The mapping follows the\npattern set by inpattern and outpattern.\n\ninpattern is a template for incoming  filenames  (which  may  have  already  been\nprocessed according to the ntrans and case settings).  Variable templating is ac‐\ncomplished  by  including  the sequences ‘$1’, ‘$2’, ..., ‘$9’ in inpattern.  Use\n‘\\’ to prevent this special treatment of the ‘$’ character.  All other characters\nare treated literally, and are used to determine the  nmap  [inpattern]  variable\nvalues.    For  example,  given  inpattern  ‘$1.$2’  and  the  remote  file  name\n‘mydata.data’, ‘$1’ would have the value ‘mydata’, and ‘$2’ would have the  value\n‘data’.\n\nThe  outpattern  determines  the  resulting mapped filename.  The sequences ‘$1’,\n‘$2’, ..., ‘$9’ are replaced by any value resulting from the inpattern  template.\nThe  sequence  ‘$0’  is replaced by the original filename.  Additionally, the se‐\nquence [seq1,seq2] is replaced by seq1 if seq1 is not a null string; otherwise it\nis replaced by seq2.  For example, the command\n\nnmap $1.$2.$3 [$1,$2].[$2,file]\n\nwould yield the output filename ‘myfile.data’ for input  filenames  ‘myfile.data’\nand  ‘myfile.data.old’,  ‘myfile.file’  for  the  input  filename  ‘myfile’,  and\n‘myfile.myfile’ for the input filename ‘.myfile’.   Spaces  may  be  included  in\noutpattern, as in the example:\n\nnmap $1 sed s/  *$// > $1\n\nUse  the ‘\\’ character to prevent special treatment of the ‘$’, ‘[’, ‘]’, and ‘,’\ncharacters.\n\nntrans [inchars [outchars]]\nSet or unset the filename character translation mechanism.  If no  arguments  are\nspecified,  the  filename character translation mechanism is unset.  If arguments\nare specified, characters in remote filenames are translated during mput commands\nand put commands issued without a specified remote target filename.  If arguments\nare specified, characters in local filenames are translated during mget  commands\nand  get commands issued without a specified local target filename.  This command\nis useful when connecting to a non-Unix remote computer with different file  nam‐\ning  conventions  or practices.  Characters in a filename matching a character in\ninchars are replaced with the corresponding character in outchars.  If the  char‐\nacter's  position in inchars is longer than the length of outchars, the character\nis deleted from the file name.\n\nopen host [port]\nEstablish a connection to the specified host FTP server.  An optional port number\nmay be supplied, in which case, tnftp will attempt to contact an  FTP  server  at\nthat port.  If the set auto-login option is on (default), tnftp will also attempt\nto automatically log the user in to the FTP server (see below).\n\npage file   Retrieve file and display with the program specified by the set pager option.\n\npassive [auto]\nToggle  passive  mode  (if  no arguments are given).  If auto is given, act as if\nFTPMODE is set to ‘auto’.  If passive mode is turned  on  (default),  tnftp  will\nsend a PASV command for all data connections instead of a PORT command.  The PASV\ncommand  requests  that the remote server open a port for the data connection and\nreturn the address of that port.  The remote server listens on that port and  the\nclient  connects to it.  When using the more traditional PORT command, the client\nlistens on a port and sends that address to the remote server, who connects  back\nto  it.  Passive mode is useful when using tnftp through a gateway router or host\nthat controls the directionality of traffic.  (Note that though FTP  servers  are\nrequired to support the PASV command by RFC 1123, some do not.)\n\npdir [remote-path]\nPerform  dir  [remote-path], and display the result with the program specified by\nthe set pager option.\n\npls [remote-path]\nPerform ls [remote-path], and display the result with the  program  specified  by\nthe set pager option.\n\npmlsd [remote-path]\nPerform  mlsd [remote-path], and display the result with the program specified by\nthe set pager option.\n\npreserve    Toggle preservation of modification times on retrieved files.\n\nprogress    Toggle display of transfer progress bar.  The progress bar will be disabled for a\ntransfer that has local-file as ‘-’ or a command that starts with ‘|’.  Refer  to\n“FILE NAMING CONVENTIONS” for more information.  Enabling progress disables hash.\n\nprompt      Toggle  interactive prompting.  Interactive prompting occurs during multiple file\ntransfers to allow the user to selectively retrieve or store files.  If prompting\nis turned off (default is on), any mget or mput will transfer all files, and  any\nmdelete will delete all files.\n\nWhen prompting is on, the following commands are available at a prompt:\n\na   Answer ‘yes’ to the current file, and automatically answer ‘yes’ to any\nremaining files for the current command.\n\nn   Answer ‘no’, and do not transfer the file.\n\np   Answer  ‘yes’  to  the  current  file,  and turn off prompt mode (as if\nprompt off had been given).\n\nq   Terminate the current operation.\n\ny   Answer ‘yes’, and transfer the file.\n\n?   Display a help message.\n\nAny other response will answer ‘yes’ to the current file.\n\nproxy ftp-command\nExecute an FTP command on a secondary control connection.   This  command  allows\nsimultaneous  connection to two remote FTP servers for transferring files between\nthe two servers.  The first proxy command should be an  open,  to  establish  the\nsecondary  control connection.  Enter the command ‘proxy ?’ to see other FTP com‐\nmands executable on the secondary connection.  The following commands behave dif‐\nferently when prefaced by proxy: open will not define new macros during the auto-\nlogin process, close will not erase existing  macro  definitions,  get  and  mget\ntransfer files from the host on the primary control connection to the host on the\nsecondary  control  connection, and put, mput, and append transfer files from the\nhost on the secondary control connection to the host on the primary control  con‐\nnection.  Third party file transfers depend upon support of the FTP protocol PASV\ncommand by the server on the secondary control connection.\n\nput local-file [remote-file]\nStore  a  local  file on the remote machine.  If remote-file is left unspecified,\nthe local file name is used after processing according to any ntrans or nmap set‐\ntings in naming the remote file.  File transfer uses  the  current  settings  for\ntype, format, mode, and structure.\n\npwd         Print the name of the current working directory on the remote machine.\n\nquit        A synonym for bye.\n\nquote [arg ...]\nThe arguments specified are sent, verbatim, to the remote FTP server.\n\nrate direction [maximum [increment]]\nThrottle  the  maximum  transfer  rate to maximum bytes/second.  If maximum is 0,\ndisable the throttle.\n\ndirection may be one of:\nall  Both directions.\nget  Incoming transfers.\nput  Outgoing transfers.\n\nmaximum can be modified on the fly by increment bytes (default: 1024) each time a\ngiven signal is received:\n\nSIGUSR1  Increment maximum by increment bytes.\n\nSIGUSR2  Decrement maximum by increment bytes.  The result must be a  posi‐\ntive number.\n\nIf maximum is not supplied, the current throttle rates are displayed.\n\nNote: rate is not yet implemented for ascii mode transfers.\n\nrcvbuf size\nSet the size of the socket receive buffer to size.\n\nrecv remote-file [local-file]\nA synonym for get.\n\nreget remote-file [local-file]\nreget  acts  like  get,  except  that  if  local-file  exists and is smaller than\nremote-file, local-file is  presumed  to  be  a  partially  transferred  copy  of\nremote-file  and  the  transfer  is continued from the apparent point of failure.\nThis command is useful when transferring very large files over networks that  are\nprone to dropping connections.\n\nremopts command [command-options]\nSet  options  on  the  remote  FTP  server  for command to command-options (whose\nabsence is handled on a command-specific basis).  Remote FTP  commands  known  to\nsupport options include: MLST (used for MLSD and MLST).\n\nrename [from [to]]\nRename the file from on the remote machine, to the file to.\n\nreset       Clear  reply  queue.   This command re-synchronizes command/reply sequencing with\nthe remote FTP server.  Resynchronization may be necessary following a  violation\nof the FTP protocol by the remote server.\n\nrestart marker\nRestart  the  immediately  following get or put at the indicated marker.  On Unix\nsystems, marker is usually a byte offset into the file.\n\nrhelp [command-name]\nRequest help from the remote FTP server.  If a command-name is  specified  it  is\nsupplied to the server as well.\n\nrmdir directory-name\nDelete a directory on the remote machine.\n\nrstatus [remote-file]\nWith  no  arguments, show status of remote machine.  If remote-file is specified,\nshow status of remote-file on remote machine.\n\nrunique     Toggle storing of files on the local system with unique filenames.  If a file al‐\nready exists with a name equal to the target local filename for  a  get  or  mget\ncommand,  a  ‘.1’ is appended to the name.  If the resulting name matches another\nexisting file, a ‘.2’ is appended to the original name.  If this process  contin‐\nues  up  to  ‘.99’,  an  error message is printed, and the transfer does not take\nplace.  The generated unique filename will be reported.  Note that  runique  will\nnot  affect  local files generated from a shell command (see below).  The default\nvalue is off.\n\nsend local-file [remote-file]\nA synonym for put.\n\nsendport    Toggle the use of PORT commands.  By default, tnftp will attempt to  use  a  PORT\ncommand  when  establishing a connection for each data transfer.  The use of PORT\ncommands can prevent delays when performing multiple file transfers.  If the PORT\ncommand fails, tnftp will use the default data port.  When the use of  PORT  com‐\nmands  is  disabled,  no  attempt will be made to use PORT commands for each data\ntransfer.  This is useful for certain FTP implementations which  do  ignore  PORT\ncommands but, incorrectly, indicate they've been accepted.\n\nset [option value]\nSet  option  to value.  If option and value are not given, display all of the op‐\ntions and their values.  The currently supported options are:\n\nanonpass     Defaults to $FTPANONPASS\n\nftpproxy    Defaults to $ftpproxy.\n\nhttpproxy   Defaults to $httpproxy.\n\nhttpsproxy  Defaults to $httpsproxy.\n\nnoproxy     Defaults to $noproxy.\n\npager        Defaults to $PAGER.\n\nprompt       Defaults to $FTPPROMPT.\n\nrprompt      Defaults to $FTPRPROMPT.\n\nsslnoverify  Defaults to $FTPSSLNOVERIFY.\n\nsite [arg ...]\nThe arguments specified are sent, verbatim, to the remote FTP server  as  a  SITE\ncommand.\n\nsize remote-file\nReturn size of remote-file on remote machine.\n\nsndbuf size\nSet the size of the socket send buffer to size.\n\nstatus      Show the current status of tnftp.\n\nstruct struct-name\nSet the file transfer structure to struct-name.  The default (and only supported)\nstructure is ‘file’.\n\nsunique     Toggle  storing  of  files on remote machine under unique file names.  The remote\nFTP server must support FTP protocol STOU command for successful completion.  The\nremote server will report unique name.  Default value is off.\n\nsystem      Show the type of operating system running on the remote machine.\n\ntenex       Set the file transfer type to that needed to talk to TENEX machines.\n\nthrottle    A synonym for rate.\n\ntrace       Toggle packet tracing.\n\ntype [type-name]\nSet the file transfer type to type-name.  If no type is  specified,  the  current\ntype is printed.  The default type is network ASCII.\n\numask [newmask]\nSet  the  default  umask on the remote server to newmask.  If newmask is omitted,\nthe current umask is printed.\n\nunset option\nUnset option.  Refer to set for more information.\n\nusage command\nPrint the usage message for command.\n\nuser user-name [password [account]]\nIdentify yourself to the remote FTP server.  If the password is not specified and\nthe server requires it, tnftp will prompt the user for it (after disabling  local\necho).  If an account field is not specified, and the FTP server requires it, the\nuser  will be prompted for it.  If an account field is specified, an account com‐\nmand will be relayed to the remote server after the login sequence  is  completed\nif  the remote server did not require it for logging in.  Unless tnftp is invoked\nwith “auto-login” disabled, this process is done automatically on initial connec‐\ntion to the FTP server.\n\nverbose     Toggle verbose mode.  In verbose mode, all responses from the FTP server are dis‐\nplayed to the user.  In addition, if verbose is on, when  a  file  transfer  com‐\npletes, statistics regarding the efficiency of the transfer are reported.  By de‐\nfault, verbose is on.\n\nxferbuf size\nSet the size of the socket send and receive buffers to size.\n\n? [command]\nA synonym for help.\n\nCommand arguments which have embedded spaces may be quoted with quote ‘\"’ marks.\n\nCommands  which  toggle settings can take an explicit on or off argument to force the setting\nappropriately.\n\nCommands which take a byte count as an argument (e.g., hash, rate, and  xferbuf)  support  an\noptional  suffix on the argument which changes the interpretation of the argument.  Supported\nsuffixes are:\nb    Causes no modification.  (Optional)\nk    Kilo; multiply the argument by 1024\nm    Mega; multiply the argument by 1048576\ng    Giga; multiply the argument by 1073741824\n\nIf tnftp receives a SIGINFO (see the status argument of stty(1)) or SIGQUIT signal  whilst  a\ntransfer is in progress, the current transfer rate statistics will be written to the standard\nerror output, in the same format as the standard completion message.\n",
                    "flag": "-x"
                }
            ]
        },
        "AUTO-FETCHING FILES": {
            "content": "In  addition  to standard commands, this version of tnftp supports an auto-fetch feature.  To\nenable auto-fetch, simply pass the list of hostnames/files on the command line.\n\nThe following formats are valid syntax for an auto-fetch element:\n\n[user@]host:[path][/]\n“Classic” FTP format.\n\nIf path contains a glob character and globbing is enabled, (see glob), then the equiva‐\nlent of mget path is performed.\n\nIf the directory component of path contains no globbing characters, it  is  stored  lo‐\ncally with the name basename (see basename(1)) of path, in the current directory.  Oth‐\nerwise,  the full remote name is used as the local name, relative to the local root di‐\nrectory.\n\nftp://[user[:password]@]host[:port]/path[/][;type=type]\nAn FTP URL, retrieved using the FTP protocol if set ftpproxy  isn't  defined.   Other‐\nwise,  transfer  the  URL  using  HTTP  via the proxy defined in set ftpproxy.  If set\nftpproxy isn't defined and user is given, login as user.  In this case,  use  password\nif supplied, otherwise prompt the user for one.\n\nIf  a  suffix  of  ‘;type=A’ or ‘;type=I’ is supplied, then the transfer type will take\nplace as ascii or binary (respectively).  The default transfer type is binary.\n\nIn order to be compliant with RFC 3986, tnftp interprets the path part of  an  ‘ftp://’\nauto-fetch URL as follows:\n\n•   The  ‘/’ immediately after the host[:port] is interpreted as a separator before the\npath, and not as part of the path itself.\n\n•   The path is interpreted as a ‘/’-separated list of name components.   For  all  but\nthe  last  such  component, tnftp performs the equivalent of a cd command.  For the\nlast path component, tnftp performs the equivalent of a get command.\n\n•   Empty name components, which result from ‘//’ within the path, or from an extra ‘/’\nat the beginning of the path, will cause the equivalent of a cd command  without  a\ndirectory name.  This is unlikely to be useful.\n\n•   Any ‘%XX’ codes (per RFC 3986) within the path components are decoded, with XX rep‐\nresenting  a  character  code  in hexadecimal.  This decoding takes place after the\npath has been split into components, but before  each  component  is  used  in  the\nequivalent  of  a cd or get command.  Some often-used codes are ‘%2F’ (which repre‐\nsents ‘/’) and ‘%7E’ (which represents ‘~’).\n\nThe above interpretation has the following consequences:\n\n•   The path is interpreted relative to the default login directory  of  the  specified\nuser  or  of  the  ‘anonymous’ user.  If the / directory is required, use a leading\npath of ‘%2F’.  If a user's home directory  is  required  (and  the  remote  server\nsupports  the  syntax), use a leading path of ‘%7Euser/’.  For example, to retrieve\n/etc/motd from ‘localhost’ as the user ‘myname’ with  the  password  ‘mypass’,  use\n‘ftp://myname:mypass@localhost/%2fetc/motd’\n\n•   The  exact  cd and get commands can be controlled by careful choice of where to use\n‘/’ and where to use ‘%2F’ (or ‘%2f’).  For example, the following URLs  correspond\nto the equivalents of the indicated commands:\n\nftp://host/dir1/dir2/file         cd dir1, cd dir2, get file.\n\nftp://host/%2Fdir1/dir2/file      cd /dir1, cd dir2, get file.\n\nftp://host/dir1%2Fdir2/file       cd dir1/dir2, get file.\n\n•   You  must  have appropriate access permission for each of the intermediate directo‐\nries that is used in the equivalent of a cd command.\n\nhttp://[user[:password]@]host[:port]/path\nAn HTTP URL, retrieved using the HTTP protocol.  If set httpproxy is  defined,  it  is\nused  as  a URL to an HTTP proxy server.  If HTTP authorization is required to retrieve\npath, and user (and optionally password) is in the URL, use them for the first  attempt\nto authenticate.\n\nhttps://[user[:password]@]host[:port]/path\nAn HTTPS URL, retrieved using the HTTPS protocol.  If set httpsproxy is defined, it is\nused as a URL to an HTTPS proxy server.  If HTTPS authorization is required to retrieve\npath,  and user (and optionally password) is in the URL, use them for the first attempt\nto authenticate.  There is currently no certificate validation and verification.\n\nfile:///path\nA local URL, copied from /path on the local host.\n\nabout:topic\nDisplay information regarding topic; no file is retrieved for  this  auto-fetched  ele‐\nment.  Supported values include:\n\nabout:ftp      Information about tnftp.\n\nabout:version  The version of tnftp.  Useful to provide when reporting problems.\n\nUnless  noted  otherwise above, and -o output is not given, the file is stored in the current\ndirectory as the basename(1) of path.  Note that if a HTTP redirect is received, the fetch is\nretried using the new target URL supplied by the server, with a corresponding new path.   Us‐\ning an explicit -o output is recommended, to avoid writing to unexpected file names.\n\nIf  a classic format or an FTP URL format has a trailing ‘/’ or an empty path component, then\ntnftp will connect to the site and cd to the directory given as the path, and leave the  user\nin  interactive  mode  ready for further input.  This will not work if set ftpproxy is being\nused.\n\nDirect HTTP transfers use HTTP 1.1.  Proxied FTP and HTTP transfers use HTTP 1.0.\n\nIf -R is given, all auto-fetches that don't go via the FTP or HTTP proxies will be restarted.\nFor FTP, this is implemented by using reget instead of get.  For HTTP, this is implemented by\nusing the ‘Range: bytes=’ HTTP/1.1 directive.\n\nIf WWW or proxy WWW authentication is required, you will be prompted to enter a username  and\npassword to authenticate with.\n\nWhen  specifying  IPv6 numeric addresses in a URL, you need to surround the address in square\nbrackets.  E.g.: ‘ftp://[::1]:21/’.  This is because colons are used in IPv6 numeric  address\nas well as being the separator for the port number.\n",
            "subsections": []
        },
        "ABORTING A FILE TRANSFER": {
            "content": "To abort a file transfer, use the terminal interrupt key (usually Ctrl-C).  Sending transfers\nwill  be  immediately  halted.  Receiving transfers will be halted by sending an FTP protocol\nABOR command to the remote server, and discarding any further data received.   The  speed  at\nwhich  this is accomplished depends upon the remote server's support for ABOR processing.  If\nthe remote server does not support the ABOR command, the prompt will not appear until the re‐\nmote server has completed sending the requested file.\n\nIf the terminal interrupt key sequence is used whilst tnftp is awaiting a reply from the  re‐\nmote  server  for the ABOR processing, then the connection will be closed.  This is different\nfrom the traditional behaviour (which ignores the terminal interrupt during this phase),  but\nis considered more useful.\n",
            "subsections": []
        },
        "FILE NAMING CONVENTIONS": {
            "content": "Files  specified  as  arguments  to  tnftp  commands are processed according to the following\nrules.\n\n1.   If the file name ‘-’ is specified, the stdin (for reading) or stdout  (for  writing)  is\nused.\n\n2.   If  the first character of the file name is ‘|’, the remainder of the argument is inter‐\npreted as a shell command.  tnftp then forks a shell, using popen(3) with  the  argument\nsupplied,  and  reads  (writes)  from the stdout (stdin).  If the shell command includes\nspaces, the argument must be quoted; e.g.  ‘\"| ls -lt\"’.  A particularly useful  example\nof this mechanism is: ‘dir \"\" |more’.\n\n3.   Failing  the above checks, if globbing is enabled, local file names are expanded accord‐\ning to the rules used in the csh(1); see the glob command.  If the tnftp command expects\na single local file (e.g.  put), only the first filename generated by the globbing oper‐\nation is used.\n\n4.   For mget commands and get commands with unspecified local file names, the local filename\nis the remote filename, which may be altered by a case, ntrans, or  nmap  setting.   The\nresulting filename may then be altered if runique is on.\n\n5.   For  mput commands and put commands with unspecified remote file names, the remote file‐\nname is the local filename, which may be altered by a ntrans or nmap setting.   The  re‐\nsulting filename may then be altered by the remote server if sunique is on.\n",
            "subsections": []
        },
        "FILE TRANSFER PARAMETERS": {
            "content": "The  FTP  specification specifies many parameters which may affect a file transfer.  The type\nmay be one of “ascii”, “image” (binary), “ebcdic”, and “local byte size”  (for  PDP-10's  and\nPDP-20's mostly).  tnftp supports the ascii and image types of file transfer, plus local byte\nsize 8 for tenex mode transfers.\n\ntnftp  supports  only  the  default  values for the remaining file transfer parameters: mode,\nform, and struct.\n\nTHE .netrc FILE\nThe .netrc file contains login and initialization information used by the auto-login process.\nIt resides in the user's home directory, unless overridden with the -N netrc option, or spec‐\nified in the NETRC environment variable.  The following tokens are recognized;  they  may  be\nseparated by spaces, tabs, or new-lines:\n\nmachine name\nIdentify  a  remote  machine name.  The auto-login process searches the .netrc file\nfor a machine token that matches the remote machine specified on the tnftp  command\nline  or  as an open command argument.  Once a match is made, the subsequent .netrc\ntokens are processed, stopping when the end of file is reached or  another  machine\nor a default token is encountered.\n\ndefault   This  is  the same as machine name except that default matches any name.  There can\nbe only one default token, and it must be after all machine tokens.  This  is  nor‐\nmally used as:\n\ndefault login anonymous password user@site\n\nthereby  giving the user an automatic anonymous FTP login to machines not specified\nin .netrc.  This can be overridden by using the -n flag to disable auto-login.\n\nlogin name\nIdentify a user on the remote machine.  If this token is  present,  the  auto-login\nprocess will initiate a login using the specified name.\n\npassword string\nSupply  a  password.   If this token is present, the auto-login process will supply\nthe specified string if the remote server requires a password as part of the  login\nprocess.   Note that if this token is present in the .netrc file for any user other\nthan anonymous, tnftp will abort the auto-login process if the .netrc  is  readable\nby anyone besides the user.\n\naccount string\nSupply  an  additional  account password.  If this token is present, the auto-login\nprocess will supply the specified string if the remote  server  requires  an  addi‐\ntional account password, or the auto-login process will initiate an ACCT command if\nit does not.\n\nmacdef name\nDefine  a  macro.  This token functions like the tnftp macdef command functions.  A\nmacro is defined with the specified name; its contents begin with the  next  .netrc\nline  and  continue until a blank line (consecutive new-line characters) is encoun‐\ntered.  Like the other tokens in the .netrc file, a macdef is  applicable  only  to\nthe  machine  definition  preceding  it.  A macdef entry cannot be used by multiple\nmachine definitions; rather, it must be defined following each machine  it  is  in‐\ntended to be used with.  If a macro named init is defined, it is automatically exe‐\ncuted as the last step in the auto-login process.  For example,\n\ndefault\nmacdef init\nepsv4 off\n\nfollowed by a blank line.\n",
            "subsections": []
        },
        "COMMAND LINE EDITING": {
            "content": "tnftp  supports interactive command line editing, via the editline(3) library.  It is enabled\nwith the edit command, and is enabled by default if input is from a tty.  Previous lines  can\nbe  recalled  and  edited  with the arrow keys, and other GNU Emacs-style editing keys may be\nused as well.\n\nThe editline(3) library is configured with a .editrc file — refer to editrc(5) for  more  in‐\nformation.\n\nAn  extra key binding is available to tnftp to provide context sensitive command and filename\ncompletion (including remote file completion).  To use this, bind a key  to  the  editline(3)\ncommand ftp-complete.  By default, this is bound to the TAB key.\n",
            "subsections": []
        },
        "COMMAND LINE PROMPT": {
            "content": "By default, tnftp displays a command line prompt of ‘ftp> ’ to the user.  This can be changed\nwith the set prompt command.\n\nA  prompt can be displayed on the right side of the screen (after the command input) with the\nset rprompt command.\n\nThe following formatting sequences are replaced by the given information:\n\n%/   The current remote working directory.\n\n%c[[0]n], %.[[0]n]\nThe trailing component of the current remote working directory, or n trailing com‐\nponents if a digit n is given.  If n begins with ‘0’, the number of skipped compo‐\nnents precede the trailing component(s) in  the  format  “/<number>trailing”  (for\n‘%c’) or “...trailing” (for ‘%.’).\n\n%M   The remote host name.\n\n%m   The remote host name, up to the first dot ‘.’.\n\n%n   The remote user name.\n\n%%   A single percent character ‘%’.\n",
            "subsections": []
        },
        "ENVIRONMENT": {
            "content": "tnftp uses the following environment variables.\n\nFTPANONPASS    Password to send in an anonymous FTP transfer.  Defaults to “`whoami`@”.\n\nFTPMODE        Overrides the default operation mode.  Support values are:\n\nactive   active mode FTP only\n\nauto     automatic determination of passive or active (this is the default)\n\ngate     gate-ftp mode\n\npassive  passive mode FTP only\n\nFTPPROMPT      Command-line  prompt  to  use.   Defaults  to ‘ftp> ’.  Refer to “COMMAND LINE\nPROMPT” for more information.\n\nFTPRPROMPT     Command-line right side prompt to use.  Defaults to empty  string.   Refer  to\n“COMMAND LINE PROMPT” for more information.\n\nFTPSERVER      Host to use as gate-ftp server when gate is enabled.\n\nFTPSERVERPORT  Port  to use when connecting to gate-ftp server when gate is enabled.  Default\nis port returned by a getservbyname(3) lookup of “ftpgate/tcp”.\n\nFTPUSERAGENT   The value to send for the HTTP User-Agent header.\n\nFTPSSLNOVERIFY\nSet to 1 to not verify SSL certificates.\n\nHOME           For default location of a .netrc file, if one exists.\n\nNETRC          An alternate location of the .netrc file.\n\nPAGER          Used by various commands to display files.  Defaults to more(1)  if  empty  or\nnot set.\n\nSHELL          For default shell.\n\nftpproxy      URL  of FTP proxy to use when making FTP URL requests (if not defined, use the\nstandard FTP protocol).\n\nSee httpproxy for further notes about proxy use.\n\nhttpproxy     URL of HTTP proxy to use when making HTTP URL requests.  If proxy  authentica‐\ntion  is  required and there is a username and password in this URL, they will\nautomatically be used in the first attempt to authenticate to the proxy.\n\nIf “unsafe” URL characters are required in the username or password (for exam‐\nple ‘@’ or ‘/’), encode them with RFC 3986 ‘%XX’ encoding.\n\nNote that the use of a username and password in ftpproxy and  httpproxy  may\nbe incompatible with other programs that use it (such as lynx(1)).\n\nNOTE:  this  is  not  used  for  interactive  sessions,  only for command-line\nfetches.\n\nhttpsproxy    URL of HTTPS proxy to use when making HTTPS URL requests.\n\nSee httpproxy for further notes about proxy use.\n\nnoproxy       A space or comma separated list of hosts (or domains) for  which  proxying  is\nnot  to  be used.  Each entry may have an optional trailing ‘:port’, which re‐\nstricts the matching to connections to that port.\n",
            "subsections": []
        },
        "EXTENDED PASSIVE MODE AND FIREWALLS": {
            "content": "Some firewall configurations do not allow tnftp to use extended passive mode.   If  you  find\nthat even a simple ls appears to hang after printing a message such as this:\n\n229 Entering Extended Passive Mode (|||58551|)\n\nthen  you  will  need to disable extended passive mode with epsv4 off.  See the above section\n“The .netrc File” for an example of how to make this automatic.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "getservbyname(3), editrc(5), services(5), ftpd(8)\n",
            "subsections": []
        },
        "STANDARDS": {
            "content": "tnftp attempts to be compliant with:\n\nRFC 959   File Transfer Protocol\n\nRFC 1123  Requirements for Internet Hosts - Application and Support\n\nRFC 1635  How to Use Anonymous FTP\n\nRFC 2389  Feature negotiation mechanism for the File Transfer Protocol\n\nRFC 2428  FTP Extensions for IPv6 and NATs\n\nRFC 2616  Hypertext Transfer Protocol -- HTTP/1.1\n\nRFC 2822  Internet Message Format\n\nRFC 3659  Extensions to FTP\n\nRFC 3986  Uniform Resource Identifier (URI)\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "The tnftp command appeared in 4.2BSD.\n\nVarious features such as command line editing, context sensitive command and file completion,\ndynamic progress bar, automatic fetching of files and URLs, modification  time  preservation,\ntransfer  rate  throttling, configurable command line prompt, and other enhancements over the\nstandard BSD tnftp were implemented  in  NetBSD  1.3  and  later  releases  by  Luke  Mewburn\n⟨lukem@NetBSD.org⟩.\n\nIPv6  support  was  added  by the WIDE/KAME project (but may not be present in all non-NetBSD\nversions of this program, depending if the operating system supports IPv6 in a similar manner\nto KAME).\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Correct execution of many commands depends upon proper behavior by the remote server.\n\nAn error in the treatment of carriage returns in the 4.2BSD ascii-mode transfer code has been\ncorrected.  This correction may result in incorrect transfers of binary  files  to  and  from\n4.2BSD servers using the ascii type.  Avoid this problem by using the binary image type.\n\ntnftp   assumes   that   all   IPv4  mapped  addresses  (IPv6  addresses  with  a  form  like\n::ffff:10.1.1.1) indicate IPv4 destinations which can be handled by  AFINET  sockets.   How‐\never,  in certain IPv6 network configurations, this assumption is not true.  In such an envi‐\nronment, IPv4 mapped addresses must be passed to AFINET6 sockets directly.  For example,  if\nyour  site  uses  a  SIIT translator for IPv6-to-IPv4 translation, tnftp is unable to support\nyour configuration.\n\nDebian                                    February 25, 2023                                 TNFTP(1)",
            "subsections": []
        }
    },
    "summary": "tnftp — Internet file transfer program",
    "flags": [
        {
            "flag": "-4",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-6",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-A",
            "long": null,
            "arg": null,
            "description": "fall back to active mode if passive is not supported by the server. This option causes tnftp to always use an active connection. It is only useful for connect‐ ing to very old servers that do not implement passive mode properly."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "stead."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-g",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "auto-fetch transfers. If auto-login is enabled, tnftp will check the .netrc (see below) file in the user's home directory for an entry describing an account on the remote machine. If no entry exists, tnftp will prompt for the remote machine login name (default is the user identity on the local machine), and, if neces‐ sary, prompt for a password and an account with which to login. To override the auto-login for auto-fetch transfers, specify the username (and optionally, password) as appropriate."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "ing to the “FILE NAMING CONVENTIONS” below. If output is not ‘-’ or doesn't start with ‘|’, then only the first file specified will be retrieved into output; all other files will be retrieved into the basename of their remote name."
        },
        {
            "flag": "-P",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "This option has been deprecated as tnftp now tries to use passive mode by de‐ fault, falling back to active mode if the server does not support passive connec‐ tions."
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "Quit if the connection has stalled for quittime seconds."
        },
        {
            "flag": "-R",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "Set the maximum transfer rate for direction to maximum bytes/second, and if spec‐ ified, the increment to increment bytes/second. Refer to rate for more informa‐ tion."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": "Upload files on the command line to url where url is one of the ‘ftp://’ URL types as supported by auto-fetch (with an optional target filename for single file uploads), and file is one or more local files to be uploaded."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "a terminal."
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "in the case of progress, tnftp is the foreground process). Forces tnftp to show all responses from the remote server, as well as report on data transfer statis‐ tics."
        },
        {
            "flag": "-x",
            "long": null,
            "arg": null,
            "description": "Set the size of the socket send and receive buffers to xfersize. Refer to xferbuf for more information. -? Display help to stdout, and exit. The client host with which tnftp is to communicate may be specified on the command line. If this is done, tnftp will immediately attempt to establish a connection to an FTP server on that host; otherwise, tnftp will enter its command interpreter and await instructions from the user. When tnftp is awaiting commands from the user the prompt ‘ftp>’ is provided to the user. The following commands are recognized by tnftp: ! [command [args]] Invoke an interactive shell on the local machine. If there are arguments, the first is taken to be a command to execute directly, with the rest of the argu‐ ments as its arguments. $ macro-name [args] Execute the macro macro-name that was defined with the macdef command. Arguments are passed to the macro unglobbed. account [passwd] Supply a supplemental password required by a remote system for access to re‐ sources once a login has been successfully completed. If no argument is in‐ cluded, the user will be prompted for an account password in a non-echoing input mode. append local-file [remote-file] Append a local file to a file on the remote machine. If remote-file is left un‐ specified, the local file name is used in naming the remote file after being al‐ tered by any ntrans or nmap setting. File transfer uses the current settings for type, format, mode, and structure. ascii Set the file transfer type to network ASCII. This is the default type. bell Arrange that a bell be sounded after each file transfer command is completed. binary Set the file transfer type to support binary image transfer. bye Terminate the FTP session with the remote server and exit tnftp. An end of file will also terminate the session and exit. 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. cd remote-directory Change the working directory on the remote machine to remote-directory. cdup Change the remote machine working directory to the parent of the current remote machine working directory. chmod mode remote-file Change the permission modes of the file remote-file on the remote system to mode. close Terminate the FTP session with the remote server, and return to the command in‐ terpreter. Any defined macros are erased. 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 returns are stripped from this sequence to conform with the Unix single linefeed record delimiter. Records on non-Unix re‐ mote 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. 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 ‘-->’. delete remote-file Delete the file remote-file on the remote machine. dir [remote-path [local-file]] Print a listing of the contents of a directory on the remote machine. The list‐ ing 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 unspecified, the current working directory is used. If in‐ teractive prompting is on, tnftp will prompt the user to verify that the last ar‐ gument 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. disconnect A synonym for close. edit Toggle command line editing, and context sensitive command and file completion. This is automatically enabled if input is from a terminal, and disabled other‐ wise. 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 en‐ abled by default. If an extended command fails then this option will be tem‐ porarily disabled for the duration of the current connection, or until epsv, epsv4, or epsv6 is executed again. exit A synonym for bye. features Display what features the remote server supports (using the FEAT command). fget localfile Retrieve the files listed in localfile, which has one line per filename. form format Set the file transfer form to format. The default (and only supported) format is ‘non-print’. ftp host [port] A synonym for open. 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. 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 cur‐ rent settings for type, form, mode, and structure are used while transferring the file. 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 ex‐ panded. 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. Expansion of a directory name is likely to be different from ex‐ pansion of the name of an ordinary file: the exact result depends on the foreign operating system and FTP server, and can be previewed by doing ‘mls remote-files -’. Note: mget, mput and mreget are not meant to transfer entire directory sub‐ trees of files. That can be done by transferring a tar(1) archive of the subtree (in binary mode). 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. help [command] Print an informative message about the meaning of command. If no argument is given, tnftp prints a list of the known commands. idle [seconds] Set the inactivity timer on the remote server to seconds seconds. If seconds is omitted, the current inactivity timer is printed. image A synonym for binary. lcd [directory] Change the working directory on the local machine. If no directory is specified, the user's home directory is used. less file A synonym for page. lpage local-file Display local-file with the program specified by the set pager option. lpwd Print the working directory on the local machine. ls [remote-path [local-file]] A synonym for dir. 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 char‐ acters in all defined 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 executed. 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 corresponding 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 replaced 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 ‘$’. mdelete [remote-files] Delete the remote-files on the remote machine. mdir remote-files local-file Like dir, except multiple remote files may be specified. If interactive prompt‐ ing is on, tnftp will prompt the user to verify that the last argument is indeed the target local file for receiving mdir output. 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 expansion. Resulting file names will then be processed according to case, ntrans, and nmap settings. Files are transferred into the local working directory, which can be changed with lcd directory; new local directories can be created with ! mkdir directory. mkdir directory-name Make a directory on the remote machine. 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 ver‐ ify that the last argument is indeed the target local file for receiving mls out‐ put. 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 ...’. 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 ...’. mode mode-name Set the file transfer mode to mode-name. The default (and only supported) mode is ‘stream’. modtime remote-file Show the last modification time of the file on the remote machine, in RFC 2822 format. more file A synonym for page. 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 set‐ tings. mreget remote-files As per mget, but performs a reget instead of get. msend local-files A synonym for mput. 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 sys‐ tem, the remote file is considered newer. Otherwise, this command is identical to get. nlist [remote-path [local-file]] A synonym for ls. 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 file‐ names 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 commands and get commands issued without a specified local target filename. 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 already been processed according to the ntrans and case settings). Variable templating is ac‐ complished 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 sequences ‘$1’, ‘$2’, ..., ‘$9’ are replaced by any value resulting from the inpattern template. The sequence ‘$0’ is replaced by the original filename. Additionally, the se‐ quence [seq1,seq2] is replaced by seq1 if seq1 is not a null string; otherwise it is replaced 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. ntrans [inchars [outchars]] Set or unset the filename character translation mechanism. If no arguments are specified, the filename character translation mechanism is unset. If arguments are specified, characters in remote filenames are translated during mput commands and put commands issued 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 remote computer with different file nam‐ ing conventions or practices. Characters in a filename matching a character in inchars are replaced with the corresponding character in outchars. If the char‐ acter's position in inchars is longer than the length of outchars, the character is deleted from the file name. open host [port] Establish a connection to the specified host FTP server. An optional port number may be supplied, in which case, tnftp will attempt 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). page file Retrieve file and display with the program specified by the set pager option. 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 remote server open a port for the data connection and return the address of that port. The remote server listens on that port and the client connects to it. When using the more traditional PORT command, the client listens on a port and sends that address to the remote server, who connects back to it. Passive mode is useful when using tnftp through a gateway router or host that controls the directionality of traffic. (Note that though FTP servers are required to support the PASV command by RFC 1123, some do not.) pdir [remote-path] Perform dir [remote-path], and display the result with the program specified by the set pager option. pls [remote-path] Perform ls [remote-path], and display the result with the program specified by the set pager option. pmlsd [remote-path] Perform mlsd [remote-path], and display the result with the program specified by the set pager option. preserve Toggle preservation of modification times on retrieved files. 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 information. Enabling progress disables hash. 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 if 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. proxy ftp-command Execute an FTP command on a secondary control connection. This command 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 com‐ mands executable on the secondary connection. The following commands behave dif‐ ferently 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 control connection to the host on the primary control con‐ nection. Third party file transfers depend upon support of the FTP protocol PASV command by the server on the secondary control connection. 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 set‐ tings in naming the remote file. File transfer uses the current settings for type, format, mode, and structure. pwd Print the name of the current working directory on the remote machine. quit A synonym for bye. quote [arg ...] The arguments specified are sent, verbatim, to the remote FTP server. 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 posi‐ tive number. If maximum is not supplied, the current throttle rates are displayed. Note: rate is not yet implemented for ascii mode transfers. rcvbuf size Set the size of the socket receive buffer to size. recv remote-file [local-file] A synonym for get. 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 transferred 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 connections. 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). rename [from [to]] Rename the file from on the remote machine, to the file to. reset Clear reply queue. This command re-synchronizes command/reply sequencing with the remote FTP server. Resynchronization may be necessary following a violation of the FTP protocol by the remote server. 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. rhelp [command-name] Request help from the remote FTP server. If a command-name is specified it is supplied to the server as well. rmdir directory-name Delete a directory on the remote machine. rstatus [remote-file] With no arguments, show status of remote machine. If remote-file is specified, show status of remote-file on remote machine. runique Toggle storing of files on the local system with unique filenames. If a file al‐ ready exists with a name equal to the target local filename 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 contin‐ ues up to ‘.99’, an error 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. send local-file [remote-file] A synonym for put. 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 performing multiple file transfers. If the PORT command fails, tnftp will use the default data port. When the use of PORT com‐ mands is disabled, 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 accepted. set [option value] Set option to value. If option and value are not given, display all of the op‐ tions and their values. The currently supported options are: anonpass Defaults to $FTPANONPASS ftpproxy Defaults to $ftpproxy. httpproxy Defaults to $httpproxy. httpsproxy Defaults to $httpsproxy. noproxy Defaults to $noproxy. pager Defaults to $PAGER. prompt Defaults to $FTPPROMPT. rprompt Defaults to $FTPRPROMPT. sslnoverify Defaults to $FTPSSLNOVERIFY. site [arg ...] The arguments specified are sent, verbatim, to the remote FTP server as a SITE command. size remote-file Return size of remote-file on remote machine. sndbuf size Set the size of the socket send buffer to size. status Show the current status of tnftp. struct struct-name Set the file transfer structure to struct-name. The default (and only supported) structure is ‘file’. 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. system Show the type of operating system running on the remote machine. tenex Set the file transfer type to that needed to talk to TENEX machines. throttle A synonym for rate. trace Toggle packet tracing. 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. umask [newmask] Set the default umask on the remote server to newmask. If newmask is omitted, the current umask is printed. unset option Unset option. Refer to set for more information. usage command Print the usage message for command. 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 specified, and the FTP server requires it, the user will be prompted for it. If an account field is specified, an account com‐ mand 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 connec‐ tion to the FTP server. verbose Toggle verbose mode. In verbose mode, all responses from the FTP server are dis‐ played to the user. In addition, if verbose is on, when a file transfer com‐ pletes, statistics regarding the efficiency of the transfer are reported. By de‐ fault, verbose is on. xferbuf size Set the size of the socket send and receive buffers to size. ? [command] A synonym for help. Command arguments which have embedded spaces may be quoted with quote ‘\"’ marks. Commands which toggle settings can take an explicit on or off argument to force the setting appropriately. Commands which take a byte count as an argument (e.g., hash, rate, and xferbuf) support an optional suffix on the argument which changes the interpretation of the argument. Supported suffixes are: b Causes no modification. (Optional) k Kilo; multiply the argument by 1024 m Mega; multiply the argument by 1048576 g Giga; multiply the argument by 1073741824 If tnftp receives a SIGINFO (see the status argument of stty(1)) or SIGQUIT signal whilst a transfer is in progress, the current transfer rate statistics will be written to the standard error output, in the same format as the standard completion message."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "getservbyname",
            "section": "3",
            "url": "https://www.chedong.com/phpMan.php/man/getservbyname/3/json"
        },
        {
            "name": "editrc",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/editrc/5/json"
        },
        {
            "name": "services",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/services/5/json"
        },
        {
            "name": "ftpd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ftpd/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Tools to interact with a server via File Transfer Protocol.",
        "examples": [
            {
                "description": "Connect to an FTP server and run in interactive mode",
                "command": "ftp {{ftp.example.com}}"
            },
            {
                "description": "Connect to an FTP server specifying its IP address and port",
                "command": "ftp {{ip_address}} {{port}}"
            },
            {
                "description": "[Interactive] Switch to binary transfer mode (graphics, compressed files, etc.)",
                "command": "binary"
            },
            {
                "description": "[Interactive] Transfer multiple files without prompting for confirmation on every file",
                "command": "prompt off"
            },
            {
                "description": "[Interactive] Download multiple files (`glob` expression)",
                "command": "mget {{*.png}}"
            },
            {
                "description": "[Interactive] Upload multiple files (`glob` expression)",
                "command": "mput {{*.zip}}"
            },
            {
                "description": "[Interactive] Delete multiple files on the remote server",
                "command": "mdelete {{*.txt}}"
            },
            {
                "description": "[Interactive] Rename a file on the remote server",
                "command": "rename {{original_filename}} {{new_filename}}"
            }
        ]
    }
}