{
    "mode": "man",
    "parameter": "tnftp",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/tnftp/1/json",
    "generated": "2026-06-03T01:28: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] [https://[user[:password]@]host[:port]/path]\n...\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] [https://[user[:password]@]host[:port]/path]\n...\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 be‐\nlow 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": "back to active mode if passive is not supported by the server.  This option causes\ntnftp to always use an active connection.  It is only useful for connecting to very\nold servers that do not implement passive mode properly.\n",
                    "flag": "-A"
                },
                {
                    "name": "-a",
                    "content": "",
                    "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": "fetch transfers.  If auto-login is enabled, tnftp will check the .netrc (see below)\nfile in the user's home directory for an entry describing an account on the remote\nmachine.  If no entry exists, tnftp will prompt for the remote machine login name\n(default is the user identity on the local machine), and, if necessary, prompt for\na password and an account with which to login.  To override the auto-login for\nauto-fetch transfers, specify the username (and optionally, password) as appropri‐\nate.\n",
                    "flag": "-n"
                },
                {
                    "name": "-o",
                    "content": "to the FILE NAMING CONVENTIONS below.  If output is not ‘-’ or doesn't start with\n‘|’, then only the first file specified will be retrieved into output; all other\nfiles will be retrieved into the basename of their remote name.\n",
                    "flag": "-o"
                },
                {
                    "name": "-P",
                    "content": "",
                    "flag": "-P"
                },
                {
                    "name": "-p",
                    "content": "option has been deprecated as tnftp now tries to use passive mode by default, fall‐\ning back to active mode if the server does not support passive connections.\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 speci‐\nfied, the increment to increment bytes/second.  Refer to rate for more information.\n",
                    "flag": "-T"
                },
                {
                    "name": "-u",
                    "content": "Upload files on the command line to url where url is one of the ‘ftp://’ URL types\nas supported by auto-fetch (with an optional target filename for single file up‐\nloads), and file is one or more local files to be uploaded.\n",
                    "flag": "-u"
                },
                {
                    "name": "-V",
                    "content": "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 xferbuf\nfor 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 that\nhost; otherwise, tnftp will enter its command interpreter and await instructions from the user.\nWhen tnftp is awaiting commands from the user the prompt ‘ftp>’ is provided to the user.  The\nfollowing 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 arguments\nas 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 resources\nonce a login has been successfully completed.  If no argument is included, the user\nwill be prompted for an account password in a non-echoing input mode.\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 ma‐\nchine 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 inter‐\npreter.  Any defined macros are erased.\n\ncr          Toggle carriage return stripping during ascii type file retrieval.  Records are de‐\nnoted by a carriage return/linefeed sequence during ascii type file transfer.  When\ncr is on (the default), carriage returns are stripped from this sequence to conform\nwith the UNIX single linefeed record delimiter.  Records on non-UNIX remote systems\nmay contain single linefeeds; when an ascii type transfer is made, these linefeeds\nmay 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 listing\nincludes any system-dependent information that the server chooses to include; for\nexample, most UNIX systems will produce output from the command ‘ls -l’.  If\nremote-path is left unspecified, the current working directory is used.  If inter‐\nactive prompting is on, tnftp will prompt the user to verify that the last argument\nis indeed the target local file for receiving dir output.  If no local file is\nspecified, 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 otherwise.\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 temporar‐\nily disabled for the duration of the current connection, or until epsv, epsv4, or\nepsv6 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 (either\nexplicitly by the user, or from the FTPSERVER environment variable).  If host is\ngiven, then gate-ftp mode will be enabled, and the gate-ftp server will be set to\nhost.  If port is also given, that will be used as the port to connect to on the\ngate-ftp server.\n\nget remote-file [local-file]\nRetrieve the remote-file and store it on the local machine.  If the local file name\nis not specified, it is given the same name it has on the remote machine, subject\nto alteration by the current case, ntrans, and nmap settings.  The current settings\nfor type, form, mode, and structure are used while transferring the file.\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 expanded.\nGlobbing for mput is done as in csh(1).  For mdelete, mget, and mreget, each remote\nfile name is expanded separately on the remote machine and the lists are not\nmerged.  Expansion of a directory name is likely to be different from expansion of\nthe name of an ordinary file: the exact result depends on the foreign operating\nsystem and FTP server, and can be previewed by doing ‘mls remote-files -’.  Note:\nmget, mput and mreget are not meant to transfer entire directory subtrees of files.\nThat can be done by transferring a tar(1) archive of the subtree (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 charac‐\nters in all defined macros.  Macro names can be a maximum of 8 characters.  Macros\nare only applicable to the current session they are defined within (or if defined\noutside a session, to the session invoked with the next open command), and remain\ndefined until a close command is executed.  To invoke a macro, use the $ command\n(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 in‐\nvocation command line.  A ‘$’ followed by an ‘i’ signals the macro processor that\nthe executing macro is to be looped.  On the first pass ‘$i’ is replaced by the\nfirst argument on the macro invocation command line, on the second pass it is re‐\nplaced by the second argument, and so on.  A ‘\\’ followed by any character is re‐\nplaced 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 prompting\nis on, tnftp will prompt the user to verify that the last argument is indeed the\ntarget 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 thus\nproduced.  See glob for details on the filename expansion.  Resulting file names\nwill then be processed according to case, ntrans, and nmap settings.  Files are\ntransferred 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 be\nspecified.  If interactive prompting is on, tnftp will prompt the user to verify\nthat the last argument is indeed the target local file for receiving mls output.\n\nmlsd [remote-path]\nDisplay the contents of remote-path (which should default to the current directory\nif not given) in a machine-parsable form, using MLSD.  The format of display can be\nchanged with ‘remopts mlst ...’.\n\nmlst [remote-path]\nDisplay the details about remote-path (which should default to the current direc‐\ntory if not given) in a machine-parsable form, using MLST.  The format of display\ncan be changed with ‘remopts mlst ...’.\n\nmode mode-name\nSet the file transfer mode to mode-name.  The default (and only supported) mode is\n“stream”.\n\nmodtime remote-file\nShow the last modification time of the file on the remote machine, in RFC 2822 for‐\nmat.\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.  Re‐\nsulting file names will then be processed according to ntrans and nmap settings.\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 system,\nthe remote file is considered newer.  Otherwise, this command is identical to 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 filenames\nare mapped during mput commands and put commands issued without a specified remote\ntarget filename.  If arguments are specified, local filenames are mapped during\nmget commands and get commands issued without a specified local target filename.\nThis command is useful when connecting to a non-UNIX remote computer with different\nfile naming conventions or practices.  The mapping follows the pattern set by\ninpattern and outpattern.\n\ninpattern is a template for incoming filenames (which may have already been pro‐\ncessed according to the ntrans and case settings).  Variable templating is accom‐\nplished by including the sequences ‘$1’, ‘$2’, ..., ‘$9’ in inpattern.  Use ‘\\’ to\nprevent this special treatment of the ‘$’ character.  All other characters are\ntreated literally, and are used to determine the nmap [inpattern] variable values.\nFor example, given inpattern ‘$1.$2’ and the remote file name ‘mydata.data’, ‘$1’\nwould have the value ‘mydata’, and ‘$2’ would have the value ‘data’.\n\nThe outpattern determines the resulting mapped filename.  The sequences ‘$1’, ‘$2’,\n..., ‘$9’ are replaced by any value resulting from the inpattern template.  The se‐\nquence ‘$0’ is replaced by the original filename.  Additionally, the sequence\n“[seq1, seq2]” is replaced by seq1 if seq1 is not a null string; otherwise it is\nreplaced 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’ and\n‘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 are\nspecified, characters in remote filenames are translated during mput commands and\nput commands issued without a specified remote target filename.  If arguments are\nspecified, characters in local filenames are translated during mget commands and\nget commands issued without a specified local target filename.  This command is\nuseful when connecting to a non-UNIX remote computer with different file naming\nconventions or practices.  Characters in a filename matching a character in inchars\nare replaced with the corresponding character in outchars.  If the character's po‐\nsition in inchars is longer than the length of outchars, the character is deleted\nfrom 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 that\nport.  If the set auto-login option is on (default), tnftp will also attempt to au‐\ntomatically 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 send\na PASV command for all data connections instead of a PORT command.  The PASV com‐\nmand requests that the remote server open a port for the data connection and return\nthe address of that port.  The remote server listens on that port and the client\nconnects to it.  When using the more traditional PORT command, the client listens\non a port and sends that address to the remote server, who connects back to it.\nPassive mode is useful when using tnftp through a gateway router or host that con‐\ntrols the directionality of traffic.  (Note that though FTP servers are required to\nsupport 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 the\nset pager option.\n\npls [remote-path]\nPerform ls [remote-path], and display the result with the program specified by the\nset 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\nFILE 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 is “prompt\noff” 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 si‐\nmultaneous connection to two remote FTP servers for transferring files between the\ntwo servers.  The first proxy command should be an open, to establish the secondary\ncontrol connection.  Enter the command ‘proxy ?’ to see other FTP commands exe‐\ncutable on the secondary connection.  The following commands behave differently\nwhen prefaced by proxy: open will not define new macros during the auto-login\nprocess, close will not erase existing macro definitions, get and mget transfer\nfiles from the host on the primary control connection to the host on the secondary\ncontrol connection, and put, mput, and append transfer files from the host on the\nsecondary control connection to the host on the primary control connection.  Third\nparty file transfers depend upon support of the FTP protocol PASV command by the\nserver 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, the\nlocal file name is used after processing according to any ntrans or nmap settings\nin naming the remote file.  File transfer uses the current settings for type,\nformat, 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, dis‐\nable 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 positive\nnumber.\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.  This\ncommand is useful when transferring very large files over networks that are prone\nto dropping connections.\n\nremopts command [command-options]\nSet options on the remote FTP server for command to command-options (whose absence\nis handled on a command-specific basis).  Remote FTP commands known to support op‐\ntions 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 the\nremote FTP server.  Resynchronization may be necessary following a violation of the\nFTP protocol by the remote server.\n\nrestart marker\nRestart the immediately following get or put at the indicated marker.  On UNIX sys‐\ntems, 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 sup‐\nplied 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 com‐\nmand, a ‘.1’ is appended to the name.  If the resulting name matches another exist‐\ning file, a ‘.2’ is appended to the original name.  If this process continues up to\n‘.99’, an error message is printed, and the transfer does not take place.  The gen‐\nerated unique filename will be reported.  Note that runique will not affect local\nfiles generated from a shell command (see below).  The default value 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 com‐\nmand when establishing a connection for each data transfer.  The use of PORT com‐\nmands can prevent delays when performing multiple file transfers.  If the PORT com‐\nmand fails, tnftp will use the default data port.  When the use of PORT commands is\ndisabled, no attempt will be made to use PORT commands for each data transfer.\nThis is useful for certain FTP implementations which do ignore PORT commands but,\nincorrectly, indicate they've been accepted.\n\nset [option value]\nSet option to value.  If option and value are not given, display all of the options\nand 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\nsite [arg ...]\nThe arguments specified are sent, verbatim, to the remote FTP server as a SITE com‐\nmand.\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 FTP\nserver must support FTP protocol STOU command for successful completion.  The re‐\nmote 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 type\nis printed.  The default type is network ASCII.\n\numask [newmask]\nSet the default umask on the remote server to newmask.  If newmask is omitted, the\ncurrent 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 command\nwill be relayed to the remote server after the login sequence is completed if the\nremote server did not require it for logging in.  Unless tnftp is invoked with\n“auto-login” disabled, this process is done automatically on initial connection to\nthe 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 completes,\nstatistics regarding the efficiency of the transfer are reported.  By default, ver‐\nbose 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 ap‐\npropriately.\n\nCommands which take a byte count as an argument (e.g., hash, rate, and xferbuf) support an op‐\ntional suffix on the argument which changes the interpretation of the argument.  Supported suf‐\nfixes 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 en‐\nable 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 locally\nwith the name basename (see basename(1)) of path, in the current directory.  Otherwise,\nthe full remote name is used as the local name, relative to the local root directory.\n\nftp://[user[:password]@]host[:port]/path[/][;type=type]\nAn FTP URL, retrieved using the FTP protocol if set ftpproxy isn't defined.  Otherwise,\ntransfer the URL using HTTP via the proxy defined in set ftpproxy.  If set ftpproxy\nisn't defined and user is given, login as user.  In this case, use password if supplied,\notherwise prompt the user for one.\n\nIf a suffix of ‘;type=A’ or ‘;type=I’ is supplied, then the transfer type will take place\nas 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 the\nlast such component, tnftp performs the equivalent of a cd command.  For the last\npath 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 di‐\nrectory name.  This is unlikely to be useful.\n\n••   Any ‘%XX’ codes (per RFC 3986) within the path components are decoded, with XX repre‐\nsenting a character code in hexadecimal.  This decoding takes place after the path\nhas been split into components, but before each component is used in the equivalent\nof a cd or get command.  Some often-used codes are ‘%2F’ (which represents ‘/’) and\n‘%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 user\nor of the ‘anonymous’ user.  If the / directory is required, use a leading path of\n‘%2F’.  If a user's home directory is required (and the remote server supports the\nsyntax), use a leading path of ‘%7Euser/’.  For example, to retrieve /etc/motd from\n‘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 ‘/’\nand where to use ‘%2F’ (or ‘%2f’).  For example, the following URLs correspond to the\nequivalents 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\nftp://host/%2Fdir1%2Fdir2/file    “cd /dir1/dir2”, “get file”.\n\nftp://host/dir1%2Fdir2%2Ffile     “get dir1/dir2/file”.\n\nftp://host/%2Fdir1%2Fdir2%2Ffile  “get /dir1/dir2/file”.\n\n••   You must have appropriate access permission for each of the intermediate directories\nthat 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 used\nas a URL to an HTTP proxy server.  If HTTP authorization is required to retrieve path,\nand user (and optionally password) is in the URL, use them for the first attempt to au‐\nthenticate.\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 to\nauthenticate.  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 element.\nSupported 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 di‐\nrectory as the basename(1) of path.  Note that if a HTTP redirect is received, the fetch is re‐\ntried using the new target URL supplied by the server, with a corresponding new path.  Using an\nexplicit -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 in\ninteractive mode ready for further input.  This will not work if set ftpproxy is being used.\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 as\nwell 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 ABOR\ncommand to the remote server, and discarding any further data received.  The speed at which\nthis is accomplished depends upon the remote server's support for ABOR processing.  If the re‐\nmote server does not support the ABOR command, the prompt will not appear until the remote\nserver has completed sending the requested file.\n\nIf the terminal interrupt key sequence is used whilst tnftp is awaiting a reply from the remote\nserver for the ABOR processing, then the connection will be closed.  This is different from the\ntraditional behaviour (which ignores the terminal interrupt during this phase), but is consid‐\nered more useful.\n",
            "subsections": []
        },
        "FILE NAMING CONVENTIONS": {
            "content": "Files specified as arguments to tnftp commands are processed according to the following rules.\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 spa‐\nces, the argument must be quoted; e.g.  ‘\"| ls -lt\"’.  A particularly useful example of\nthis mechanism is: ‘dir \"\" |more’.\n\n3.   Failing the above checks, if globbing is enabled, local file names are expanded according\nto the rules used in the csh(1); see the glob command.  If the tnftp command expects a\nsingle local file (e.g.  put), only the first filename generated by the globbing operation\nis 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 re‐\nsulting filename may then be altered if runique is on.\n\n5.   For mput commands and put commands with unspecified remote file names, the remote filename\nis the local filename, which may be altered by a ntrans or nmap setting.  The resulting\nfilename 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 may\nbe one of “ascii”, “image” (binary), “ebcdic”, and “local byte size” (for PDP-10's and PDP-20's\nmostly).  tnftp supports the ascii and image types of file transfer, plus local byte size 8 for\ntenex mode transfers.\n\ntnftp supports only the default values for the remaining file transfer parameters: mode, form,\nand struct.\n",
            "subsections": [
                {
                    "name": "THE .netrc FILE",
                    "content": "The .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 speci‐\nfied in the NETRC environment variable.  The following tokens are recognized; they may be sepa‐\nrated by spaces, tabs, or new-lines:\n\nmachine name\nIdentify a remote machine name.  The auto-login process searches the .netrc file for\na machine token that matches the remote machine specified on the tnftp command line\nor as an open command argument.  Once a match is made, the subsequent .netrc tokens\nare processed, stopping when the end of file is reached or another machine or a\ndefault token is encountered.\n\ndefault   This is the same as machine name except that default matches any name.  There can be\nonly one default token, and it must be after all machine tokens.  This is normally\nused as:\n\ndefault login anonymous password user@site\n\nthereby giving the user an automatic anonymous FTP login to machines not specified in\n.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 the\nspecified 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 by\nanyone 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 additional\naccount password, or the auto-login process will initiate an ACCT command if it does\nnot.\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 the\nmachine definition preceding it.  A macdef entry cannot be used by multiple machine\ndefinitions; rather, it must be defined following each machine it is intended to be\nused with.  If a macro named init is defined, it is automatically executed as the\nlast step in the auto-login process.  For example,\n\ndefault\nmacdef init\nepsv4 off\n\nfollowed by a blank line.\n"
                }
            ]
        },
        "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 be\nrecalled and edited with the arrow keys, and other GNU Emacs-style editing keys may be used as\nwell.\n\nThe editline(3) library is configured with a .editrc file — refer to editrc(5) for more infor‐\nmation.\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) com‐\nmand 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 compo‐\nnents if a digit n is given.  If n begins with ‘0’, the number of skipped components\nprecede the trailing component(s) in the format “/<number>trailing” (for ‘%c’) or\n“...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 PROMPT\nfor more information.\n\nFTPRPROMPT     Command-line right side prompt to use.  Defaults to empty string.  Refer to\nCOMMAND 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 is\nport returned by a getservbyname(3) lookup of “ftpgate/tcp”.\n\nFTPUSERAGENT   The value to send for the HTTP User-Agent header.\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 not\nset.\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 authentication\nis required and there is a username and password in this URL, they will automat‐\nically be used in the first attempt to authenticate to the proxy.\n\nIf “unsafe” URL characters are required in the username or password (for example\n‘@’ or ‘/’), encode them with RFC 3986 ‘%XX’ encoding.\n\nNote that the use of a username and password in ftpproxy and httpproxy may be\nincompatible with other programs that use it (such as lynx(1)).\n\nNOTE: this is not used for interactive sessions, only for command-line fetches.\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 not\nto be used.  Each entry may have an optional trailing ‘:port’, which restricts\nthe 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 that\neven 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 The\n.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 ver‐\nsions of this program, depending if the operating system supports IPv6 in a similar manner to\nKAME).\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 ::ffff:10.1.1.1)\nindicate IPv4 destinations which can be handled by AFINET sockets.  However, in certain IPv6\nnetwork configurations, this assumption is not true.  In such an environment, IPv4 mapped ad‐\ndresses must be passed to AFINET6 sockets directly.  For example, if your site uses a SIIT\ntranslator for IPv6-to-IPv4 translation, tnftp is unable to support your configuration.\n\nBSD                             April 25, 2021                             BSD",
            "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": "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 connecting to very old servers that do not implement passive mode properly."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "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": "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 necessary, 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 appropri‐ ate."
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "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": "option has been deprecated as tnftp now tries to use passive mode by default, fall‐ ing back to active mode if the server does not support passive connections."
        },
        {
            "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 speci‐ fied, the increment to increment bytes/second. Refer to rate for more information."
        },
        {
            "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 up‐ loads), and file is one or more local files to be uploaded."
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "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 arguments 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 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. 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 ma‐ chine 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 inter‐ preter. Any defined macros are erased. cr Toggle carriage return stripping during ascii type file retrieval. Records are de‐ noted 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 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. 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 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 unspecified, the current working directory is used. 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 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 otherwise. 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 temporar‐ ily 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 current 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 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. Expansion 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 doing ‘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). 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 charac‐ ters 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 in‐ vocation 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 re‐ placed 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 prompting 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 verify that the last argument is indeed the target local file for receiving mls output. 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 direc‐ tory 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 for‐ mat. 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. Re‐ sulting file names will then be processed according to ntrans and nmap settings. 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 system, 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 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 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 pro‐ cessed according to the ntrans and case settings). Variable templating is accom‐ plished 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 se‐ quence ‘$0’ is replaced by the original filename. Additionally, the sequence “[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 naming conventions or practices. Characters in a filename matching a character in inchars are replaced with the corresponding character in outchars. If the character's po‐ sition 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 au‐ tomatically 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 com‐ mand 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 con‐ trols 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 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. proxy ftp-command Execute an FTP command on a secondary control connection. This command allows si‐ multaneous 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 exe‐ cutable 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 control 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. 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. 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, dis‐ able 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 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 op‐ tions 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 sys‐ tems, 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 sup‐ plied 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 com‐ mand, a ‘.1’ is appended to the name. If the resulting name matches another exist‐ ing file, a ‘.2’ is appended to the original name. If this process continues up to ‘.99’, an error message is printed, and the transfer does not take place. The gen‐ erated 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 com‐ mand when establishing a connection for each data transfer. The use of PORT com‐ mands can prevent delays when performing multiple file transfers. If the PORT com‐ mand fails, tnftp will use the default data port. When the use of PORT commands 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 options 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. site [arg ...] The arguments specified are sent, verbatim, to the remote FTP server as a SITE com‐ mand. 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 re‐ mote 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 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. 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 completes, statistics regarding the efficiency of the transfer are reported. By default, ver‐ bose 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 ap‐ propriately. Commands which take a byte count as an argument (e.g., hash, rate, and xferbuf) support an op‐ tional suffix on the argument which changes the interpretation of the argument. Supported suf‐ fixes 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"
        }
    ]
}