Commit | Line | Data |
---|---|---|
b5dc1377 | 1 | .\" Copyright (c) 1985, 1989, 1990 The Regents of the University of California. |
cb8ade2f | 2 | .\" All rights reserved. |
9e7fc5bf | 3 | .\" |
b5dc1377 | 4 | .\" %sccs.include.redist.man% |
9e7fc5bf | 5 | .\" |
b5dc1377 | 6 | .\" @(#)ftp.1 6.14 (Berkeley) %G% |
cb8ade2f | 7 | .\" |
b5dc1377 CL |
8 | .Dd |
9 | .Dt FTP 1 | |
10 | .Os BSD 4.2 | |
11 | .Sh NAME | |
12 | .Nm ftp | |
13 | .Nd ARPANET file transfer program | |
14 | .Sh SYNOPSIS | |
15 | .Nm ftp | |
16 | .Op Fl v | |
17 | .Op Fl d | |
18 | .Op Fl i | |
19 | .Op Fl n | |
20 | .Op Fl g | |
21 | .Op Ar host | |
22 | .Sh DESCRIPTION | |
23 | .Nm Ftp | |
9e7fc5bf | 24 | is the user interface to the ARPANET standard File Transfer Protocol. |
a154ee89 GM |
25 | The program allows a user to transfer files to and from a |
26 | remote network site. | |
b5dc1377 CL |
27 | .Pp |
28 | Options may be specified at the command line, or to the | |
29 | command interpreter. | |
30 | .Tp Fl v | |
31 | Verbose option forces | |
32 | .Nm ftp | |
33 | to show all responses from the remote server, as well | |
34 | as report on data transfer statistics. | |
35 | .Tp Fl n | |
36 | Restrains | |
37 | .Nm ftp | |
38 | from attempting \*(Lqauto-login\*(Rq upon initial connection. | |
39 | If auto-login is enabled, | |
40 | .Nm ftp | |
41 | will check the | |
42 | .Pa .netrc | |
43 | (see below) file in the user's home directory for an entry describing | |
44 | an account on the remote machine. If no entry exists, | |
45 | .Nm ftp | |
46 | will prompt for the remote machine login name (default is the user | |
47 | identity on the local machine), and, if necessary, prompt for a password | |
48 | and an account with which to login. | |
49 | .Tp Fl i | |
50 | Turns off interactive prompting during | |
51 | multiple file transfers. | |
52 | .Tp Fl d | |
53 | Enables debugging. | |
54 | .Tp Fl g | |
55 | Disables file name globbing. | |
56 | .Tp | |
57 | .Pp | |
58 | The client host with which | |
59 | .Nm ftp | |
9e7fc5bf KM |
60 | is to communicate may be specified on the command line. |
61 | If this is done, | |
b5dc1377 | 62 | .Nm ftp |
a154ee89 | 63 | will immediately attempt to establish a connection to an FTP |
b5dc1377 CL |
64 | server on that host; otherwise, |
65 | .Nm ftp | |
a154ee89 | 66 | will enter its command interpreter and await instructions |
b5dc1377 CL |
67 | from the user. When |
68 | .Nm ftp | |
69 | is awaiting commands from the user the prompt \*(Lqftp>\*(Rq | |
adbdb3c0 | 70 | is provided to the user. The following commands are recognized |
9e7fc5bf | 71 | by |
b5dc1377 CL |
72 | .Nm ftp : |
73 | .Tw Fl | |
74 | .Tp Cx Ic \&! | |
75 | .Cx \&\ \& | |
76 | .Op Ar command Op Ar args | |
77 | .Cx | |
a154ee89 GM |
78 | Invoke an interactive shell on the local machine. |
79 | If there are arguments, the first is taken to be a command to execute | |
80 | directly, with the rest of the arguments as its arguments. | |
b5dc1377 CL |
81 | .Tp Cx Ic \&$ |
82 | .Cx \&\ \& | |
83 | .Ar macro-name | |
84 | .Op Ar args | |
85 | .Cx | |
86 | Execute the macro | |
87 | .Ar macro-name | |
88 | that was defined with the | |
89 | .Ic macdef | |
90 | command. | |
a154ee89 | 91 | Arguments are passed to the macro unglobbed. |
b5dc1377 CL |
92 | .Tp Cx Ic account |
93 | .Cx \&\ \& | |
94 | .Op Ar passwd | |
95 | .Cx | |
a154ee89 GM |
96 | Supply a supplemental password required by a remote system for access |
97 | to resources once a login has been successfully completed. | |
98 | If no argument is included, the user will be prompted for an account | |
99 | password in a non-echoing input mode. | |
b5dc1377 CL |
100 | .Tp Cx Ic append |
101 | .Cx \&\ \& | |
102 | .Ar local-file | |
103 | .Cx \&\ \& | |
104 | .Op Ar remote-file | |
105 | .Cx | |
9e7fc5bf | 106 | Append a local file to a file on the remote machine. If |
b5dc1377 | 107 | .Ar remote-file |
9e7fc5bf | 108 | is left unspecified, the local file name is used in naming the |
a154ee89 | 109 | remote file after being altered by any |
b5dc1377 | 110 | .Ic ntrans |
a154ee89 | 111 | or |
b5dc1377 | 112 | .Ic nmap |
a154ee89 GM |
113 | setting. |
114 | File transfer uses the current settings for | |
b5dc1377 CL |
115 | .Ic type , |
116 | .Ic format , | |
117 | .Ic mode , | |
a154ee89 | 118 | and |
b5dc1377 CL |
119 | .Ic structure . |
120 | .Tp Ic ascii | |
121 | Set the file transfer | |
122 | .Ic type | |
a154ee89 | 123 | to network ASCII. This is the default type. |
b5dc1377 | 124 | .Tp Ic bell |
9e7fc5bf KM |
125 | Arrange that a bell be sounded after each file transfer |
126 | command is completed. | |
b5dc1377 | 127 | .Tp Ic binary |
a154ee89 | 128 | Set the file transfer |
b5dc1377 | 129 | .Ic type |
a154ee89 | 130 | to support binary image transfer. |
b5dc1377 | 131 | .Tp Ic bye |
9e7fc5bf KM |
132 | Terminate the FTP session with the remote server |
133 | and exit | |
b5dc1377 | 134 | .Nm ftp . |
3c604e97 | 135 | An end of file will also terminate the session and exit. |
b5dc1377 | 136 | .Tp Ic case |
a154ee89 | 137 | Toggle remote computer file name case mapping during |
b5dc1377 | 138 | .Ic mget |
a154ee89 GM |
139 | commands. |
140 | When | |
b5dc1377 | 141 | .Ic case |
a154ee89 GM |
142 | is on (default is off), remote computer file names with all letters in |
143 | upper case are written in the local directory with the letters mapped | |
144 | to lower case. | |
b5dc1377 CL |
145 | .Tp Cx Ic cd |
146 | .Cx \&\ \& | |
147 | .Ar remote-directory | |
148 | .Cx | |
9e7fc5bf | 149 | Change the working directory on the remote machine |
b5dc1377 CL |
150 | to |
151 | .Ar remote-directory . | |
152 | .Tp Ic cdup | |
a154ee89 GM |
153 | Change the remote machine working directory to the parent of the |
154 | current remote machine working directory. | |
b5dc1377 CL |
155 | .Tp Cx Ic chmod |
156 | .Cx \&\ \& | |
157 | .Ar mode file-name | |
158 | .Cx | |
159 | Change the permission modes the file | |
160 | .Ar file-name | |
161 | on the remote | |
162 | sytem to | |
163 | .Ic mode . | |
164 | .Tp Ic close | |
9e7fc5bf KM |
165 | Terminate the FTP session with the remote server, and |
166 | return to the command interpreter. | |
a154ee89 | 167 | Any defined macros are erased. |
b5dc1377 | 168 | .Tp Ic cr |
a154ee89 GM |
169 | Toggle carriage return stripping during |
170 | ascii type file retrieval. | |
171 | Records are denoted by a carriage return/linefeed sequence | |
172 | during ascii type file transfer. | |
173 | When | |
b5dc1377 | 174 | .Ic cr |
a154ee89 GM |
175 | is on (the default), carriage returns are stripped from this |
176 | sequence to conform with the UNIX single linefeed record | |
177 | delimiter. | |
178 | Records on non-UNIX remote systems may contain single linefeeds; | |
179 | when an ascii type transfer is made, these linefeeds may be | |
180 | distinguished from a record delimiter only when | |
b5dc1377 | 181 | .Ic cr |
a154ee89 | 182 | is off. |
b5dc1377 CL |
183 | .Tp Cx Ic delete |
184 | .Cx \&\ \& | |
185 | .Ar remote-file | |
186 | .Cx | |
9e7fc5bf | 187 | Delete the file |
b5dc1377 | 188 | .Ar remote-file |
9e7fc5bf | 189 | on the remote machine. |
b5dc1377 CL |
190 | .Tp Cx Ic debug |
191 | .Cx \&\ \& | |
192 | .Op Ar debug-value | |
193 | .Cx | |
9e7fc5bf | 194 | Toggle debugging mode. If an optional |
b5dc1377 | 195 | .Ar debug-value |
9e7fc5bf KM |
196 | is specified it is used to set the debugging level. |
197 | When debugging is on, | |
b5dc1377 | 198 | .Nm ftp |
9e7fc5bf | 199 | prints each command sent to the remote machine, preceded |
b5dc1377 CL |
200 | by the string \*(Lq-->\*(Rq. |
201 | .Tp Cx Ic dir | |
202 | .Cx \&\ \& | |
203 | .Op Ar remote-directory | |
204 | .Cx \&\ \& | |
205 | .Op Ar local-file | |
206 | .Cx | |
9e7fc5bf KM |
207 | Print a listing of the directory contents in the |
208 | directory, | |
b5dc1377 | 209 | .Ar remote-directory , |
9e7fc5bf | 210 | and, optionally, placing the output in |
b5dc1377 | 211 | .Ar local-file . |
cd8a871b | 212 | If interactive prompting is on, |
b5dc1377 | 213 | .Nm ftp |
cd8a871b KB |
214 | will prompt the user to verify that the last argument is indeed the |
215 | target local file for receiving | |
b5dc1377 | 216 | .Ic dir |
cd8a871b | 217 | output. |
9e7fc5bf KM |
218 | If no directory is specified, the current working |
219 | directory on the remote machine is used. If no local | |
b5dc1377 CL |
220 | file is specified, or |
221 | .Ar local-file | |
222 | is | |
223 | .Fl , | |
1609770c | 224 | output comes to the terminal. |
b5dc1377 | 225 | .Tp Ic disconnect |
a154ee89 | 226 | A synonym for |
b5dc1377 CL |
227 | .Ar close . |
228 | .Tp Cx Ic form | |
229 | .Cx \&\ \& | |
230 | .Ar format | |
231 | .Cx | |
232 | Set the file transfer | |
233 | .Ic form | |
234 | to | |
235 | .Ar format . | |
236 | The default format is \*(Lqfile\*(Rq. | |
237 | .Tp Cx Ic get | |
238 | .Cx \&\ \& | |
239 | .Ar remote-file | |
240 | .Cx \&\ \& | |
241 | .Op Ar local-file | |
242 | .Cx | |
243 | Retrieve the | |
244 | .Ar remote-file | |
9e7fc5bf KM |
245 | and store it on the local machine. If the local |
246 | file name is not specified, it is given the same | |
a154ee89 GM |
247 | name it has on the remote machine, subject to |
248 | alteration by the current | |
b5dc1377 CL |
249 | .Ic case , |
250 | .Ic ntrans , | |
a154ee89 | 251 | and |
b5dc1377 | 252 | .Ic nmap |
a154ee89 | 253 | settings. |
b5dc1377 CL |
254 | The current settings for |
255 | .Ic type , | |
256 | .Ic form , | |
257 | .Ic mode , | |
a154ee89 | 258 | and |
b5dc1377 | 259 | .Ic structure |
9e7fc5bf | 260 | are used while transferring the file. |
b5dc1377 CL |
261 | .Tp Ic glob |
262 | Toggle filename expansion for | |
263 | .Ic mdelete , | |
264 | .Ic mget | |
265 | and | |
266 | .Ic mput . | |
267 | If globbing is turned off with | |
268 | .Ic glob , | |
269 | the file name arguments | |
a154ee89 | 270 | are taken literally and not expanded. |
b5dc1377 CL |
271 | Globbing for |
272 | .Ic mput | |
273 | is done as in | |
274 | .Xr csh 1 . | |
275 | For | |
276 | .Ic mdelete | |
277 | and | |
278 | .Ic mget , | |
279 | each remote file name is expanded | |
a154ee89 | 280 | separately on the remote machine and the lists are not merged. |
b5dc1377 | 281 | Expansion of a directory name is likely to be |
1609770c | 282 | different from expansion of the name of an ordinary file: |
a154ee89 | 283 | the exact result depends on the foreign operating system and ftp server, |
b5dc1377 CL |
284 | and can be previewed by doing |
285 | .Cx ` | |
286 | .Cx Li mls remote-files \- | |
287 | .Cx \'. | |
288 | .Cx | |
289 | Note: | |
290 | .Ic mget | |
291 | and | |
292 | .Ic mput | |
293 | are not meant to transfer | |
a154ee89 | 294 | entire directory subtrees of files. That can be done by |
b5dc1377 CL |
295 | transferring a |
296 | .Xr tar 1 | |
297 | archive of the subtree (in binary mode). | |
298 | .Tp Ic hash | |
9e7fc5bf KM |
299 | Toggle hash-sign (``#'') printing for each data block |
300 | transferred. The size of a data block is 1024 bytes. | |
b5dc1377 CL |
301 | .Tp Cx Ic help |
302 | .Cx \&\ \& | |
303 | .Op Ar command | |
304 | .Cx | |
9e7fc5bf | 305 | Print an informative message about the meaning of |
b5dc1377 CL |
306 | .Ar command . |
307 | If no argument is given, | |
308 | .Nm ftp | |
9e7fc5bf | 309 | prints a list of the known commands. |
b5dc1377 CL |
310 | .Tp Cx Ic idle |
311 | .Cx \&\ \& | |
312 | .Op Ar seconds | |
313 | .Cx | |
314 | Set the inactivity timer on the remote server to | |
315 | .Ar seconds | |
316 | seconds. | |
317 | If | |
318 | .Ar seconds | |
319 | is ommitted, the current inactivity timer is printed. | |
320 | .Tp Cx Ic lcd | |
321 | .Cx \&\ \& | |
322 | .Op Ar directory | |
323 | .Cx | |
9e7fc5bf | 324 | Change the working directory on the local machine. If |
b5dc1377 CL |
325 | no |
326 | .Ar directory | |
9e7fc5bf | 327 | is specified, the user's home directory is used. |
b5dc1377 CL |
328 | .Tp Cx Ic ls |
329 | .Cx \&\ \& | |
330 | .Op Ar remote-directory | |
331 | .Cx \&\ \& | |
332 | .Op Ar local-file | |
333 | .Cx | |
ff00793c | 334 | Print a listing of the contents of a |
cdc35b45 MK |
335 | directory on the remote machine. |
336 | The listing includes any system-dependent information that the server | |
337 | chooses to include; for example, most UNIX systems will produce | |
b5dc1377 CL |
338 | output from the command \*(Lqls -l\*(Rq. |
339 | (See also | |
340 | .Ic nlist . | |
341 | ) | |
cdc35b45 | 342 | If |
b5dc1377 | 343 | .Ar remote-directory |
cd8a871b KB |
344 | is left unspecified, the current working directory is used. |
345 | If interactive prompting is on, | |
b5dc1377 | 346 | .Nm ftp |
cd8a871b KB |
347 | will prompt the user to verify that the last argument is indeed the |
348 | target local file for receiving | |
b5dc1377 | 349 | .Ic ls |
cd8a871b | 350 | output. |
b5dc1377 CL |
351 | If no local file is specified, or if |
352 | .Ar local-file | |
353 | is | |
354 | .Fl , | |
1609770c | 355 | the output is sent to the terminal. |
b5dc1377 CL |
356 | .Tp Cx Ic macdef |
357 | .Cx \&\ \& | |
358 | .Ar macro-name | |
359 | .Cx | |
a154ee89 GM |
360 | Define a macro. |
361 | Subsequent lines are stored as the macro | |
b5dc1377 CL |
362 | .Ar macro-name ; |
363 | a null line (consecutive newline characters | |
a154ee89 GM |
364 | in a file or |
365 | carriage returns from the terminal) terminates macro input mode. | |
366 | There is a limit of 16 macros and 4096 total characters in all | |
367 | defined macros. | |
368 | Macros remain defined until a | |
b5dc1377 | 369 | .Ic close |
a154ee89 GM |
370 | command is executed. |
371 | The macro processor interprets '$' and '\\' as special characters. | |
372 | A '$' followed by a number (or numbers) is replaced by the | |
373 | corresponding argument on the macro invocation command line. | |
374 | A '$' followed by an 'i' signals that macro processor that the | |
375 | executing macro is to be looped. On the first pass '$i' is | |
376 | replaced by the first argument on the macro invocation command line, | |
377 | on the second pass it is replaced by the second argument, and so on. | |
378 | A '\\' followed by any character is replaced by that character. | |
379 | Use the '\\' to prevent special treatment of the '$'. | |
b5dc1377 CL |
380 | .Tp Cx Ic mdelete |
381 | .Cx \&\ \& | |
382 | .Op Ar remote-files | |
383 | .Cx | |
384 | Delete the | |
385 | .Ar remote-files | |
386 | on the remote machine. | |
387 | .Tp Cx Ic mdir | |
388 | .Cx \&\ \& | |
389 | .Ar remote-files | |
390 | .Cx \&\ \& | |
391 | .Ar local-file | |
392 | .Cx | |
393 | Like | |
394 | .Ic dir , | |
395 | except multiple remote files may be specified. | |
a154ee89 | 396 | If interactive prompting is on, |
b5dc1377 | 397 | .Nm ftp |
a154ee89 GM |
398 | will prompt the user to verify that the last argument is indeed the |
399 | target local file for receiving | |
b5dc1377 | 400 | .Ic mdir |
a154ee89 | 401 | output. |
b5dc1377 CL |
402 | .Tp Cx Ic mget |
403 | .Cx \&\ \& | |
404 | .Ar remote-files | |
405 | .Cx | |
406 | Expand the | |
407 | .Ar remote-files | |
408 | on the remote machine | |
409 | and do a | |
410 | .Ic get | |
411 | for each file name thus produced. | |
412 | See | |
413 | .Ic glob | |
414 | for details on the filename expansion. | |
a154ee89 | 415 | Resulting file names will then be processed according to |
b5dc1377 CL |
416 | .Ic case , |
417 | .Ic ntrans , | |
a154ee89 | 418 | and |
b5dc1377 | 419 | .Ic nmap |
a154ee89 | 420 | settings. |
1609770c | 421 | Files are transferred into the local working directory, |
b5dc1377 CL |
422 | which can be changed with |
423 | .Cx ` | |
424 | .Cx Li lcd directory | |
425 | .Cx \'; | |
426 | new local directories can be created with | |
427 | .Cx Li \&! mkdir directory | |
428 | .Cx \'. | |
429 | .Tp Cx Ic mkdir | |
430 | .Cx \&\ \& | |
431 | .Ar directory-name | |
432 | .Cx | |
9e7fc5bf | 433 | Make a directory on the remote machine. |
b5dc1377 CL |
434 | .Tp Cx Ic mls |
435 | .Cx \&\ \& | |
436 | .Ar remote-files | |
437 | .Cx \&\ \& | |
438 | .Ar local-file | |
439 | .Cx | |
440 | Like | |
441 | .Ic nlist , | |
442 | except multiple remote files may be specified, | |
443 | and the | |
444 | .Ar local-file | |
445 | must be specified. | |
a154ee89 | 446 | If interactive prompting is on, |
b5dc1377 | 447 | .Nm ftp |
a154ee89 GM |
448 | will prompt the user to verify that the last argument is indeed the |
449 | target local file for receiving | |
b5dc1377 | 450 | .Ic mls |
a154ee89 | 451 | output. |
b5dc1377 CL |
452 | .Tp Cx Ic mode |
453 | .Cx \&\ \& | |
454 | .Op Ar mode-name | |
455 | .Cx | |
a154ee89 | 456 | Set the file transfer |
b5dc1377 | 457 | .Ic mode |
a154ee89 | 458 | to |
b5dc1377 CL |
459 | .Ar mode-name . |
460 | The default mode is \*(Lqstream\*(Rq mode. | |
461 | .Tp Cx Ic modtime | |
462 | .Cx \&\ \& | |
463 | .Ar file-name | |
464 | .Cx | |
ff00793c | 465 | Show the last modification time of the file on the remote machine. |
b5dc1377 CL |
466 | .Tp Cx Ic mput |
467 | .Cx \&\ \& | |
468 | .Ar local-files | |
469 | .Cx | |
1609770c | 470 | Expand wild cards in the list of local files given as arguments |
b5dc1377 CL |
471 | and do a |
472 | .Ic put | |
473 | for each file in the resulting list. | |
474 | See | |
475 | .Ic glob | |
476 | for details of filename expansion. | |
a154ee89 | 477 | Resulting file names will then be processed according to |
b5dc1377 | 478 | .Ic ntrans |
a154ee89 | 479 | and |
b5dc1377 | 480 | .Ic nmap |
a154ee89 | 481 | settings. |
b5dc1377 CL |
482 | exist on the current system, the remote file is considered |
483 | .Ic newer . | |
484 | Otherwise, this command is identical to | |
485 | .Ar get . | |
486 | .Tp Cx Ic nlist | |
487 | .Cx \&\ \& | |
488 | .Op Ar remote-directory | |
489 | .Cx \&\ \& | |
490 | .Op Ar local-file | |
491 | .Cx | |
cdc35b45 | 492 | Print a list of the files of a |
ff00793c | 493 | directory on the remote machine. If |
b5dc1377 | 494 | .Ar remote-directory |
ff00793c MK |
495 | is left unspecified, the current working directory is used. |
496 | If interactive prompting is on, | |
b5dc1377 | 497 | .Nm ftp |
ff00793c MK |
498 | will prompt the user to verify that the last argument is indeed the |
499 | target local file for receiving | |
b5dc1377 | 500 | .Ic nlist |
ff00793c | 501 | output. |
b5dc1377 CL |
502 | If no local file is specified, or if |
503 | .Ar local-file | |
504 | is | |
505 | .Fl , | |
ff00793c | 506 | the output is sent to the terminal. |
b5dc1377 CL |
507 | .Tp Cx Ic nmap |
508 | .Cx \&\ \& | |
509 | .Op Ar inpattern outpattern | |
510 | .Cx | |
a154ee89 GM |
511 | Set or unset the filename mapping mechanism. |
512 | If no arguments are specified, the filename mapping mechanism is unset. | |
513 | If arguments are specified, remote filenames are mapped during | |
b5dc1377 | 514 | .Ic mput |
a154ee89 | 515 | commands and |
b5dc1377 | 516 | .Ic put |
a154ee89 GM |
517 | commands issued without a specified remote target filename. |
518 | If arguments are specified, local filenames are mapped during | |
b5dc1377 | 519 | .Ic mget |
a154ee89 | 520 | commands and |
b5dc1377 | 521 | .Ic get |
a154ee89 GM |
522 | commands issued without a specified local target filename. |
523 | This command is useful when connecting to a non-UNIX remote computer | |
524 | with different file naming conventions or practices. | |
525 | The mapping follows the pattern set by | |
b5dc1377 | 526 | .Ar inpattern |
a154ee89 | 527 | and |
b5dc1377 CL |
528 | .Ar outpattern . |
529 | .Op Ar Inpattern | |
a154ee89 GM |
530 | is a template for incoming filenames (which may have already been |
531 | processed according to the | |
b5dc1377 | 532 | .Ic ntrans |
a154ee89 | 533 | and |
b5dc1377 | 534 | .Ic case |
a154ee89 | 535 | settings). |
2c32d7db | 536 | Variable templating is accomplished by including the sequences '$1', '$2', ..., '$9' in |
b5dc1377 | 537 | .Ar inpattern . |
a154ee89 GM |
538 | Use '\\' to prevent this special treatment of the '$' character. |
539 | All other characters are treated literally, and are used to determine the | |
b5dc1377 CL |
540 | .Ic nmap |
541 | .Op Ar inpattern | |
a154ee89 | 542 | variable values. |
ff00793c | 543 | For example, given |
b5dc1377 | 544 | .Ar inpattern |
a154ee89 GM |
545 | $1.$2 and the remote file name "mydata.data", $1 would have the value |
546 | "mydata", and $2 would have the value "data". | |
547 | The | |
b5dc1377 | 548 | .Ar outpattern |
a154ee89 GM |
549 | determines the resulting mapped filename. |
550 | The sequences '$1', '$2', ...., '$9' are replaced by any value resulting | |
551 | from the | |
b5dc1377 | 552 | .Ar inpattern |
a154ee89 GM |
553 | template. |
554 | The sequence '$0' is replace by the original filename. | |
b5dc1377 CL |
555 | Additionally, the sequence |
556 | .Cx ` | |
557 | .Op Ar seq1 , Ar seq2 | |
558 | .Cx \' | |
559 | is replaced by | |
560 | .Op Ar seq1 | |
a154ee89 | 561 | if |
b5dc1377 | 562 | .Ar seq1 |
a154ee89 | 563 | is not a null string; otherwise it is replaced by |
b5dc1377 CL |
564 | .Ar seq2 . |
565 | For example, the command | |
566 | .Pp | |
567 | .Df I | |
568 | nmap $1.$2.$3 | |
569 | .Cx Op $1,$2 | |
570 | .Cx . | |
571 | .Op $2,file | |
572 | .Cx | |
573 | .De | |
574 | .Pp | |
575 | would yield | |
a154ee89 GM |
576 | the output filename "myfile.data" for input filenames "myfile.data" and |
577 | "myfile.data.old", "myfile.file" for the input filename "myfile", and | |
578 | "myfile.myfile" for the input filename ".myfile". | |
579 | Spaces may be included in | |
b5dc1377 CL |
580 | .Ar outpattern , |
581 | as in the example: nmap $1 sed "s/ *$//" > $1 . | |
a154ee89 | 582 | Use the '\\' character to prevent special treatment |
b5dc1377 CL |
583 | of the '$','[','[', and ',' characters. |
584 | .Tp Cx Ic ntrans | |
585 | .Cx \&\ \& | |
586 | .Op Ar inchars Op Ar outchars | |
587 | .Cx | |
a154ee89 GM |
588 | Set or unset the filename character translation mechanism. |
589 | If no arguments are specified, the filename character | |
590 | translation mechanism is unset. | |
591 | If arguments are specified, characters in | |
592 | remote filenames are translated during | |
b5dc1377 | 593 | .Ic mput |
a154ee89 | 594 | commands and |
b5dc1377 | 595 | .Ic put |
a154ee89 GM |
596 | commands issued without a specified remote target filename. |
597 | If arguments are specified, characters in | |
598 | local filenames are translated during | |
b5dc1377 | 599 | .Ic mget |
a154ee89 | 600 | commands and |
b5dc1377 | 601 | .Ic get |
a154ee89 GM |
602 | commands issued without a specified local target filename. |
603 | This command is useful when connecting to a non-UNIX remote computer | |
604 | with different file naming conventions or practices. | |
605 | Characters in a filename matching a character in | |
b5dc1377 | 606 | .Ar inchars |
a154ee89 | 607 | are replaced with the corresponding character in |
b5dc1377 | 608 | .Ar outchars . |
a154ee89 | 609 | If the character's position in |
b5dc1377 | 610 | .Ar inchars |
a154ee89 | 611 | is longer than the length of |
b5dc1377 | 612 | .Ar outchars , |
a154ee89 | 613 | the character is deleted from the file name. |
b5dc1377 CL |
614 | .Tp Cx Ic open |
615 | .Cx \&\ \& | |
616 | .Ar host | |
617 | .Cx \&\ \& | |
618 | .Op Ar port | |
619 | .Cx | |
9e7fc5bf | 620 | Establish a connection to the specified |
b5dc1377 | 621 | .Ar host |
9e7fc5bf | 622 | FTP server. An optional port number may be supplied, |
b5dc1377 CL |
623 | in which case, |
624 | .Nm ftp | |
9e7fc5bf | 625 | will attempt to contact an FTP server at that port. |
b5dc1377 CL |
626 | If the |
627 | .Ic auto-login | |
628 | option is on (default), | |
629 | .Nm ftp | |
9e7fc5bf KM |
630 | will also attempt to automatically log the user in to |
631 | the FTP server (see below). | |
b5dc1377 | 632 | .Tp Ic prompt |
9e7fc5bf KM |
633 | Toggle interactive prompting. Interactive prompting |
634 | occurs during multiple file transfers to allow the | |
1609770c | 635 | user to selectively retrieve or store files. |
b5dc1377 CL |
636 | If prompting is turned off (default is on), any |
637 | .Ic mget | |
638 | or | |
639 | .Ic mput | |
640 | will transfer all files, and any | |
641 | .Ic mdelete | |
642 | will delete all files. | |
643 | .Tp Cx Ic proxy | |
644 | .Cx \&\ \& | |
645 | .Ar ftp-command | |
646 | .Cx | |
a154ee89 GM |
647 | Execute an ftp command on a secondary control connection. |
648 | This command allows simultaneous connection to two remote ftp | |
649 | servers for transferring files between the two servers. | |
650 | The first | |
b5dc1377 | 651 | .Ic proxy |
a154ee89 | 652 | command should be an |
b5dc1377 | 653 | .Ic open , |
a154ee89 GM |
654 | to establish the secondary control connection. |
655 | Enter the command "proxy ?" to see other ftp commands executable on the | |
656 | secondary connection. | |
98a310f2 | 657 | The following commands behave differently when prefaced by |
b5dc1377 CL |
658 | .Ic proxy : |
659 | .Ic open | |
a154ee89 | 660 | will not define new macros during the auto-login process, |
b5dc1377 | 661 | .Ic close |
a154ee89 | 662 | will not erase existing macro definitions, |
b5dc1377 | 663 | .Ic get |
a154ee89 | 664 | and |
b5dc1377 | 665 | .Ic mget |
a154ee89 GM |
666 | transfer files from the host on the primary control connection |
667 | to the host on the secondary control connection, and | |
b5dc1377 CL |
668 | .Ic put , |
669 | .Ic mput , | |
a154ee89 | 670 | and |
b5dc1377 | 671 | .Ic append |
a154ee89 GM |
672 | transfer files from the host on the secondary control connection |
673 | to the host on the primary control connection. | |
674 | Third party file transfers depend upon support of the ftp protocol | |
675 | PASV command by the server on the secondary control connection. | |
b5dc1377 CL |
676 | .Tp Cx Ic put |
677 | .Cx \&\ \& | |
678 | .Ar local-file | |
679 | .Cx \&\ \& | |
680 | .Op Ar remote-file | |
681 | .Cx | |
682 | Store a local file on the remote machine. If | |
683 | .Ar remote-file | |
9e7fc5bf | 684 | is left unspecified, the local file name is used |
a154ee89 | 685 | after processing according to any |
b5dc1377 | 686 | .Ic ntrans |
a154ee89 | 687 | or |
b5dc1377 | 688 | .Ic nmap |
a154ee89 | 689 | settings |
9e7fc5bf | 690 | in naming the remote file. File transfer uses the |
a154ee89 | 691 | current settings for |
b5dc1377 CL |
692 | .Ic type , |
693 | .Ic format , | |
694 | .Ic mode , | |
a154ee89 | 695 | and |
b5dc1377 CL |
696 | .Ic structure . |
697 | .Tp Ic pwd | |
9e7fc5bf KM |
698 | Print the name of the current working directory on the remote |
699 | machine. | |
b5dc1377 | 700 | .Tp Ic quit |
3c604e97 | 701 | A synonym for |
b5dc1377 CL |
702 | .Ic bye . |
703 | .Tp Cx Ic quote | |
704 | .Cx \&\ \& | |
705 | .Ar crg1 arg2 ... | |
706 | .Cx | |
a154ee89 GM |
707 | The arguments specified are sent, verbatim, to the remote FTP |
708 | server. | |
b5dc1377 CL |
709 | .Tp Cx Ic recv |
710 | .Cx \&\ \& | |
711 | .Ar remote-file | |
712 | .Cx \&\ \& | |
713 | .Op Ar local-file | |
714 | .Cx | |
a154ee89 | 715 | A synonym for get. |
b5dc1377 CL |
716 | .Tp Cx Ic remotehelp |
717 | .Cx \&\ \& | |
718 | .Op Ar command-name | |
719 | .Cx | |
720 | Request help from the remote FTP server. If a | |
721 | .Ar command-name | |
9e7fc5bf | 722 | is specified it is supplied to the server as well. |
b5dc1377 CL |
723 | .Tp Cx Ic remotestatus |
724 | .Op Ar file-name | |
725 | .Cx | |
726 | With no arguments, show status of remote machine. If | |
727 | .Ar file-name | |
728 | is specified, show status of | |
729 | .Ar file-name | |
730 | on remote machine. | |
731 | .Tp Cx Ic rename | |
732 | .Cx \&\ \& | |
733 | .Op Ar from | |
734 | .Cx \&\ \& | |
735 | .Op Ar to | |
736 | .Cx | |
9e7fc5bf | 737 | Rename the file |
b5dc1377 | 738 | .Ar from |
a154ee89 | 739 | on the remote machine, to the file |
b5dc1377 CL |
740 | .Ar to . |
741 | .Tp Ic reset | |
a154ee89 GM |
742 | Clear reply queue. |
743 | This command re-synchronizes command/reply sequencing with the remote | |
744 | ftp server. | |
ff00793c | 745 | Resynchronization may be necessary following a violation of the ftp protocol |
a154ee89 | 746 | by the remote server. |
b5dc1377 CL |
747 | .Tp Cx Ic rmdir |
748 | .Cx \&\ \& | |
749 | .Ar directory-name | |
750 | .Cx | |
9e7fc5bf | 751 | Delete a directory on the remote machine. |
b5dc1377 | 752 | .Tp Ic runique |
a154ee89 GM |
753 | Toggle storing of files on the local system with unique filenames. |
754 | If a file already exists with a name equal to the target | |
755 | local filename for a | |
b5dc1377 | 756 | .Ic get |
a154ee89 | 757 | or |
b5dc1377 | 758 | .Ic mget |
2c32d7db | 759 | command, a ".1" is appended to the name. |
a154ee89 GM |
760 | If the resulting name matches another existing file, |
761 | a ".2" is appended to the original name. | |
762 | If this process continues up to ".99", an error | |
763 | message is printed, and the transfer does not take place. | |
764 | The generated unique filename will be reported. | |
765 | Note that | |
b5dc1377 | 766 | .Ic runique |
a154ee89 GM |
767 | will not affect local files generated from a shell command |
768 | (see below). | |
769 | The default value is off. | |
b5dc1377 CL |
770 | .Tp Cx Ic send |
771 | .Cx \&\ \& | |
772 | .Ar local-file | |
773 | .Cx \&\ \& | |
774 | .Op Ar remote-file | |
775 | .Cx | |
a154ee89 | 776 | A synonym for put. |
b5dc1377 CL |
777 | .Tp Ic sendport |
778 | Toggle the use of PORT commands. By default, | |
779 | .Nm ftp | |
9e7fc5bf | 780 | will attempt to use a PORT command when establishing |
a154ee89 GM |
781 | a connection for each data transfer. |
782 | The use of PORT commands can prevent delays | |
783 | when performing multiple file transfers. If the PORT | |
b5dc1377 CL |
784 | command fails, |
785 | .Nm ftp | |
9e7fc5bf KM |
786 | will use the default data port. When the use of PORT |
787 | commands is disabled, no attempt will be made to use | |
788 | PORT commands for each data transfer. This is useful | |
a154ee89 GM |
789 | for certain FTP implementations which do ignore PORT |
790 | commands but, incorrectly, indicate they've been accepted. | |
b5dc1377 CL |
791 | .Tp Cx Ic site |
792 | .Cx \&\ \& | |
793 | .Ar arg1 arg2 ... | |
794 | .Cx | |
23d74d65 MK |
795 | The arguments specified are sent, verbatim, to the remote FTP |
796 | server as a SITE command. | |
b5dc1377 CL |
797 | .Tp Cx Ic size |
798 | .Cx \&\ \& | |
799 | .Ar file-name | |
800 | .Cx | |
801 | Return size of | |
802 | .Ar file-name | |
803 | on remote machine. | |
804 | .Tp Ic status | |
9e7fc5bf | 805 | Show the current status of |
b5dc1377 CL |
806 | .Nm ftp . |
807 | .Tp Cx Ic struct | |
808 | .Cx \&\ \& | |
809 | .Op Ar struct-name | |
810 | .Cx | |
a154ee89 | 811 | Set the file transfer |
b5dc1377 | 812 | .Ar structure |
a154ee89 | 813 | to |
b5dc1377 CL |
814 | .Ar struct-name . |
815 | By default \*(Lqstream\*(Rq structure is used. | |
816 | .Tp Ic sunique | |
a154ee89 GM |
817 | Toggle storing of files on remote machine under unique file names. |
818 | Remote ftp server must support ftp protocol STOU command for | |
819 | successful completion. | |
820 | The remote server will report unique name. | |
821 | Default value is off. | |
b5dc1377 | 822 | .Tp Ic system |
ff00793c | 823 | Show the type of operating system running on the remote machine. |
b5dc1377 | 824 | .Tp Ic tenex |
a154ee89 | 825 | Set the file transfer type to that needed to |
9e7fc5bf | 826 | talk to TENEX machines. |
b5dc1377 | 827 | .Tp Ic trace |
a154ee89 | 828 | Toggle packet tracing. |
b5dc1377 CL |
829 | .Tp Cx Ic type |
830 | .Cx \&\ \& | |
831 | .Op Ar type-name | |
832 | .Cx | |
a154ee89 | 833 | Set the file transfer |
b5dc1377 | 834 | .Ic type |
a154ee89 | 835 | to |
b5dc1377 | 836 | .Ar type-name . |
9e7fc5bf | 837 | If no type is specified, the current type |
a154ee89 | 838 | is printed. The default type is network ASCII. |
b5dc1377 CL |
839 | .Tp Cx Ic umask |
840 | .Cx \&\ \& | |
841 | .Op Ar newmask | |
842 | .Cx | |
843 | Set the default umask on the remote server to | |
844 | .Ic newmask . | |
845 | If | |
846 | .Ic newmask | |
847 | is ommitted, the current umask is printed. | |
848 | .Tp Cx Ic user | |
849 | .Cx \&\ \& | |
850 | .Ar user-name | |
851 | .Cx \&\ \& | |
852 | .Op Ar password | |
853 | .Cx \&\ \& | |
854 | .Op Ar account | |
855 | .Cx | |
9e7fc5bf KM |
856 | Identify yourself to the remote FTP server. If the |
857 | password is not specified and the server requires it, | |
b5dc1377 | 858 | .Nm ftp |
9e7fc5bf KM |
859 | will prompt the user for it (after disabling local echo). |
860 | If an account field is not specified, and the FTP server | |
a154ee89 GM |
861 | requires it, the user will be prompted for it. |
862 | If an account field is specified, an account command will | |
863 | be relayed to the remote server after the login sequence | |
864 | is completed if the remote server did not require it | |
865 | for logging in. | |
866 | Unless | |
b5dc1377 CL |
867 | .Nm ftp |
868 | is invoked with \*(Lqauto-login\*(Rq disabled, this | |
9e7fc5bf KM |
869 | process is done automatically on initial connection to |
870 | the FTP server. | |
b5dc1377 | 871 | .Tp Ic verbose |
9e7fc5bf KM |
872 | Toggle verbose mode. In verbose mode, all responses from |
873 | the FTP server are displayed to the user. In addition, | |
a154ee89 | 874 | if verbose is on, when a file transfer completes, statistics |
9e7fc5bf | 875 | regarding the efficiency of the transfer are reported. By default, |
a154ee89 | 876 | verbose is on. |
b5dc1377 CL |
877 | .Tp Cx Ic ? |
878 | .Cx \&\ \& | |
879 | .Op Ar command | |
880 | .Cx | |
a154ee89 | 881 | A synonym for help. |
b5dc1377 CL |
882 | .Tp |
883 | .Pp | |
9e7fc5bf KM |
884 | Command arguments which have embedded spaces may be quoted with |
885 | quote (") marks. | |
b5dc1377 | 886 | .Sh "ABORTING A FILE TRANSFER" |
98a310f2 | 887 | To abort a file transfer, use the terminal interrupt key |
a154ee89 GM |
888 | (usually Ctrl-C). |
889 | Sending transfers will be immediately halted. | |
890 | Receiving transfers will be halted by sending a ftp protocol ABOR | |
891 | command to the remote server, and discarding any further data received. | |
892 | The speed at which this is accomplished depends upon the remote | |
893 | server's support for ABOR processing. | |
98a310f2 | 894 | If the remote server does not support the ABOR command, an "ftp>" |
a154ee89 GM |
895 | prompt will not appear until the remote server has completed |
896 | sending the requested file. | |
b5dc1377 | 897 | .Pp |
a154ee89 | 898 | The terminal interrupt key sequence will be ignored when |
b5dc1377 | 899 | .Nm ftp |
a154ee89 GM |
900 | has completed any local processing and is awaiting a reply |
901 | from the remote server. | |
902 | A long delay in this mode may result from the ABOR processing described | |
903 | above, or from unexpected behavior by the remote server, including | |
904 | violations of the ftp protocol. | |
905 | If the delay results from unexpected remote server behavior, the local | |
b5dc1377 | 906 | .Nm ftp |
a154ee89 | 907 | program must be killed by hand. |
b5dc1377 | 908 | .Sh "FILE NAMING CONVENTIONS" |
a154ee89 | 909 | Files specified as arguments to |
b5dc1377 | 910 | .Nm ftp |
9e7fc5bf | 911 | commands are processed according to the following rules. |
b5dc1377 CL |
912 | .Tw Fl |
913 | .Tp \&1) | |
914 | If the file name \*(Lq\-\*(Rq is specified, the | |
915 | .Ar stdin | |
a154ee89 | 916 | (for reading) or |
b5dc1377 | 917 | .Ar stdout |
9e7fc5bf | 918 | (for writing) is used. |
b5dc1377 CL |
919 | .Tp \&2) |
920 | If the first character of the file name is \*(Lq\*(Rq, the | |
9e7fc5bf | 921 | remainder of the argument is interpreted as a shell command. |
b5dc1377 CL |
922 | .Nm Ftp |
923 | then forks a shell, using | |
924 | .Xr popen 3 | |
a154ee89 GM |
925 | with the argument supplied, and reads (writes) from the stdout |
926 | (stdin). If the shell command includes spaces, the argument | |
b5dc1377 CL |
927 | must be quoted; e.g. \*(Lq" ls -lt"\*(Rq. A particularly |
928 | useful example of this mechanism is: \*(Lqdir more\*(Rq. | |
929 | .Tp \&3) | |
930 | Failing the above checks, if ``globbing'' is enabled, | |
9e7fc5bf | 931 | local file names are expanded |
b5dc1377 CL |
932 | according to the rules used in the |
933 | .Xr csh 1 ; | |
934 | c.f. the | |
935 | .Ic glob | |
936 | command. | |
a154ee89 | 937 | If the |
b5dc1377 | 938 | .Nm ftp |
a154ee89 | 939 | command expects a single local file ( .e.g. |
b5dc1377 | 940 | .Ic put ) , |
a154ee89 | 941 | only the first filename generated by the "globbing" operation is used. |
b5dc1377 | 942 | .Tp \&4) |
a154ee89 | 943 | For |
b5dc1377 | 944 | .Ic mget |
a154ee89 | 945 | commands and |
b5dc1377 | 946 | .Ic get |
a154ee89 GM |
947 | commands with unspecified local file names, the local filename is |
948 | the remote filename, which may be altered by a | |
b5dc1377 CL |
949 | .Ic case , |
950 | .Ic ntrans , | |
a154ee89 | 951 | or |
b5dc1377 | 952 | .Ic nmap |
a154ee89 GM |
953 | setting. |
954 | The resulting filename may then be altered if | |
b5dc1377 | 955 | .Ic runique |
a154ee89 | 956 | is on. |
b5dc1377 | 957 | .Tp \&5) |
a154ee89 | 958 | For |
b5dc1377 | 959 | .Ic mput |
a154ee89 | 960 | commands and |
b5dc1377 | 961 | .Ic put |
a154ee89 GM |
962 | commands with unspecified remote file names, the remote filename is |
963 | the local filename, which may be altered by a | |
b5dc1377 | 964 | .Ic ntrans |
a154ee89 | 965 | or |
b5dc1377 | 966 | .Ic nmap |
a154ee89 GM |
967 | setting. |
968 | The resulting filename may then be altered by the remote server if | |
b5dc1377 | 969 | .Ic sunique |
a154ee89 | 970 | is on. |
b5dc1377 CL |
971 | .Tp |
972 | .Sh "FILE TRANSFER PARAMETERS" | |
9e7fc5bf | 973 | The FTP specification specifies many parameters which may |
b5dc1377 CL |
974 | affect a file transfer. The |
975 | .Ic type | |
976 | may be one of \*(Lqascii\*(Rq, \*(Lqimage\*(Rq (binary), | |
977 | \*(Lqebcdic\*(Rq, and \*(Lqlocal byte size\*(Rq (for PDP-10's | |
a154ee89 | 978 | and PDP-20's mostly). |
b5dc1377 | 979 | .Nm Ftp |
a154ee89 | 980 | supports the ascii and image types of file transfer, |
b5dc1377 CL |
981 | plus local byte size 8 for |
982 | .Ic tenex | |
983 | mode transfers. | |
984 | .Pp | |
985 | .Nm Ftp | |
a154ee89 | 986 | supports only the default values for the remaining |
b5dc1377 CL |
987 | file transfer parameters: |
988 | .Ic mode , | |
989 | .Ic form , | |
a154ee89 | 990 | and |
b5dc1377 CL |
991 | .Ic struct . |
992 | .Sh "THE .netrc FILE" | |
a154ee89 | 993 | The |
b5dc1377 CL |
994 | .Pa .netrc |
995 | file contains login and initialization information | |
a154ee89 GM |
996 | used by the auto-login process. |
997 | It resides in the user's home directory. | |
998 | The following tokens are recognized; they may be separated by spaces, | |
999 | tabs, or new-lines: | |
b5dc1377 CL |
1000 | .Tw password |
1001 | .Tp Cx Ic machine | |
1002 | .Cx \&\ \& | |
1003 | .Ar name | |
1004 | .Cx | |
a154ee89 GM |
1005 | Identify a remote machine name. |
1006 | The auto-login process searches the .netrc file for a | |
b5dc1377 | 1007 | .Ic machine |
2c32d7db | 1008 | token that matches the remote machine specified on the |
b5dc1377 | 1009 | .Nm ftp |
a154ee89 | 1010 | command line or as an |
b5dc1377 | 1011 | .Ic open |
a154ee89 | 1012 | command argument. |
a154ee89 GM |
1013 | Once a match is made, the subsequent .netrc tokens are processed, |
1014 | stopping when the end of file is reached or another | |
b5dc1377 | 1015 | .Ic machine |
cdc35b45 | 1016 | or a |
b5dc1377 | 1017 | .Ic default |
a154ee89 | 1018 | token is encountered. |
b5dc1377 CL |
1019 | .Tp Ic default |
1020 | This is the same as | |
1021 | .Ic machine | |
1022 | .Ar name | |
1023 | except that | |
1024 | .Ic default | |
cdc35b45 | 1025 | matches any name. |
b5dc1377 CL |
1026 | There can be only one |
1027 | .Ic default | |
1028 | token, and it must be after all | |
1029 | .Ic machine | |
1030 | tokens. | |
cdc35b45 | 1031 | This is normally used as: |
b5dc1377 CL |
1032 | .Dl default login anonymous password user@site |
1033 | thereby giving the user | |
1034 | .Ar automatic | |
1035 | anonymous ftp login to | |
1036 | machines not specified in | |
1037 | .Pa .netrc . | |
1038 | This can be overridden | |
1039 | by using the | |
1040 | .Fl n | |
1041 | flag to disable auto-login. | |
1042 | .Tp Cx Ic login | |
1043 | .Cx \&\ \& | |
1044 | .Ar name | |
1045 | .Cx | |
a154ee89 GM |
1046 | Identify a user on the remote machine. |
1047 | If this token is present, the auto-login process will initiate | |
1048 | a login using the specified name. | |
b5dc1377 CL |
1049 | .Tp Cx Ic password |
1050 | .Cx \&\ \& | |
1051 | .Ar string | |
1052 | .Cx | |
a154ee89 GM |
1053 | Supply a password. |
1054 | If this token is present, the auto-login process will supply the | |
1055 | specified string if the remote server requires a password as part | |
1056 | of the login process. | |
b5dc1377 CL |
1057 | Note that if this token is present in the |
1058 | .Pa .netrc | |
1059 | file for any user other | |
1060 | than | |
1061 | .Ar anonymous , | |
1062 | .Nm ftp | |
1063 | will abort the auto-login process if the | |
1064 | .Pa .netrc | |
1065 | is readable by | |
a154ee89 | 1066 | anyone besides the user. |
b5dc1377 CL |
1067 | .Tp Cx Ic account |
1068 | .Cx \&\ \& | |
1069 | .Ar string | |
1070 | .Cx | |
a154ee89 GM |
1071 | Supply an additional account password. |
1072 | If this token is present, the auto-login process will supply the | |
1073 | specified string if the remote server requires an additional | |
1074 | account password, or the auto-login process will initiate an | |
1075 | ACCT command if it does not. | |
b5dc1377 CL |
1076 | .Tp Cx Ic macdef |
1077 | .Cx \&\ \& | |
1078 | .Ar name | |
1079 | .Cx | |
a154ee89 GM |
1080 | Define a macro. |
1081 | This token functions like the | |
b5dc1377 CL |
1082 | .Nm ftp |
1083 | .Ic macdef | |
a154ee89 GM |
1084 | command functions. |
1085 | A macro is defined with the specified name; its contents begin with the | |
b5dc1377 CL |
1086 | next |
1087 | .Pa .netrc | |
1088 | line and continue until a null line (consecutive new-line | |
a154ee89 GM |
1089 | characters) is encountered. |
1090 | If a macro named | |
b5dc1377 | 1091 | .Ic init |
a154ee89 GM |
1092 | is defined, it is automatically executed as the last step in the |
1093 | auto-login process. | |
b5dc1377 CL |
1094 | .Tp |
1095 | .Sh ENVIRONMENT | |
1096 | .Nm Ftp | |
1097 | makes use of the | |
1098 | .Ev HOME | |
1099 | and | |
1100 | .Ev SHELL | |
1101 | environment variables. | |
1102 | .Sh SEE ALSO | |
1103 | .Xr ftpd 8 | |
1104 | .Sh HISTORY | |
1105 | .Nm Ftp | |
1106 | appeared in 4.2 BSD. | |
1107 | .Sh BUGS | |
a154ee89 GM |
1108 | Correct execution of many commands depends upon proper behavior |
1109 | by the remote server. | |
b5dc1377 | 1110 | .Pp |
98a310f2 MK |
1111 | An error in the treatment of carriage returns |
1112 | in the 4.2BSD UNIX ascii-mode transfer code | |
a154ee89 GM |
1113 | has been corrected. |
1114 | This correction may result in incorrect transfers of binary files | |
98a310f2 | 1115 | to and from 4.2BSD servers using the ascii type. |
a154ee89 | 1116 | Avoid this problem by using the binary image type. |