home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnunet10.zip / man / ftp.man next >
Text File  |  1996-07-27  |  29KB  |  627 lines

  1.  
  2. FTP(1)                 UNIX Reference Manual            FTP(1)
  3.  
  4. NAME
  5.      ftp - ARPANET file transfer program
  6.  
  7. SYNOPSIS
  8.      ftp [-v] [-d] [-i] [-n] [-U] [-p] [-g] [host]
  9.  
  10. DESCRIPTION
  11.      Ftp is the user interface to the ARPANET standard File Transfer Protocol.
  12.      The program allows a user to transfer files to and from a remote network
  13.      site.
  14.  
  15.      Options may be specified at the command line, or to the command inter-
  16.      preter.
  17.  
  18.      -v    Verbose option forces ftp to show all responses from the remote
  19.        server, as well as report on data transfer statistics.
  20.  
  21.      -n    Restrains ftp from attempting ``auto-login'' upon initial connec-
  22.        tion.  If auto-login is enabled, ftp will check the .netrc (see be-
  23.        low) file in the user's home directory for an entry describing an
  24.        account on the remote machine.  If no entry exists, ftp will prompt
  25.        for the remote machine login name (default is the user identity on
  26.        the local machine), and, if necessary, prompt for a password and an
  27.        account with which to login.
  28.  
  29.      -i    Turns off interactive prompting during multiple file transfers.
  30.  
  31.      -d    Enables debugging.
  32.  
  33.      -g    Disables file name globbing.
  34.  
  35.      -U    Disable data port range restrictions.
  36.  
  37.      -p    Enable passive mode operation for use behind connection filtering
  38.        firewalls.
  39.  
  40.      The client host with which ftp is to communicate may be specified on the
  41.      command line.  If this is done, ftp will immediately attempt to establish
  42.      a connection to an FTP server on that host; otherwise, ftp will enter its
  43.      command interpreter and await instructions from the user.    When ftp is
  44.      awaiting commands from the user the prompt `ftp>' is provided to the us-
  45.      er.  The following commands are recognized by ftp:
  46.  
  47.      ! [command [args]]
  48.          Invoke an interactive shell on the local machine.  If there
  49.          are arguments, the first is taken to be a command to execute
  50.          directly, with the rest of the arguments as its arguments.
  51.  
  52.      $ macro-name [args]
  53.          Execute the macro macro-name that was defined with the macdef
  54.          command.  Arguments are passed to the macro unglobbed.
  55.  
  56.      account [passwd]
  57.          Supply a supplemental password required by a remote system
  58.          for access to resources once a login has been successfully
  59.          completed.  If no argument is included, the user will be
  60.          prompted for an account password in a non-echoing input mode.
  61.  
  62.      append local-file [remote-file]
  63.          Append a local file to a file on the remote machine.  If
  64.          remote-file is left unspecified, the local file name is used
  65.          in naming the remote file after being altered by any ntrans
  66.          or nmap setting.  File transfer uses the current settings for
  67.          type, format, mode, and structure.
  68.  
  69.      ascii     Set the file transfer type to network ASCII. This is the de-
  70.          fault type.
  71.  
  72.      bell     Arrange that a bell be sounded after each file transfer com-
  73.          mand is completed.
  74.  
  75.      binary     Set the file transfer type to support binary image transfer.
  76.  
  77.      bye     Terminate the FTP session with the remote server and exit
  78.          ftp. An end of file will also terminate the session and exit.
  79.  
  80.      case     Toggle remote computer file name case mapping during mget
  81.          commands.  When case is on (default is off), remote computer
  82.          file names with all letters in upper case are written in the
  83.          local directory with the letters mapped to lower case.
  84.  
  85.      cd remote-directory
  86.          Change the working directory on the remote machine to remote-
  87.          directory.
  88.  
  89.      cdup     Change the remote machine working directory to the parent of
  90.          the current remote machine working directory.
  91.  
  92.      chmod mode file-name
  93.          Change the permission modes of the file file-name on the re-
  94.          mote sytem to mode.
  95.  
  96.      close     Terminate the FTP session with the remote server, and return
  97.          to the command interpreter.  Any defined macros are erased.
  98.  
  99.      cr      Toggle carriage return stripping during ascii type file re-
  100.          trieval.  Records are denoted by a carriage return/linefeed
  101.          sequence during ascii type file transfer.  When cr is on (the
  102.          default), carriage returns are stripped from this sequence to
  103.          conform with the UNIX single linefeed record delimiter.
  104.          Records on non-UNIX remote systems may contain single line-
  105.          feeds; when an ascii type transfer is made, these linefeeds
  106.          may be distinguished from a record delimiter only when cr is
  107.          off.
  108.  
  109.      delete remote-file
  110.          Delete the file remote-file on the remote machine.
  111.  
  112.      debug [debug-value]
  113.          Toggle debugging mode.  If an optional debug-value is speci-
  114.          fied it is used to set the debugging level.  When debugging
  115.          is on, ftp prints each command sent to the remote machine,
  116.          preceded by the string `-->'
  117.  
  118.      dir [remote-directory] [local-file]
  119.          Print a listing of the directory contents in the directory,
  120.          remote-directory, and, optionally, placing the output in
  121.          local-file. If interactive prompting is on, ftp will prompt
  122.          the user to verify that the last argument is indeed the tar-
  123.          get local file for receiving dir output.  If no directory is
  124.          specified, the current working directory on the remote ma-
  125.          chine is used.  If no local file is specified, or local-file
  126.          is -, output comes to the terminal.
  127.  
  128.      disconnect  A synonym for close.
  129.  
  130.      form format
  131.          Set the file transfer form to format. The default format is
  132.  
  133.          ``file''.
  134.  
  135.      get remote-file [local-file]
  136.          Retrieve the remote-file and store it on the local machine.
  137.          If the local file name is not specified, it is given the same
  138.          name it has on the remote machine, subject to alteration by
  139.          the current case, ntrans, and nmap settings.  The current
  140.          settings for type, form, mode, and structure are used while
  141.          transferring the file.
  142.  
  143.      glob     Toggle filename expansion for mdelete, mget and mput. If
  144.          globbing is turned off with glob, the file name arguments are
  145.          taken literally and not expanded.  Globbing for mput is done
  146.          as in csh(1).    For mdelete and mget, each remote file name is
  147.          expanded separately on the remote machine and the lists are
  148.          not merged.  Expansion of a directory name is likely to be
  149.          different from expansion of the name of an ordinary file: the
  150.          exact result depends on the foreign operating system and ftp
  151.          server, and can be previewed by doing `mls remote-files -'
  152.          Note: mget and mput are not meant to transfer entire directo-
  153.          ry subtrees of files.    That can be done by transferring a
  154.          tar(1) archive of the subtree (in binary mode).
  155.  
  156.      hash     Toggle hash-sign (``#'') printing for each data block trans-
  157.          ferred.  The size of a data block is 1024 bytes.
  158.  
  159.      help [command]
  160.          Print an informative message about the meaning of command. If
  161.          no argument is given, ftp prints a list of the known com-
  162.          mands.
  163.  
  164.      idle [seconds]
  165.          Set the inactivity timer on the remote server to seconds sec-
  166.          onds.    If seconds is omitted, the current inactivity timer is
  167.          printed.
  168.  
  169.      lcd [directory]
  170.          Change the working directory on the local machine.  If no
  171.          directory is specified, the user's home directory is used.
  172.  
  173.      ls [remote-directory] [local-file]
  174.          Print a listing of the contents of a directory on the remote
  175.          machine.  The listing includes any system-dependent informa-
  176.          tion that the server chooses to include; for example, most
  177.          UNIX systems will produce output from the command `ls -l'.
  178.          (See also nlist.) If remote-directory is left unspecified,
  179.          the current working directory is used.  If interactive
  180.          prompting is on, ftp will prompt the user to verify that the
  181.          last argument is indeed the target local file for receiving
  182.          ls output.  If no local file is specified, or if local-file
  183.          is `-', the output is sent to the terminal.
  184.  
  185.      macdefNs macro-name
  186.          Define a macro.  Subsequent lines are stored as the macro
  187.          macro-name; a null line (consecutive newline characters in a
  188.          file or carriage returns from the terminal) terminates macro
  189.          input mode.  There is a limit of 16 macros and 4096 total
  190.          characters in all defined macros.  Macros remain defined un-
  191.          til a close command is executed.  The macro processor inter-
  192.          prets `$' and `\' as special characters.  A `$' followed by a
  193.          number (or numbers) is replaced by the corresponding argument
  194.          on the macro invocation command line.    A `$' followed by an
  195.          `i' signals that macro processor that the executing macro is
  196.          to be looped.    On the first pass `$i' is replaced by the
  197.          first argument on the macro invocation command line, on the
  198.          second pass it is replaced by the second argument, and so on.
  199.          A `\' followed by any character is replaced by that charac-
  200.          ter.  Use the `\' to prevent special treatment of the `$'.
  201.  
  202.      mdelete [remote-files]
  203.          Delete the remote-files on the remote machine.
  204.  
  205.      mdir remote-files local-file
  206.          Like dir, except multiple remote files may be specified.  If
  207.          interactive prompting is on, ftp will prompt the user to ver-
  208.          ify that the last argument is indeed the target local file
  209.          for receiving mdir output.
  210.  
  211.      mget remote-files
  212.          Expand the remote-files on the remote machine and do a get
  213.          for each file name thus produced.  See glob for details on
  214.          the filename expansion.  Resulting file names will then be
  215.          processed according to case, ntrans, and nmap settings.
  216.          Files are transferred into the local working directory, which
  217.          can be changed with `lcd directory'; new local directories
  218.          can be created with `! mkdir directory'.
  219.  
  220.      mkdir directory-name
  221.          Make a directory on the remote machine.
  222.  
  223.      mls remote-files local-file
  224.          Like nlist, except multiple remote files may be specified,
  225.          and the local-file must be specified.    If interactive prompt-
  226.          ing is on, ftp will prompt the user to verify that the last
  227.          argument is indeed the target local file for receiving mls
  228.          output.
  229.  
  230.      mode [mode-name]
  231.          Set the file transfer mode to mode-name. The default mode is
  232.          ``stream'' mode.
  233.  
  234.      modtime file-name
  235.          Show the last modification time of the file on the remote ma-
  236.          chine.
  237.  
  238.      mput local-files
  239.          Expand wild cards in the list of local files given as argu-
  240.          ments and do a put for each file in the resulting list.  See
  241.          glob for details of filename expansion.  Resulting file names
  242.          will then be processed according to ntrans and nmap settings.
  243.  
  244.      newer file-name
  245.          Get the file only if the modification time of the remote file
  246.          is more recent that the file on the current system.  If the
  247.          file does not exist on the current system, the remote file is
  248.          considered newer. Otherwise, this command is identical to
  249.          get.
  250.  
  251.      nlist [remote-directory] [local-file]
  252.          Print a  list of the files in a directory on the remote ma-
  253.          chine.  If remote-directory is left unspecified, the current
  254.          working directory is used.  If interactive prompting is on,
  255.          ftp will prompt the user to verify that the last argument is
  256.          indeed the target local file for receiving nlist output.  If
  257.          no local file is specified, or if local-file is -, the output
  258.          is sent to the terminal.
  259.  
  260.      nmap [inpattern outpattern]
  261.          Set or unset the filename mapping mechanism.  If no arguments
  262.          are specified, the filename mapping mechanism is unset.  If
  263.          arguments are specified, remote filenames are mapped during
  264.          mput commands and put commands issued without a specified re-
  265.          mote target filename.    If arguments are specified, local
  266.          filenames are mapped during mget commands and get commands
  267.          issued without a specified local target filename.  This com-
  268.          mand is useful when connecting to a non-UNIX remote computer
  269.          with different file naming conventions or practices.  The
  270.          mapping follows the pattern set by inpattern and outpattern.
  271.          [Inpattern] is a template for incoming filenames (which may
  272.          have already been processed according to the ntrans and case
  273.          settings).  Variable templating is accomplished by including
  274.          the sequences `$1', `$2', ..., `$9' in inpattern. Use `\' to
  275.          prevent this special treatment of the `$' character.  All
  276.          other characters are treated literally, and are used to de-
  277.          termine the nmap [inpattern] variable values.    For example,
  278.          given inpattern $1.$2 and the remote file name "mydata.data",
  279.          $1 would have the value "mydata", and $2 would have the value
  280.          "data".  The outpattern determines the resulting mapped file-
  281.          name.    The sequences `$1', `$2', ...., `$9' are replaced by
  282.          any value resulting from the inpattern template.  The se-
  283.          quence `$0' is replace by the original filename.  Additional-
  284.          ly, the sequence `[seq1, seq2]' is replaced by [seq1] if seq1
  285.          is not a null string; otherwise it is replaced by seq2. For
  286.          example, the command
  287.  
  288.                nmap $1.$2.$3 [$1,$2].[$2,file]
  289.  
  290.          would yield the output filename "myfile.data" for input file-
  291.          names "myfile.data" and "myfile.data.old", "myfile.file" for
  292.          the input filename "myfile", and "myfile.myfile" for the in-
  293.          put filename ".myfile".  Spaces may be included in
  294.          outpattern, as in the example: `nmap $1 sed "s/  *$//" > $1'
  295.          .  Use the `\' character to prevent special treatment of the
  296.          `$','[','[', and `,' characters.
  297.  
  298.      ntrans [inchars [outchars]]
  299.          Set or unset the filename character translation mechanism.
  300.          If no arguments are specified, the filename character trans-
  301.          lation mechanism is unset.  If arguments are specified, char-
  302.          acters in remote filenames are translated during mput com-
  303.          mands and put commands issued without a specified remote tar-
  304.          get filename.    If arguments are specified, characters in lo-
  305.          cal filenames are translated during mget commands and get
  306.          commands issued without a specified local target filename.
  307.          This command is useful when connecting to a non-UNIX remote
  308.          computer with different file naming conventions or practices.
  309.          Characters in a filename matching a character in inchars are
  310.          replaced with the corresponding character in outchars. If the
  311.          character's position in inchars is longer than the length of
  312.          outchars, the character is deleted from the file name.
  313.  
  314.      open host [port]
  315.          Establish a connection to the specified host FTP server.  An
  316.          optional port number may be supplied, in which case, ftp will
  317.          attempt to contact an FTP server at that port.  If the auto-
  318.          login option is on (default), ftp will also attempt to auto-
  319.          matically log the user in to the FTP server (see below).
  320.  
  321.      prompt     Toggle interactive prompting.    Interactive prompting occurs
  322.          during multiple file transfers to allow the user to selec-
  323.          tively retrieve or store files.  If prompting is turned off
  324.          (default is on), any mget or mput will transfer all files,
  325.          and any mdelete will delete all files.
  326.  
  327.      proxy ftp-command
  328.          Execute an ftp command on a secondary control connection.
  329.          This command allows simultaneous connection to two remote ftp
  330.          servers for transferring files between the two servers.  The
  331.          first proxy command should be an open, to establish the sec-
  332.          ondary control connection.  Enter the command "proxy ?" to
  333.          see other ftp commands executable on the secondary connec-
  334.          tion.    The following commands behave differently when pref-
  335.          aced by proxy: open will not define new macros during the au-
  336.          to-login process, close will not erase existing macro defini-
  337.          tions, get and mget transfer files from the host on the pri-
  338.          mary control connection to the host on the secondary control
  339.          connection, and put, mput, and append transfer files from the
  340.          host on the secondary control connection to the host on the
  341.          primary control connection.  Third party file transfers de-
  342.          pend upon support of the ftp protocol PASV command by the
  343.          server on the secondary control connection.
  344.  
  345.      put local-file [remote-file]
  346.          Store a local file on the remote machine.  If remote-file is
  347.          left unspecified, the local file name is used after process-
  348.          ing according to any ntrans or nmap settings in naming the
  349.          remote file.  File transfer uses the current settings for
  350.          type, format, mode, and structure.
  351.  
  352.      pwd     Print the name of the current working directory on the remote
  353.          machine.
  354.  
  355.      quit     A synonym for bye.
  356.  
  357.      quote arg1 arg2 ...
  358.          The arguments specified are sent, verbatim, to the remote FTP
  359.          server.
  360.  
  361.      recv remote-file [local-file]
  362.          A synonym for get.
  363.  
  364.      reget remote-file [local-file]
  365.          Reget acts like get, except that if local-file exists and is
  366.          smaller than remote-file, local-file is presumed to be a par-
  367.          tially transferred copy of remote-file and the transfer is
  368.          continued from the apparent point of failure.    This command
  369.          is useful when transferring very large files over networks
  370.          that are prone to dropping connections.
  371.  
  372.      remotehelp [command-name]
  373.          Request help from the remote FTP server.  If a command-name
  374.          is specified it is supplied to the server as well.
  375.  
  376.      remotestatus [file-name]
  377.          With no arguments, show status of remote machine.  If file-
  378.          name is specified, show status of file-name on remote ma-
  379.          chine.
  380.  
  381.      rename [from] [to]
  382.          Rename the file from on the remote machine, to the file to.
  383.  
  384.      reset     Clear reply queue.  This command re-synchronizes com-
  385.          mand/reply sequencing with the remote ftp server.  Resynchro-
  386.          nization may be necessary following a violation of the ftp
  387.          protocol by the remote server.
  388.  
  389.      restart marker
  390.          Restart the immediately following get or put at the indicated
  391.          marker. On UNIX systems, marker is usually a byte offset into
  392.          the file.
  393.  
  394.      restrict     Toggle data port range restrictions.  When not operating in
  395.          passive mode,    the ftp, client program requests that the re-
  396.          mote server open a connection back to the client host on a
  397.          separate data port.  In previous versions, that remote port
  398.          fell in the range 1024..4999.    However, most firewall setups
  399.          filter that range of TCP ports because other services reside
  400.          there.  The default behavior now is for the client to request
  401.          that the server connect back to the client using the port
  402.          range 40000..44999.  Firewall administrators can chose to al-
  403.          low TCP connections in that range, if they deem it to not be
  404.          a security risk.
  405.  
  406.      rmdir directory-name
  407.          Delete a directory on the remote machine.
  408.  
  409.      runique     Toggle storing of files on the local system with unique file-
  410.          names.  If a file already exists with a name equal to the
  411.          target local filename for a get or mget command, a ".1" is
  412.          appended to the name.    If the resulting name matches another
  413.          existing file, a ".2" is appended to the original name.  If
  414.          this process continues up to ".99", an error message is
  415.          printed, and the transfer does not take place.  The generated
  416.          unique filename will be reported.  Note that runique will not
  417.          affect local files generated from a shell command (see be-
  418.          low).    The default value is off.
  419.  
  420.      send local-file [remote-file]
  421.          A synonym for put.
  422.  
  423.      sendport     Toggle the use of PORT commands.  By default, ftp will at-
  424.          tempt to use a PORT command when establishing a connection
  425.          for each data transfer.  The use of PORT commands can prevent
  426.          delays when performing multiple file transfers.  If the PORT
  427.          command fails, ftp will use the default data port.  When the
  428.          use of PORT commands is disabled, no attempt will be made to
  429.          use PORT commands for each data transfer.  This is useful for
  430.          certain FTP implementations which do ignore PORT commands
  431.          but, incorrectly, indicate they've been accepted.
  432.  
  433.      site arg1 arg2 ...
  434.          The arguments specified are sent, verbatim, to the remote FTP
  435.          server as a SITE command.
  436.  
  437.      size file-name
  438.          Return size of file-name on remote machine.
  439.  
  440.      status     Show the current status of ftp.
  441.  
  442.      struct [struct-name]
  443.          Set the file transfer structure to struct-name. By default
  444.          ``stream'' structure is used.
  445.  
  446.      sunique     Toggle storing of files on remote machine under unique file
  447.          names.  Remote ftp server must support ftp protocol STOU com-
  448.          mand for successful completion.  The remote server will re-
  449.          port unique name.  Default value is off.
  450.  
  451.      system     Show the type of operating system running on the remote ma-
  452.          chine.
  453.  
  454.      tenex     Set the file transfer type to that needed to talk to TENEX
  455.          machines.
  456.  
  457.      trace     Toggle packet tracing.
  458.  
  459.      type [type-name]
  460.          Set the file transfer type to type-name. If no type is speci-
  461.          fied, the current type is printed.  The default type is net-
  462.  
  463.          work ASCII.
  464.  
  465.      umask [newmask]
  466.          Set the default umask on the remote server to newmask. If
  467.          newmask is omitted, the current umask is printed.
  468.  
  469.      user user-name [password] [account]
  470.          Identify yourself to the remote FTP server.  If the password
  471.          is not specified and the server requires it, ftp will prompt
  472.          the user for it (after disabling local echo).    If an account
  473.          field is not specified, and the FTP server requires it, the
  474.          user will be prompted for it.    If an account field is speci-
  475.          fied, an account command will be relayed to the remote server
  476.          after the login sequence is completed if the remote server
  477.          did not require it for logging in.  Unless ftp is invoked
  478.          with ``auto-login'' disabled, this process is done automati-
  479.          cally on initial connection to the FTP server.
  480.  
  481.      verbose     Toggle verbose mode.  In verbose mode, all responses from the
  482.          FTP server are displayed to the user.    In addition, if ver-
  483.          bose is on, when a file transfer completes, statistics re-
  484.          garding the efficiency of the transfer are reported.  By de-
  485.          fault, verbose is on.
  486.  
  487.      ? [command]
  488.          A synonym for help.
  489.  
  490.      Command arguments which have embedded spaces may be quoted with quote `"'
  491.      marks.
  492.  
  493. ABORTING A FILE TRANSFER
  494.      To abort a file transfer, use the terminal interrupt key (usually Ctrl-
  495.      C).  Sending transfers will be immediately halted.  Receiving transfers
  496.      will be halted by sending a ftp protocol ABOR command to the remote serv-
  497.      er, and discarding any further data received.  The speed at which this is
  498.      accomplished depends upon the remote server's support for ABOR process-
  499.      ing.  If the remote server does not support the ABOR command, an `ftp>'
  500.      prompt will not appear until the remote server has completed sending the
  501.      requested file.
  502.  
  503.      The terminal interrupt key sequence will be ignored when ftp has complet-
  504.      ed any local processing and is awaiting a reply from the remote server.
  505.      A long delay in this mode may result from the ABOR processing described
  506.      above, or from unexpected behavior by the remote server, including viola-
  507.      tions of the ftp protocol.  If the delay results from unexpected remote
  508.      server behavior, the local ftp program must be killed by hand.
  509.  
  510. FILE NAMING CONVENTIONS
  511.      Files specified as arguments to ftp commands are processed according to
  512.      the following rules.
  513.  
  514.      1.   If the file name `-' is specified, the stdin (for reading) or stdout
  515.       (for writing) is used.
  516.  
  517.      2.   If the first character of the file name is `|', the remainder of the
  518.       argument is interpreted as a shell command.  Ftp then forks a shell,
  519.       using popen(3) with the argument supplied, and reads (writes) from
  520.       the stdout (stdin).  If the shell command includes spaces, the argu-
  521.       ment must be quoted; e.g.  ``" ls -lt"''.  A particularly useful ex-
  522.       ample of this mechanism is: ``dir more''.
  523.  
  524.      3.   Failing the above checks, if ``globbing'' is enabled, local file
  525.       names are expanded according to the rules used in the csh(1);  c.f.
  526.       the glob command.  If the ftp command expects a single local file
  527.       (.e.g.  put), only the first filename generated by the "globbing"
  528.  
  529.       operation is used.
  530.  
  531.      4.   For mget commands and get commands with unspecified local file
  532.       names, the local filename is the remote filename, which may be al-
  533.       tered by a case, ntrans, or nmap setting.  The resulting filename
  534.       may then be altered if runique is on.
  535.  
  536.      5.   For mput commands and put commands with unspecified remote file
  537.       names, the remote filename is the local filename, which may be al-
  538.       tered by a ntrans or nmap setting.  The resulting filename may then
  539.       be altered by the remote server if sunique is on.
  540.  
  541. FILE TRANSFER PARAMETERS
  542.      The FTP specification specifies many parameters which may affect a file
  543.      transfer.    The type may be one of ``ascii'', ``image'' (binary),
  544.      ``ebcdic'', and ``local byte size'' (for PDP-10's and PDP-20's mostly).
  545.      Ftp supports the ascii and image types of file transfer, plus local byte
  546.      size 8 for tenex mode transfers.
  547.  
  548.      Ftp supports only the default values for the remaining file transfer pa-
  549.      rameters: mode, form, and struct.
  550.  
  551. THE .netrc FILE
  552.      The .netrc file contains login and initialization information used by the
  553.      auto-login process.  It resides in the user's home directory.  The fol-
  554.      lowing tokens are recognized; they may be separated by spaces, tabs, or
  555.      new-lines:
  556.  
  557.      machine name
  558.            Identify a remote machine name. The auto-login process searches
  559.            the .netrc file for a machine token that matches the remote ma-
  560.            chine specified on the ftp command line or as an open command
  561.            argument.  Once a match is made, the subsequent .netrc tokens
  562.            are processed, stopping when the end of file is reached or an-
  563.            other machine or a default token is encountered.
  564.  
  565.      default   This is the same as machine name except that default matches
  566.            any name.  There can be only one default token, and it must be
  567.            after all machine tokens.  This is normally used as:
  568.  
  569.              default login anonymous password user@site
  570.  
  571.            thereby giving the user automatic anonymous ftp login to ma-
  572.            chines not specified in .netrc. This can be overridden by using
  573.            the -n flag to disable auto-login.
  574.  
  575.      login name
  576.            Identify a user on the remote machine.  If this token is pre-
  577.            sent, the auto-login process will initiate a login using the
  578.            specified name.
  579.  
  580.      password string
  581.            Supply a password.  If this token is present, the auto-login
  582.            process will supply the specified string if the remote server
  583.            requires a password as part of the login process.  Note that if
  584.            this token is present in the .netrc file for any user other
  585.            than anonymous, ftp will abort the auto-login process if the
  586.            .netrc is readable by anyone besides the user.
  587.  
  588.      account string
  589.            Supply an additional account password.  If this token is pre-
  590.            sent, the auto-login process will supply the specified string
  591.            if the remote server requires an additional account password,
  592.            or the auto-login process will initiate an ACCT command if it
  593.  
  594.            does not.
  595.  
  596.      macdef name
  597.            Define a macro.    This token functions like the ftp macdef com-
  598.            mand functions.    A macro is defined with the specified name;
  599.            its contents begin with the next .netrc line and continue until
  600.            a null line (consecutive new-line characters) is encountered.
  601.            If a macro named init is defined, it is automatically executed
  602.            as the last step in the auto-login process.
  603.  
  604. ENVIRONMENT
  605.      Ftp utilizes the following environment variables.
  606.  
  607.      HOME     For default location of a .netrc file, if one exists.
  608.  
  609.      SHELL     For default shell.
  610.  
  611. SEE ALSO
  612.      ftpd(8)
  613.  
  614. HISTORY
  615.      The ftp command appeared in 4.2BSD.
  616.  
  617. BUGS
  618.      Correct execution of many commands depends upon proper behavior by the
  619.      remote server.
  620.  
  621.      An error in the treatment of carriage returns in the 4.2BSD ascii-mode
  622.      transfer code has been corrected.    This correction may result in incor-
  623.      rect transfers of binary files to and from 4.2BSD servers using the ascii
  624.      type.  Avoid this problem by using the binary image type.
  625.  
  626. 4.2 Berkeley Distribution      December 30, 1993                10
  627.