- Complete re-write of sasc.
[dragonfly.git] / crypto / heimdal / appl / ftp / ftp / ftp.cat1
1 FTP(1)                      NetBSD Reference Manual                     FTP(1)
2
3 N\bNA\bAM\bME\bE
4      f\bft\btp\bp - ARPANET file transfer program
5
6 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
7      f\bft\btp\bp [-\b-t\bt] [-\b-v\bv] [-\b-d\bd] [-\b-i\bi] [-\b-n\bn] [-\b-g\bg] [-\b-p\bp] [-\b-l\bl] [_\bh_\bo_\bs_\bt]
8
9 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
10      F\bFt\btp\bp is the user interface to the ARPANET standard File Transfer Protocol.
11      The program allows a user to transfer files to and from a remote network
12      site.
13
14      Modifications has been made so that it almost follows the ftpsec Internet
15      draft.
16
17      Options may be specified at the command line, or to the command inter-
18      preter.
19
20      -\b-t\bt    Enables packet tracing.
21
22      -\b-v\bv    Verbose option forces f\bft\btp\bp to show all responses from the remote
23            server, as well as report on data transfer statistics.
24
25      -\b-n\bn    Restrains f\bft\btp\bp from attempting ``auto-login'' upon initial connec-
26            tion.  If auto-login is enabled, f\bft\btp\bp will check the _\b._\bn_\be_\bt_\br_\bc (see be-
27            low) file in the user's home directory for an entry describing an
28            account on the remote machine.  If no entry exists, f\bft\btp\bp will prompt
29            for the remote machine login name (default is the user identity on
30            the local machine), and, if necessary, prompt for a password and an
31            account with which to login.
32
33      -\b-i\bi    Turns off interactive prompting during multiple file transfers.
34
35      -\b-p\bp    Turn on passive mode.
36
37      -\b-d\bd    Enables debugging.
38
39      -\b-g\bg    Disables file name globbing.
40
41      -\b-l\bl    Disables command line editing.
42
43      The client host with which f\bft\btp\bp is to communicate may be specified on the
44      command line.  If this is done, f\bft\btp\bp will immediately attempt to establish
45      a connection to an FTP server on that host; otherwise, f\bft\btp\bp will enter its
46      command interpreter and await instructions from the user.  When f\bft\btp\bp is
47      awaiting commands from the user the prompt `ftp>' is provided to the us-
48      er.  The following commands are recognized by f\bft\btp\bp:
49
50      !\b! [_\bc_\bo_\bm_\bm_\ba_\bn_\bd [_\ba_\br_\bg_\bs]]
51                  Invoke an interactive shell on the local machine.  If there
52                  are arguments, the first is taken to be a command to execute
53                  directly, with the rest of the arguments as its arguments.
54
55      $\b$ _\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be [_\ba_\br_\bg_\bs]
56                  Execute the macro _\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be that was defined with the m\bma\bac\bcd\bde\bef\bf
57                  command.  Arguments are passed to the macro unglobbed.
58
59      a\bac\bcc\bco\bou\bun\bnt\bt [_\bp_\ba_\bs_\bs_\bw_\bd]
60                  Supply a supplemental password required by a remote system
61                  for access to resources once a login has been successfully
62                  completed.  If no argument is included, the user will be
63                  prompted for an account password in a non-echoing input mode.
64
65      a\bap\bpp\bpe\ben\bnd\bd _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be]
66                  Append a local file to a file on the remote machine.  If
67                  _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be is left unspecified, the local file name is used
68                  in naming the remote file after being altered by any n\bnt\btr\bra\ban\bns\bs
69                  or n\bnm\bma\bap\bp setting.  File transfer uses the current settings for
70                  t\bty\byp\bpe\be, f\bfo\bor\brm\bma\bat\bt, m\bmo\bod\bde\be, and s\bst\btr\bru\buc\bct\btu\bur\bre\be.
71
72      a\bas\bsc\bci\bii\bi       Set the file transfer t\bty\byp\bpe\be to network ASCII.  This is the de-
73                  fault type.
74
75      b\bbe\bel\bll\bl        Arrange that a bell be sounded after each file transfer com-
76                  mand is completed.
77
78      b\bbi\bin\bna\bar\bry\by      Set the file transfer t\bty\byp\bpe\be to support binary image transfer.
79
80      b\bby\bye\be         Terminate the FTP session with the remote server and exit
81                  f\bft\btp\bp.  An end of file will also terminate the session and ex-
82                  it.
83
84      c\bca\bas\bse\be        Toggle remote computer file name case mapping during m\bmg\bge\bet\bt
85                  commands.  When c\bca\bas\bse\be is on (default is off), remote computer
86                  file names with all letters in upper case are written in the
87                  local directory with the letters mapped to lower case.
88
89      c\bcd\bd _\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by
90                  Change the working directory on the remote machine to _\br_\be_\bm_\bo_\bt_\be_\b-
91                  _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by.
92
93      c\bcd\bdu\bup\bp        Change the remote machine working directory to the parent of
94                  the current remote machine working directory.
95
96      c\bch\bhm\bmo\bod\bd _\bm_\bo_\bd_\be _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
97                  Change the permission modes of the file _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be on the re-
98                  mote sytem to _\bm_\bo_\bd_\be.
99
100      c\bcl\blo\bos\bse\be       Terminate the FTP session with the remote server, and return
101                  to the command interpreter.  Any defined macros are erased.
102
103      c\bcr\br          Toggle carriage return stripping during ascii type file re-
104                  trieval.  Records are denoted by a carriage return/linefeed
105                  sequence during ascii type file transfer.  When c\bcr\br is on (the
106                  default), carriage returns are stripped from this sequence to
107                  conform with the UNIX single linefeed record delimiter.
108                  Records on non-UNIX remote systems may contain single line-
109                  feeds; when an ascii type transfer is made, these linefeeds
110                  may be distinguished from a record delimiter only when c\bcr\br is
111                  off.
112
113      d\bde\bel\ble\bet\bte\be _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be
114                  Delete the file _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be on the remote machine.
115
116      d\bde\beb\bbu\bug\bg [_\bd_\be_\bb_\bu_\bg_\b-_\bv_\ba_\bl_\bu_\be]
117                  Toggle debugging mode.  If an optional _\bd_\be_\bb_\bu_\bg_\b-_\bv_\ba_\bl_\bu_\be is speci-
118                  fied it is used to set the debugging level.  When debugging
119                  is on, f\bft\btp\bp prints each command sent to the remote machine,
120                  preceded by the string `-->'
121
122      d\bdi\bir\br [_\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
123                  Print a listing of the directory contents in the directory,
124                  _\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by, and, optionally, placing the output in
125                  _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be.  If interactive prompting is on, f\bft\btp\bp will prompt
126                  the user to verify that the last argument is indeed the tar-
127                  get local file for receiving d\bdi\bir\br output.  If no directory is
128                  specified, the current working directory on the remote ma-
129                  chine is used.  If no local file is specified, or _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
130                  is -\b-, output comes to the terminal.
131
132      d\bdi\bis\bsc\bco\bon\bnn\bne\bec\bct\bt  A synonym for _\bc_\bl_\bo_\bs_\be.
133
134      f\bfo\bor\brm\bm _\bf_\bo_\br_\bm_\ba_\bt
135                  Set the file transfer f\bfo\bor\brm\bm to _\bf_\bo_\br_\bm_\ba_\bt.  The default format is
136                  ``file''.
137
138      g\bge\bet\bt _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
139                  Retrieve the _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be and store it on the local machine.
140                  If the local file name is not specified, it is given the same
141                  name it has on the remote machine, subject to alteration by
142                  the current c\bca\bas\bse\be, n\bnt\btr\bra\ban\bns\bs, and n\bnm\bma\bap\bp settings.  The current
143                  settings for t\bty\byp\bpe\be, f\bfo\bor\brm\bm, m\bmo\bod\bde\be, and s\bst\btr\bru\buc\bct\btu\bur\bre\be are used while
144                  transferring the file.
145
146      g\bgl\blo\bob\bb        Toggle filename expansion for m\bmd\bde\bel\ble\bet\bte\be, m\bmg\bge\bet\bt and m\bmp\bpu\but\bt.  If
147                  globbing is turned off with g\bgl\blo\bob\bb, the file name arguments are
148                  taken literally and not expanded.  Globbing for m\bmp\bpu\but\bt is done
149                  as in csh(1).  For m\bmd\bde\bel\ble\bet\bte\be and m\bmg\bge\bet\bt, each remote file name is
150                  expanded separately on the remote machine and the lists are
151                  not merged.  Expansion of a directory name is likely to be
152                  different from expansion of the name of an ordinary file: the
153                  exact result depends on the foreign operating system and ftp
154                  server, and can be previewed by doing `mls remote-files -'.
155                  As a security measure, remotely globbed files that starts
156                  with `/' or contains `../', will not be automatically re-
157                  ceived. If you have interactive prompting turned off, these
158                  filenames will be ignored.  Note: m\bmg\bge\bet\bt and m\bmp\bpu\but\bt are not meant
159                  to transfer entire directory subtrees of files.  That can be
160                  done by transferring a tar(1) archive of the subtree (in bi-
161                  nary mode).
162
163      h\bha\bas\bsh\bh        Toggle hash-sign (``#'') printing for each data block trans-
164                  ferred.  The size of a data block is 1024 bytes.
165
166      h\bhe\bel\blp\bp [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
167                  Print an informative message about the meaning of _\bc_\bo_\bm_\bm_\ba_\bn_\bd.
168                  If no argument is given, f\bft\btp\bp prints a list of the known com-
169                  mands.
170
171      i\bid\bdl\ble\be [_\bs_\be_\bc_\bo_\bn_\bd_\bs]
172                  Set the inactivity timer on the remote server to _\bs_\be_\bc_\bo_\bn_\bd_\bs sec-
173                  onds.  If _\bs_\be_\bc_\bo_\bn_\bd_\bs is omitted, the current inactivity timer is
174                  printed.
175
176      l\blc\bcd\bd [_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by]
177                  Change the working directory on the local machine.  If no
178                  _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by is specified, the user's home directory is used.
179
180      l\bls\bs [_\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
181                  Print a listing of the contents of a directory on the remote
182                  machine.  The listing includes any system-dependent informa-
183                  tion that the server chooses to include; for example, most
184                  UNIX systems will produce output from the command `ls -l'.
185                  (See also n\bnl\bli\bis\bst\bt.) If _\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by is left unspecified,
186                  the current working directory is used.  If interactive
187                  prompting is on, f\bft\btp\bp will prompt the user to verify that the
188                  last argument is indeed the target local file for receiving
189                  l\bls\bs output.  If no local file is specified, or if _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
190                  is `-\b-', the output is sent to the terminal.
191
192      m\bma\bac\bcd\bde\bef\bf _\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be
193                  Define a macro.  Subsequent lines are stored as the macro
194                  _\bm_\ba_\bc_\br_\bo_\b-_\bn_\ba_\bm_\be; a null line (consecutive newline characters in a
195                  file or carriage returns from the terminal) terminates macro
196                  input mode.  There is a limit of 16 macros and 4096 total
197                  characters in all defined macros.  Macros remain defined un-
198                  til a c\bcl\blo\bos\bse\be command is executed.  The macro processor inter-
199                  prets `$' and `\' as special characters.  A `$' followed by a
200                  number (or numbers) is replaced by the corresponding argument
201                  on the macro invocation command line.  A `$' followed by an
202                  `i' signals that macro processor that the executing macro is
203                  to be looped.  On the first pass `$i' is replaced by the
204                  first argument on the macro invocation command line, on the
205                  second pass it is replaced by the second argument, and so on.
206                  A `\' followed by any character is replaced by that charac-
207                  ter.  Use the `\' to prevent special treatment of the `$'.
208
209      m\bmd\bde\bel\ble\bet\bte\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs]
210                  Delete the _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs on the remote machine.
211
212      m\bmd\bdi\bir\br _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
213                  Like d\bdi\bir\br, except multiple remote files may be specified.  If
214                  interactive prompting is on, f\bft\btp\bp will prompt the user to ver-
215                  ify that the last argument is indeed the target local file
216                  for receiving m\bmd\bdi\bir\br output.
217
218      m\bmg\bge\bet\bt _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs
219                  Expand the _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs on the remote machine and do a g\bge\bet\bt
220                  for each file name thus produced.  See g\bgl\blo\bob\bb for details on
221                  the filename expansion.  Resulting file names will then be
222                  processed according to c\bca\bas\bse\be, n\bnt\btr\bra\ban\bns\bs, and n\bnm\bma\bap\bp settings.
223                  Files are transferred into the local working directory, which
224                  can be changed with `lcd directory'; new local directories
225                  can be created with `! mkdir directory'.
226
227      m\bmk\bkd\bdi\bir\br _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by_\b-_\bn_\ba_\bm_\be
228                  Make a directory on the remote machine.
229
230      m\bml\bls\bs _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be_\bs _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be
231                  Like n\bnl\bli\bis\bst\bt, except multiple remote files may be specified,
232                  and the _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be must be specified.  If interactive prompt-
233                  ing is on, f\bft\btp\bp will prompt the user to verify that the last
234                  argument is indeed the target local file for receiving m\bml\bls\bs
235                  output.
236
237      m\bmo\bod\bde\be [_\bm_\bo_\bd_\be_\b-_\bn_\ba_\bm_\be]
238                  Set the file transfer m\bmo\bod\bde\be to _\bm_\bo_\bd_\be_\b-_\bn_\ba_\bm_\be.  The default mode is
239                  ``stream'' mode.
240
241      m\bmo\bod\bdt\bti\bim\bme\be _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
242                  Show the last modification time of the file on the remote ma-
243                  chine.
244
245      m\bmp\bpu\but\bt _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be_\bs
246                  Expand wild cards in the list of local files given as argu-
247                  ments and do a p\bpu\but\bt for each file in the resulting list.  See
248                  g\bgl\blo\bob\bb for details of filename expansion.  Resulting file names
249                  will then be processed according to n\bnt\btr\bra\ban\bns\bs and n\bnm\bma\bap\bp settings.
250
251      n\bne\bew\bwe\ber\br _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
252                  Get the file only if the modification time of the remote file
253                  is more recent that the file on the current system.  If the
254                  file does not exist on the current system, the remote file is
255                  considered n\bne\bew\bwe\ber\br.  Otherwise, this command is identical to
256                  _\bg_\be_\bt.
257
258      n\bnl\bli\bis\bst\bt [_\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by] [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
259                  Print a  list of the files in a directory on the remote ma-
260                  chine.  If _\br_\be_\bm_\bo_\bt_\be_\b-_\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by is left unspecified, the current
261                  working directory is used.  If interactive prompting is on,
262                  f\bft\btp\bp will prompt the user to verify that the last argument is
263                  indeed the target local file for receiving n\bnl\bli\bis\bst\bt output.  If
264                  no local file is specified, or if _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be is -\b-, the output
265                  is sent to the terminal.
266
267      n\bnm\bma\bap\bp [_\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn _\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn]
268                  Set or unset the filename mapping mechanism.  If no arguments
269                  are specified, the filename mapping mechanism is unset.  If
270                  arguments are specified, remote filenames are mapped during
271                  m\bmp\bpu\but\bt commands and p\bpu\but\bt commands issued without a specified re-
272                  mote target filename.  If arguments are specified, local
273                  filenames are mapped during m\bmg\bge\bet\bt commands and g\bge\bet\bt commands
274                  issued without a specified local target filename.  This com-
275                  mand is useful when connecting to a non-UNIX remote computer
276                  with different file naming conventions or practices.  The
277                  mapping follows the pattern set by _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn and _\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn.
278                  [_\bI_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn] is a template for incoming filenames (which may
279                  have already been processed according to the n\bnt\btr\bra\ban\bns\bs and c\bca\bas\bse\be
280                  settings).  Variable templating is accomplished by including
281                  the sequences `$1', `$2', ..., `$9' in _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn.  Use `\' to
282                  prevent this special treatment of the `$' character.  All
283                  other characters are treated literally, and are used to de-
284                  termine the n\bnm\bma\bap\bp [_\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn] variable values.  For example,
285                  given _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn $1.$2 and the remote file name "mydata.data",
286                  $1 would have the value "mydata", and $2 would have the value
287                  "data".  The _\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn determines the resulting mapped file-
288                  name.  The sequences `$1', `$2', ...., `$9' are replaced by
289                  any value resulting from the _\bi_\bn_\bp_\ba_\bt_\bt_\be_\br_\bn template.  The se-
290                  quence `$0' is replace by the original filename.  Additional-
291                  ly, the sequence `[_\bs_\be_\bq_\b1, _\bs_\be_\bq_\b2]' is replaced by [_\bs_\be_\bq_\b1] if _\bs_\be_\bq_\b1
292                  is not a null string; otherwise it is replaced by _\bs_\be_\bq_\b2.  For
293                  example, the command
294
295                        nmap $1.$2.$3 [$1,$2].[$2,file]
296
297                  would yield the output filename "myfile.data" for input file-
298                  names "myfile.data" and "myfile.data.old", "myfile.file" for
299                  the input filename "myfile", and "myfile.myfile" for the in-
300                  put filename ".myfile".  Spaces may be included in
301                  _\bo_\bu_\bt_\bp_\ba_\bt_\bt_\be_\br_\bn, as in the example: `nmap $1 sed "s/  *$//" > $1'
302                  .  Use the `\' character to prevent special treatment of the
303                  `$','[','[', and `,' characters.
304
305      n\bnt\btr\bra\ban\bns\bs [_\bi_\bn_\bc_\bh_\ba_\br_\bs [_\bo_\bu_\bt_\bc_\bh_\ba_\br_\bs]]
306                  Set or unset the filename character translation mechanism.
307                  If no arguments are specified, the filename character trans-
308                  lation mechanism is unset.  If arguments are specified, char-
309                  acters in remote filenames are translated during m\bmp\bpu\but\bt com-
310                  mands and p\bpu\but\bt commands issued without a specified remote tar-
311                  get filename.  If arguments are specified, characters in lo-
312                  cal filenames are translated during m\bmg\bge\bet\bt commands and g\bge\bet\bt
313                  commands issued without a specified local target filename.
314                  This command is useful when connecting to a non-UNIX remote
315                  computer with different file naming conventions or practices.
316                  Characters in a filename matching a character in _\bi_\bn_\bc_\bh_\ba_\br_\bs are
317                  replaced with the corresponding character in _\bo_\bu_\bt_\bc_\bh_\ba_\br_\bs.  If
318                  the character's position in _\bi_\bn_\bc_\bh_\ba_\br_\bs is longer than the length
319                  of _\bo_\bu_\bt_\bc_\bh_\ba_\br_\bs, the character is deleted from the file name.
320
321      o\bop\bpe\ben\bn _\bh_\bo_\bs_\bt [_\bp_\bo_\br_\bt]
322                  Establish a connection to the specified _\bh_\bo_\bs_\bt FTP server.  An
323                  optional port number may be supplied, in which case, f\bft\btp\bp will
324                  attempt to contact an FTP server at that port.  If the a\bau\but\bto\bo-\b-
325                  l\blo\bog\bgi\bin\bn option is on (default), f\bft\btp\bp will also attempt to auto-
326                  matically log the user in to the FTP server (see below).
327
328      p\bpa\bas\bss\bsi\biv\bve\be     Toggle passive mode.  If passive mode is turned on (default
329                  is off), the ftp client will send a PASV command for all data
330                  connections instead of the usual PORT command.  The PASV com-
331                  mand requests that the remote server open a port for the data
332                  connection and return the address of that port.  The remote
333                  server listens on that port and the client connects to it.
334                  When using the more traditional PORT command, the client lis-
335                  tens on a port and sends that address to the remote server,
336                  who connects back to it.  Passive mode is useful when using
337                  f\bft\btp\bp through a gateway router or host that controls the direc-
338                  tionality of traffic.  (Note that though ftp servers are re-
339                  quired to support the PASV command by RFC 1123, some do not.)
340
341      p\bpr\bro\bom\bmp\bpt\bt      Toggle interactive prompting.  Interactive prompting occurs
342                  during multiple file transfers to allow the user to selec-
343                  tively retrieve or store files.  If prompting is turned off
344                  (default is on), any m\bmg\bge\bet\bt or m\bmp\bpu\but\bt will transfer all files,
345                  and any m\bmd\bde\bel\ble\bet\bte\be will delete all files.
346
347      p\bpr\bro\box\bxy\by _\bf_\bt_\bp_\b-_\bc_\bo_\bm_\bm_\ba_\bn_\bd
348                  Execute an ftp command on a secondary control connection.
349                  This command allows simultaneous connection to two remote ftp
350                  servers for transferring files between the two servers.  The
351                  first p\bpr\bro\box\bxy\by command should be an o\bop\bpe\ben\bn, to establish the sec-
352                  ondary control connection.  Enter the command "proxy ?" to
353                  see other ftp commands executable on the secondary connec-
354                  tion.  The following commands behave differently when pref-
355                  aced by p\bpr\bro\box\bxy\by: o\bop\bpe\ben\bn will not define new macros during the au-
356                  to-login process, c\bcl\blo\bos\bse\be will not erase existing macro defini-
357                  tions, g\bge\bet\bt and m\bmg\bge\bet\bt transfer files from the host on the pri-
358                  mary control connection to the host on the secondary control
359                  connection, and p\bpu\but\bt, m\bmp\bpu\but\bt, and a\bap\bpp\bpe\ben\bnd\bd transfer files from the
360                  host on the secondary control connection to the host on the
361                  primary control connection.  Third party file transfers de-
362                  pend upon support of the ftp protocol PASV command by the
363                  server on the secondary control connection.
364
365      p\bpu\but\bt _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be]
366                  Store a local file on the remote machine.  If _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be is
367                  left unspecified, the local file name is used after process-
368                  ing according to any n\bnt\btr\bra\ban\bns\bs or n\bnm\bma\bap\bp settings in naming the
369                  remote file.  File transfer uses the current settings for
370                  t\bty\byp\bpe\be, f\bfo\bor\brm\bma\bat\bt, m\bmo\bod\bde\be, and s\bst\btr\bru\buc\bct\btu\bur\bre\be.
371
372      p\bpw\bwd\bd         Print the name of the current working directory on the remote
373                  machine.
374
375      q\bqu\bui\bit\bt        A synonym for b\bby\bye\be.
376
377      q\bqu\buo\bot\bte\be _\ba_\br_\bg_\b1 _\ba_\br_\bg_\b2 _\b._\b._\b.
378                  The arguments specified are sent, verbatim, to the remote FTP
379                  server.
380
381      r\bre\bec\bcv\bv _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
382                  A synonym for get.
383
384      r\bre\beg\bge\bet\bt _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be [_\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be]
385                  Reget acts like get, except that if _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be exists and is
386                  smaller than _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be, _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be is presumed to be a par-
387                  tially transferred copy of _\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be and the transfer is
388                  continued from the apparent point of failure.  This command
389                  is useful when transferring very large files over networks
390                  that are prone to dropping connections.
391
392      r\bre\bem\bmo\bot\bte\beh\bhe\bel\blp\bp [_\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b-_\bn_\ba_\bm_\be]
393                  Request help from the remote FTP server.  If a _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b-_\bn_\ba_\bm_\be
394                  is specified it is supplied to the server as well.
395
396      r\bre\bem\bmo\bot\bte\bes\bst\bta\bat\btu\bus\bs [_\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be]
397                  With no arguments, show status of remote machine.  If _\bf_\bi_\bl_\be_\b-
398                  _\bn_\ba_\bm_\be is specified, show status of _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be on remote ma-
399                  chine.
400
401      r\bre\ben\bna\bam\bme\be [_\bf_\br_\bo_\bm] [_\bt_\bo]
402                  Rename the file _\bf_\br_\bo_\bm on the remote machine, to the file _\bt_\bo.
403
404      r\bre\bes\bse\bet\bt       Clear reply queue.  This command re-synchronizes command/re-
405                  ply sequencing with the remote ftp server.  Resynchronization
406                  may be necessary following a violation of the ftp protocol by
407                  the remote server.
408
409      r\bre\bes\bst\bta\bar\brt\bt _\bm_\ba_\br_\bk_\be_\br
410                  Restart the immediately following g\bge\bet\bt or p\bpu\but\bt at the indicated
411                  _\bm_\ba_\br_\bk_\be_\br.  On UNIX systems, marker is usually a byte offset in-
412                  to the file.
413
414      r\brm\bmd\bdi\bir\br _\bd_\bi_\br_\be_\bc_\bt_\bo_\br_\by_\b-_\bn_\ba_\bm_\be
415                  Delete a directory on the remote machine.
416
417      r\bru\bun\bni\biq\bqu\bue\be     Toggle storing of files on the local system with unique file-
418                  names.  If a file already exists with a name equal to the
419                  target local filename for a g\bge\bet\bt or m\bmg\bge\bet\bt command, a ".1" is
420                  appended to the name.  If the resulting name matches another
421                  existing file, a ".2" is appended to the original name.  If
422                  this process continues up to ".99", an error message is
423                  printed, and the transfer does not take place.  The generated
424                  unique filename will be reported.  Note that r\bru\bun\bni\biq\bqu\bue\be will not
425                  affect local files generated from a shell command (see be-
426                  low).  The default value is off.
427
428      s\bse\ben\bnd\bd _\bl_\bo_\bc_\ba_\bl_\b-_\bf_\bi_\bl_\be [_\br_\be_\bm_\bo_\bt_\be_\b-_\bf_\bi_\bl_\be]
429                  A synonym for put.
430
431      s\bse\ben\bnd\bdp\bpo\bor\brt\bt    Toggle the use of PORT commands.  By default, f\bft\btp\bp will at-
432                  tempt to use a PORT command when establishing a connection
433                  for each data transfer.  The use of PORT commands can prevent
434                  delays when performing multiple file transfers.  If the PORT
435                  command fails, f\bft\btp\bp will use the default data port.  When the
436                  use of PORT commands is disabled, no attempt will be made to
437                  use PORT commands for each data transfer.  This is useful for
438                  certain FTP implementations which do ignore PORT commands
439                  but, incorrectly, indicate they've been accepted.
440
441      s\bsi\bit\bte\be _\ba_\br_\bg_\b1 _\ba_\br_\bg_\b2 _\b._\b._\b.
442                  The arguments specified are sent, verbatim, to the remote FTP
443                  server as a SITE command.
444
445      s\bsi\biz\bze\be _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be
446                  Return size of _\bf_\bi_\bl_\be_\b-_\bn_\ba_\bm_\be on remote machine.
447
448      s\bst\bta\bat\btu\bus\bs      Show the current status of f\bft\btp\bp.
449
450      s\bst\btr\bru\buc\bct\bt [_\bs_\bt_\br_\bu_\bc_\bt_\b-_\bn_\ba_\bm_\be]
451                  Set the file transfer _\bs_\bt_\br_\bu_\bc_\bt_\bu_\br_\be to _\bs_\bt_\br_\bu_\bc_\bt_\b-_\bn_\ba_\bm_\be.  By default
452                  ``stream'' structure is used.
453
454      s\bsu\bun\bni\biq\bqu\bue\be     Toggle storing of files on remote machine under unique file
455                  names.  Remote ftp server must support ftp protocol STOU com-
456                  mand for successful completion.  The remote server will re-
457                  port unique name.  Default value is off.
458
459      s\bsy\bys\bst\bte\bem\bm      Show the type of operating system running on the remote ma-
460                  chine.
461
462      t\bte\ben\bne\bex\bx       Set the file transfer type to that needed to talk to TENEX
463                  machines.
464
465      t\btr\bra\bac\bce\be       Toggle packet tracing.
466
467      t\bty\byp\bpe\be [_\bt_\by_\bp_\be_\b-_\bn_\ba_\bm_\be]
468                  Set the file transfer t\bty\byp\bpe\be to _\bt_\by_\bp_\be_\b-_\bn_\ba_\bm_\be.  If no type is spec-
469                  ified, the current type is printed.  The default type is net-
470                  work ASCII.
471
472      u\bum\bma\bas\bsk\bk [_\bn_\be_\bw_\bm_\ba_\bs_\bk]
473                  Set the default umask on the remote server to _\bn_\be_\bw_\bm_\ba_\bs_\bk.  If
474                  _\bn_\be_\bw_\bm_\ba_\bs_\bk is omitted, the current umask is printed.
475
476      u\bus\bse\ber\br _\bu_\bs_\be_\br_\b-_\bn_\ba_\bm_\be [_\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd] [_\ba_\bc_\bc_\bo_\bu_\bn_\bt]
477                  Identify yourself to the remote FTP server.  If the _\bp_\ba_\bs_\bs_\bw_\bo_\br_\bd
478                  is not specified and the server requires it, f\bft\btp\bp will prompt
479                  the user for it (after disabling local echo).  If an _\ba_\bc_\bc_\bo_\bu_\bn_\bt
480                  field is not specified, and the FTP server requires it, the
481                  user will be prompted for it.  If an _\ba_\bc_\bc_\bo_\bu_\bn_\bt field is speci-
482                  fied, an account command will be relayed to the remote server
483                  after the login sequence is completed if the remote server
484                  did not require it for logging in.  Unless f\bft\btp\bp is invoked
485                  with ``auto-login'' disabled, this process is done automati-
486                  cally on initial connection to the FTP server.
487
488      v\bve\ber\brb\bbo\bos\bse\be     Toggle verbose mode.  In verbose mode, all responses from the
489                  FTP server are displayed to the user.  In addition, if ver-
490                  bose is on, when a file transfer completes, statistics re-
491                  garding the efficiency of the transfer are reported.  By de-
492                  fault, verbose is on.
493
494      ?\b? [_\bc_\bo_\bm_\bm_\ba_\bn_\bd]
495                  A synonym for help.
496
497      The following command can be used with ftpsec-aware servers.
498
499      p\bpr\bro\bot\bt _\bc_\bl_\be_\ba_\br | _\bs_\ba_\bf_\be | _\bc_\bo_\bn_\bf_\bi_\bd_\be_\bn_\bt_\bi_\ba_\bl | _\bp_\br_\bi_\bv_\ba_\bt_\be
500                  Set the data protection level to the requested level.
501
502      The following command can be used with ftp servers that has implemented
503      the KAUTH site command.
504
505      k\bka\bau\but\bth\bh [_\bp_\br_\bi_\bn_\bc_\bi_\bp_\ba_\bl]
506                  Obtain remote tickets.
507
508      Command arguments which have embedded spaces may be quoted with quote `"'
509      marks.
510
511 A\bAB\bBO\bOR\bRT\bTI\bIN\bNG\bG A\bA F\bFI\bIL\bLE\bE T\bTR\bRA\bAN\bNS\bSF\bFE\bER\bR
512      To abort a file transfer, use the terminal interrupt key (usually Ctrl-
513      C).  Sending transfers will be immediately halted.  Receiving transfers
514      will be halted by sending a ftp protocol ABOR command to the remote serv-
515      er, and discarding any further data received.  The speed at which this is
516      accomplished depends upon the remote server's support for ABOR process-
517      ing.  If the remote server does not support the ABOR command, an `ftp>'
518      prompt will not appear until the remote server has completed sending the
519      requested file.
520
521      The terminal interrupt key sequence will be ignored when f\bft\btp\bp has complet-
522      ed any local processing and is awaiting a reply from the remote server.
523      A long delay in this mode may result from the ABOR processing described
524      above, or from unexpected behavior by the remote server, including viola-
525      tions of the ftp protocol.  If the delay results from unexpected remote
526      server behavior, the local f\bft\btp\bp program must be killed by hand.
527
528 F\bFI\bIL\bLE\bE N\bNA\bAM\bMI\bIN\bNG\bG C\bCO\bON\bNV\bVE\bEN\bNT\bTI\bIO\bON\bNS\bS
529      Files specified as arguments to f\bft\btp\bp commands are processed according to
530      the following rules.
531
532      1.   If the file name `-\b-' is specified, the _\bs_\bt_\bd_\bi_\bn (for reading) or _\bs_\bt_\bd_\bo_\bu_\bt
533           (for writing) is used.
534
535      2.   If the first character of the file name is `|', the remainder of the
536           argument is interpreted as a shell command.  F\bFt\btp\bp then forks a shell,
537           using popen(3) with the argument supplied, and reads (writes) from
538           the stdout (stdin).  If the shell command includes spaces, the argu-
539           ment must be quoted; e.g.  ``" ls -lt"''.  A particularly useful ex-
540           ample of this mechanism is: ``dir more''.
541
542      3.   Failing the above checks, if ``globbing'' is enabled, local file
543           names are expanded according to the rules used in the csh(1); c.f.
544           the g\bgl\blo\bob\bb command.  If the f\bft\btp\bp command expects a single local file
545           (.e.g.  p\bpu\but\bt), only the first filename generated by the "globbing"
546           operation is used.
547
548      4.   For m\bmg\bge\bet\bt commands and g\bge\bet\bt commands with unspecified local file
549           names, the local filename is the remote filename, which may be al-
550           tered by a c\bca\bas\bse\be, n\bnt\btr\bra\ban\bns\bs, or n\bnm\bma\bap\bp setting.  The resulting filename
551           may then be altered if r\bru\bun\bni\biq\bqu\bue\be is on.
552
553      5.   For m\bmp\bpu\but\bt commands and p\bpu\but\bt commands with unspecified remote file
554           names, the remote filename is the local filename, which may be al-
555           tered by a n\bnt\btr\bra\ban\bns\bs or n\bnm\bma\bap\bp setting.  The resulting filename may then
556           be altered by the remote server if s\bsu\bun\bni\biq\bqu\bue\be is on.
557
558 F\bFI\bIL\bLE\bE T\bTR\bRA\bAN\bNS\bSF\bFE\bER\bR P\bPA\bAR\bRA\bAM\bME\bET\bTE\bER\bRS\bS
559      The FTP specification specifies many parameters which may affect a file
560      transfer.  The t\bty\byp\bpe\be may be one of ``ascii'', ``image'' (binary),
561      ``ebcdic'', and ``local byte size'' (for PDP-10's and PDP-20's mostly).
562      F\bFt\btp\bp supports the ascii and image types of file transfer, plus local byte
563      size 8 for t\bte\ben\bne\bex\bx mode transfers.
564
565      F\bFt\btp\bp supports only the default values for the remaining file transfer pa-
566      rameters: m\bmo\bod\bde\be, f\bfo\bor\brm\bm, and s\bst\btr\bru\buc\bct\bt.
567
568 T\bTH\bHE\bE .\b.n\bne\bet\btr\brc\bc F\bFI\bIL\bLE\bE
569      The _\b._\bn_\be_\bt_\br_\bc file contains login and initialization information used by the
570      auto-login process.  It resides in the user's home directory.  The fol-
571      lowing tokens are recognized; they may be separated by spaces, tabs, or
572      new-lines:
573
574      m\bma\bac\bch\bhi\bin\bne\be _\bn_\ba_\bm_\be
575                Identify a remote machine _\bn_\ba_\bm_\be.  The auto-login process search-
576                es the _\b._\bn_\be_\bt_\br_\bc file for a m\bma\bac\bch\bhi\bin\bne\be token that matches the remote
577                machine specified on the f\bft\btp\bp command line or as an o\bop\bpe\ben\bn command
578                argument.  Once a match is made, the subsequent _\b._\bn_\be_\bt_\br_\bc tokens
579                are processed, stopping when the end of file is reached or an-
580                other m\bma\bac\bch\bhi\bin\bne\be or a d\bde\bef\bfa\bau\bul\blt\bt token is encountered.
581
582      d\bde\bef\bfa\bau\bul\blt\bt   This is the same as m\bma\bac\bch\bhi\bin\bne\be _\bn_\ba_\bm_\be except that d\bde\bef\bfa\bau\bul\blt\bt matches
583                any name.  There can be only one d\bde\bef\bfa\bau\bul\blt\bt token, and it must be
584                after all m\bma\bac\bch\bhi\bin\bne\be tokens.  This is normally used as:
585
586                      default login anonymous password user@site
587
588                thereby giving the user _\ba_\bu_\bt_\bo_\bm_\ba_\bt_\bi_\bc anonymous ftp login to ma-
589                chines not specified in _\b._\bn_\be_\bt_\br_\bc.  This can be overridden by us-
590                ing the -\b-n\bn flag to disable auto-login.
591
592      l\blo\bog\bgi\bin\bn _\bn_\ba_\bm_\be
593                Identify a user on the remote machine.  If this token is pre-
594                sent, the auto-login process will initiate a login using the
595                specified _\bn_\ba_\bm_\be.
596
597      p\bpa\bas\bss\bsw\bwo\bor\brd\bd _\bs_\bt_\br_\bi_\bn_\bg
598                Supply a password.  If this token is present, the auto-login
599                process will supply the specified string if the remote server
600                requires a password as part of the login process.  Note that if
601                this token is present in the _\b._\bn_\be_\bt_\br_\bc file for any user other
602                than _\ba_\bn_\bo_\bn_\by_\bm_\bo_\bu_\bs, f\bft\btp\bp will abort the auto-login process if the
603                _\b._\bn_\be_\bt_\br_\bc is readable by anyone besides the user.
604
605      a\bac\bcc\bco\bou\bun\bnt\bt _\bs_\bt_\br_\bi_\bn_\bg
606                Supply an additional account password.  If this token is pre-
607                sent, the auto-login process will supply the specified string
608                if the remote server requires an additional account password,
609                or the auto-login process will initiate an ACCT command if it
610                does not.
611
612      m\bma\bac\bcd\bde\bef\bf _\bn_\ba_\bm_\be
613                Define a macro.  This token functions like the f\bft\btp\bp m\bma\bac\bcd\bde\bef\bf com-
614                mand functions.  A macro is defined with the specified name;
615                its contents begin with the next _\b._\bn_\be_\bt_\br_\bc line and continue until
616                a null line (consecutive new-line characters) is encountered.
617                If a macro named i\bin\bni\bit\bt is defined, it is automatically executed
618                as the last step in the auto-login process.
619
620 E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
621      F\bFt\btp\bp utilizes the following environment variables.
622
623      HOME        For default location of a _\b._\bn_\be_\bt_\br_\bc file, if one exists.
624
625      SHELL       For default shell.
626
627 S\bSE\bEE\bE A\bAL\bLS\bSO\bO
628      ftpd(8)
629
630      _\bR_\bF_\bC_\b2_\b2_\b2_\b8.
631
632 H\bHI\bIS\bST\bTO\bOR\bRY\bY
633      The f\bft\btp\bp command appeared in 4.2BSD.
634
635 B\bBU\bUG\bGS\bS
636      Correct execution of many commands depends upon proper behavior by the
637      remote server.
638
639      An error in the treatment of carriage returns in the 4.2BSD ascii-mode
640      transfer code has been corrected.  This correction may result in incor-
641      rect transfers of binary files to and from 4.2BSD servers using the ascii
642      type.  Avoid this problem by using the binary image type.
643
644 4.2 Berkeley Distribution       April 27, 1996                              10