Debian Codegraph @

upstream/debian-trixie/man1/tnftp.1

raw
1 .\" $NetBSD: ftp.1,v 1.19 2023/04/09 00:56:07 lukem Exp $
2 .\" from NetBSD: ftp.1,v 1.150 2023/02/25 17:37:09 uwe Exp
3 .\"
4 .\" Copyright (c) 1996-2023 The NetBSD Foundation, Inc.
5 .\" All rights reserved.
6 .\"
7 .\" This code is derived from software contributed to The NetBSD Foundation
8 .\" by Luke Mewburn.
9 .\"
10 .\" Redistribution and use in source and binary forms, with or without
11 .\" modification, are permitted provided that the following conditions
12 .\" are met:
13 .\" 1. Redistributions of source code must retain the above copyright
14 .\" notice, this list of conditions and the following disclaimer.
15 .\" 2. Redistributions in binary form must reproduce the above copyright
16 .\" notice, this list of conditions and the following disclaimer in the
17 .\" documentation and/or other materials provided with the distribution.
18 .\"
19 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 .\" POSSIBILITY OF SUCH DAMAGE.
30 .\"
31 .\"
32 .\" Copyright (c) 1985, 1989, 1990, 1993
33 .\" The Regents of the University of California. All rights reserved.
34 .\"
35 .\" Redistribution and use in source and binary forms, with or without
36 .\" modification, are permitted provided that the following conditions
37 .\" are met:
38 .\" 1. Redistributions of source code must retain the above copyright
39 .\" notice, this list of conditions and the following disclaimer.
40 .\" 2. Redistributions in binary form must reproduce the above copyright
41 .\" notice, this list of conditions and the following disclaimer in the
42 .\" documentation and/or other materials provided with the distribution.
43 .\" 3. Neither the name of the University nor the names of its contributors
44 .\" may be used to endorse or promote products derived from this software
45 .\" without specific prior written permission.
46 .\"
47 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57 .\" SUCH DAMAGE.
58 .\"
59 .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
60 .\"
61 .Dd February 25, 2023
62 .Dt TNFTP 1
63 .Os
64 .Sh NAME
65 .Nm tnftp
66 .Nd Internet file transfer program
67 .Sh SYNOPSIS
68 .Nm
69 .Op Fl 46AadefginpRtVv?
70 .Op Fl N Ar netrc
71 .Op Fl o Ar output
72 .Op Fl P Ar port
73 .Op Fl q Ar quittime
74 .Op Fl r Ar retry
75 .Op Fl s Ar srcaddr
76 .Bk -words
77 .\" [-T dir,max[,inc]]
78 .Oo
79 .Fl T Xo
80 .Sm off
81 .Ar dir Cm \&,
82 .Ar max
83 .Op Cm \&, Ar inc
84 .Sm on
85 .Xc
86 .Oc
87 .Ek
88 .Op Fl x Ar xfersize
89 .Bk -words
90 .\" [[user@]host [port]]
91 .Oo
92 .Oo Ar user Ns Li \&@ Oc Ns Ar host Oo Ar port Oc
93 .Oc
94 .Ek
95 .Bk -words
96 .\" [[user@]host:[path][/]]
97 .Sm off
98 .Oo
99 .Op Ar user Li \&@
100 .Ar host Li \&:
101 .Op Ar path
102 .Op Li /
103 .Oc
104 .Sm on
105 .Ek
106 .Bk -words
107 .\" [file:///path]
108 .Sm off
109 .Oo
110 .Li file:/// Ar path
111 .Oc
112 .Sm on
113 .Ek
114 .Bk -words
115 .\" [ftp://[user[:password]@]host[:port]/path[/]]
116 .Sm off
117 .Oo
118 .Li ftp://
119 .Oo Ar user
120 .Op Li \&: Ar password
121 .Li \&@ Oc
122 .Ar host Oo Li \&: Ar port Oc
123 .Li / Ar path
124 .Op Li /
125 .Op Li ;type= Ar type
126 .Oc
127 .Sm on
128 .Ek
129 .Bk -words
130 .\" [http://[user[:password]@]host[:port]/path]
131 .Sm off
132 .Oo
133 .Li http://
134 .Oo Ar user
135 .Op Li \&: Ar password
136 .Li \&@ Oc
137 .Ar host Oo Li \&: Ar port Oc
138 .Li / Ar path
139 .Oc
140 .Sm on
141 .Ek
142 .Bk -words
143 .\" [https://[user[:password]@]host[:port]/path]
144 .Sm off
145 .Oo
146 .Li https://
147 .Oo Ar user
148 .Op Li \&: Ar password
149 .Li \&@ Oc
150 .Ar host Oo Li \&: Ar port Oc
151 .Li / Ar path
152 .Oc
153 .Sm on
154 .Ek
155 .Ar \&...
156 .Nm
157 .Bk -words
158 .Fl u Ar url Ar
159 .Ek
160 .Sh DESCRIPTION
161 .Nm
162 is the user interface to the Internet standard File Transfer Protocol.
163 The program allows a user to transfer files to and from a
164 remote network site.
165 .Pp
166 The last five arguments will fetch a file using the
167 .Tn FTP
168 or
169 .Tn HTTP
170 protocols, or by direct copying, into the current directory.
171 This is ideal for scripts.
172 Refer to
173 .Sx AUTO-FETCHING FILES
174 below for more information.
175 .Pp
176 Options may be specified at the command line, or to the
177 command interpreter.
178 .Bl -tag -width Fl
179 .It Fl 4
180 Forces
181 .Nm
182 to only use IPv4 addresses.
183 .It Fl 6
184 Forces
185 .Nm
186 to only use IPv6 addresses.
187 .It Fl A
188 Force active mode
189 .Tn FTP .
190 By default,
191 .Nm
192 will try to use passive mode
193 .Tn FTP
194 and fall back to active mode
195 if passive is not supported by the server.
196 This option causes
197 .Nm
198 to always use an active connection.
199 It is only useful for connecting to very old servers that do not
200 implement passive mode properly.
201 .It Fl a
202 Causes
203 .Nm
204 to bypass normal login procedure, and use an anonymous login instead.
205 .It Fl d
206 Enables debugging.
207 .It Fl e
208 Disables command line editing.
209 This is useful for Emacs ange-ftp mode.
210 .It Fl f
211 Forces a cache reload for transfers that go through the
212 .Tn FTP
213 or
214 .Tn HTTP
215 proxies.
216 .It Fl g
217 Disables file name globbing.
218 .It Fl i
219 Turns off interactive prompting during
220 multiple file transfers.
221 .It Fl N Ar netrc
222 Use
223 .Ar netrc
224 instead of
225 .Pa ~/.netrc .
226 Refer to
227 .Sx THE .netrc FILE
228 for more information.
229 .It Fl n
230 Restrains
231 .Nm
232 from attempting
233 .Dq auto-login
234 upon initial connection for non auto-fetch transfers.
235 If auto-login is enabled,
236 .Nm
237 will check the
238 .Pa .netrc
239 (see below) file in the user's home directory for an entry describing
240 an account on the remote machine.
241 If no entry exists,
242 .Nm
243 will prompt for the remote machine login name
244 .Pq default is the user identity on the local machine ,
245 and, if necessary, prompt for a password
246 and an account with which to login.
247 To override the auto-login for auto-fetch transfers, specify the
248 username
249 .Pq and optionally, password
250 as appropriate.
251 .It Fl o Ar output
252 When auto-fetching files, save the contents in
253 .Ar output .
254 .Ar output
255 is parsed according to the
256 .Sx FILE NAMING CONVENTIONS
257 below.
258 If
259 .Ar output
260 is not
261 .Sq Fl
262 or doesn't start with
263 .Sq Cm \&| ,
264 then only the first file specified will be retrieved into
265 .Ar output ;
266 all other files will be retrieved into the basename of their
267 remote name.
268 .It Fl P Ar port
269 Sets the port number to
270 .Ar port .
271 .It Fl p
272 Enable passive mode operation for use behind connection filtering firewalls.
273 This option has been deprecated as
274 .Nm
275 now tries to use passive mode by default, falling back to active mode
276 if the server does not support passive connections.
277 .It Fl q Ar quittime
278 Quit if the connection has stalled for
279 .Ar quittime
280 seconds.
281 .It Fl R
282 Restart all non-proxied auto-fetches.
283 .It Fl r Ar wait
284 Retry the connection attempt if it failed, pausing for
285 .Ar wait
286 seconds.
287 .It Fl s Ar srcaddr
288 Uses
289 .Ar srcaddr
290 as the local IP address for all connections.
291 .It Fl t
292 Enables packet tracing.
293 .It Fl T Ar direction Ns Cm \&, Ns Ar maximum\| Ns Oo Cm \&, Ns Ar increment Oc
294 Set the maximum transfer rate for
295 .Ar direction
296 to
297 .Ar maximum
298 bytes/second,
299 and if specified, the increment to
300 .Ar increment
301 bytes/second.
302 Refer to
303 .Ic rate
304 for more information.
305 .It Fl u Ar url Ar
306 Upload files on the command line to
307 .Ar url
308 where
309 .Ar url
310 is one of the
311 .Ql ftp://
312 URL types as supported by auto-fetch
313 .Pq with an optional target filename for single file uploads ,
314 and
315 .Ar file
316 is one or more local files to be uploaded.
317 .It Fl V
318 Disable
319 .Ic verbose
320 and
321 .Ic progress ,
322 overriding the default of enabled when output is to a terminal.
323 .It Fl v
324 Enable
325 .Ic verbose
326 and
327 .Ic progress .
328 This is the default if output is to a terminal
329 .Po
330 and in the case of
331 .Ic progress ,
332 .Nm
333 is the foreground process
334 .Pc .
335 Forces
336 .Nm
337 to show all responses from the remote server, as well
338 as report on data transfer statistics.
339 .It Fl x Ar xfersize
340 Set the size of the socket send and receive buffers to
341 .Ar xfersize .
342 Refer to
343 .Ic xferbuf
344 for more information.
345 .It Fl \&?
346 Display help to stdout, and exit.
347 .El
348 .Pp
349 The client host with which
350 .Nm
351 is to communicate may be specified on the command line.
352 If this is done,
353 .Nm
354 will immediately attempt to establish a connection to an
355 .Tn FTP
356 server on that host; otherwise,
357 .Nm
358 will enter its command interpreter and await instructions
359 from the user.
360 When
361 .Nm
362 is awaiting commands from the user the prompt
363 .Ql ftp>
364 is provided to the user.
365 The following commands are recognized
366 by
367 .Nm :
368 .Bl -tag -width Ic
369 .It Ic \&! Op Ar command Op Ar args
370 Invoke an interactive shell on the local machine.
371 If there are arguments, the first is taken to be a command to execute
372 directly, with the rest of the arguments as its arguments.
373 .It Ic \&$ Ar macro-name Op Ar args
374 Execute the macro
375 .Ar macro-name
376 that was defined with the
377 .Ic macdef
378 command.
379 Arguments are passed to the macro unglobbed.
380 .It Ic account Op Ar passwd
381 Supply a supplemental password required by a remote system for access
382 to resources once a login has been successfully completed.
383 If no argument is included, the user will be prompted for an account
384 password in a non-echoing input mode.
385 .It Ic append Ar local-file Op Ar remote-file
386 Append a local file to a file on the remote machine.
387 If
388 .Ar remote-file
389 is left unspecified, the local file name is used in naming the
390 remote file after being altered by any
391 .Ic ntrans
392 or
393 .Ic nmap
394 setting.
395 File transfer uses the current settings for
396 .Ic type ,
397 .Ic format ,
398 .Ic mode ,
399 and
400 .Ic structure .
401 .It Ic ascii
402 Set the file transfer
403 .Ic type
404 to network
405 .Tn ASCII .
406 This is the default type.
407 .It Ic bell
408 Arrange that a bell be sounded after each file transfer
409 command is completed.
410 .It Ic binary
411 Set the file transfer
412 .Ic type
413 to support binary image transfer.
414 .It Ic bye
415 Terminate the
416 .Tn FTP
417 session with the remote server
418 and exit
419 .Nm tnftp .
420 An end of file will also terminate the session and exit.
421 .It Ic case
422 Toggle remote computer file name case mapping during
423 .Ic get ,
424 .Ic mget
425 and
426 .Ic mput
427 commands.
428 When
429 .Ic case
430 is on (default is off), remote computer file names with all letters in
431 upper case are written in the local directory with the letters mapped
432 to lower case.
433 .It Ic \&cd Ar remote-directory
434 Change the working directory on the remote machine
435 to
436 .Ar remote-directory .
437 .It Ic cdup
438 Change the remote machine working directory to the parent of the
439 current remote machine working directory.
440 .It Ic chmod Ar mode remote-file
441 Change the permission modes of the file
442 .Ar remote-file
443 on the remote
444 system to
445 .Ar mode .
446 .It Ic close
447 Terminate the
448 .Tn FTP
449 session with the remote server, and
450 return to the command interpreter.
451 Any defined macros are erased.
452 .It Ic \&cr
453 Toggle carriage return stripping during
454 ascii type file retrieval.
455 Records are denoted by a carriage return/linefeed sequence
456 during ascii type file transfer.
457 When
458 .Ic \&cr
459 is on (the default), carriage returns are stripped from this
460 sequence to conform with the
461 .Ux
462 single linefeed record
463 delimiter.
464 Records on
465 .Pf non\- Ux
466 remote systems may contain single linefeeds;
467 when an ascii type transfer is made, these linefeeds may be
468 distinguished from a record delimiter only when
469 .Ic \&cr
470 is off.
471 .It Ic debug Op Ar debug-value
472 Toggle debugging mode.
473 If an optional
474 .Ar debug-value
475 is specified it is used to set the debugging level.
476 When debugging is on,
477 .Nm
478 prints each command sent to the remote machine, preceded
479 by the string
480 .Ql \-\-> .
481 .It Ic delete Ar remote-file
482 Delete the file
483 .Ar remote-file
484 on the remote machine.
485 .It Ic dir Op Ar remote-path Op Ar local-file
486 Print a listing of the contents of a
487 directory on the remote machine.
488 The listing includes any system-dependent information that the server
489 chooses to include; for example, most
490 .Ux
491 systems will produce
492 output from the command
493 .Ql ls \-l .
494 If
495 .Ar remote-path
496 is left unspecified, the current working directory is used.
497 If interactive prompting is on,
498 .Nm
499 will prompt the user to verify that the last argument is indeed the
500 target local file for receiving
501 .Ic dir
502 output.
503 If no local file is specified, or if
504 .Ar local-file
505 is
506 .Sq Fl ,
507 the output is sent to the terminal.
508 .It Ic disconnect
509 A synonym for
510 .Ic close .
511 .It Ic edit
512 Toggle command line editing, and context sensitive command and file
513 completion.
514 This is automatically enabled if input is from a terminal, and
515 disabled otherwise.
516 .It Ic epsv , epsv4 , epsv6
517 Toggle the use of the extended
518 .Dv EPSV
519 and
520 .Dv EPRT
521 commands on all IP, IPv4, and IPv6 connections respectively.
522 First try
523 .Dv EPSV Ns \^/\^ Ns Dv EPRT ,
524 and then
525 .Dv PASV Ns \^/\^ Ns Dv PORT .
526 This is enabled by default.
527 If an extended command fails then this option will be temporarily
528 disabled for the duration of the current connection, or until
529 .Ic epsv ,
530 .Ic epsv4 ,
531 or
532 .Ic epsv6
533 is executed again.
534 .It Ic exit
535 A synonym for
536 .Ic bye .
537 .It Ic features
538 Display what features the remote server supports
539 .Pq using the Dv FEAT No command .
540 .It Ic fget Ar localfile
541 Retrieve the files listed in
542 .Ar localfile ,
543 which has one line per filename.
544 .It Ic form Ar format
545 Set the file transfer
546 .Ic form
547 to
548 .Ar format .
549 The default (and only supported)
550 format is
551 .Ql non-print .
552 .It Ic ftp Ar host Op Ar port
553 A synonym for
554 .Ic open .
555 .It Ic gate Op Ar host Op Ar port
556 Toggle gate-ftp mode, which used to connect through the
557 TIS FWTK and Gauntlet
558 .Tn FTP
559 proxies.
560 This will not be permitted if the gate-ftp server hasn't been set
561 .Po
562 either explicitly by the user, or from the
563 .Ev FTPSERVER
564 environment variable
565 .Pc .
566 If
567 .Ar host
568 is given,
569 then gate-ftp mode will be enabled, and the gate-ftp server will be set to
570 .Ar host .
571 If
572 .Ar port
573 is also given, that will be used as the port to connect to on the
574 gate-ftp server.
575 .It Ic get Ar remote-file Op Ar local-file
576 Retrieve the
577 .Ar remote-file
578 and store it on the local machine.
579 If the local
580 file name is not specified, it is given the same
581 name it has on the remote machine, subject to
582 alteration by the current
583 .Ic case ,
584 .Ic ntrans ,
585 and
586 .Ic nmap
587 settings.
588 The current settings for
589 .Ic type ,
590 .Ic form ,
591 .Ic mode ,
592 and
593 .Ic structure
594 are used while transferring the file.
595 .It Ic glob
596 Toggle filename expansion for
597 .Ic mdelete ,
598 .Ic mget ,
599 .Ic mput ,
600 and
601 .Ic mreget .
602 If globbing is turned off with
603 .Ic glob ,
604 the file name arguments
605 are taken literally and not expanded.
606 Globbing for
607 .Ic mput
608 is done as in
609 .Xr csh 1 .
610 For
611 .Ic mdelete ,
612 .Ic mget ,
613 and
614 .Ic mreget ,
615 each remote file name is expanded
616 separately on the remote machine and the lists are not merged.
617 Expansion of a directory name is likely to be
618 different from expansion of the name of an ordinary file:
619 the exact result depends on the foreign operating system and
620 .Tn FTP
621 server,
622 and can be previewed by doing
623 .Sq Li mls remote-files \- .
624 Note:
625 .Ic mget ,
626 .Ic mput
627 and
628 .Ic mreget
629 are not meant to transfer
630 entire directory subtrees of files.
631 That can be done by
632 transferring a
633 .Xr tar 1
634 archive of the subtree (in binary mode).
635 .It Ic hash Op Ar size
636 Toggle hash-sign
637 .Pq Ql #
638 printing for each data block transferred.
639 The size of a data block defaults to 1024 bytes.
640 This can be changed by specifying
641 .Ar size
642 in bytes.
643 Enabling
644 .Ic hash
645 disables
646 .Ic progress .
647 .It Ic help Op Ar command
648 Print an informative message about the meaning of
649 .Ar command .
650 If no argument is given,
651 .Nm
652 prints a list of the known commands.
653 .It Ic idle Op Ar seconds
654 Set the inactivity timer on the remote server to
655 .Ar seconds
656 seconds.
657 If
658 .Ar seconds
659 is omitted, the current inactivity timer is printed.
660 .It Ic image
661 A synonym for
662 .Ic binary .
663 .It Ic lcd Op Ar directory
664 Change the working directory on the local machine.
665 If
666 no
667 .Ar directory
668 is specified, the user's home directory is used.
669 .It Ic less Ar file
670 A synonym for
671 .Ic page .
672 .It Ic lpage Ar local-file
673 Display
674 .Ar local-file
675 with the program specified by the
676 .Ic "set pager"
677 option.
678 .It Ic lpwd
679 Print the working directory on the local machine.
680 .It Ic \&ls Op Ar remote-path Op Ar local-file
681 A synonym for
682 .Ic dir .
683 .It Ic macdef Ar macro-name
684 Define a macro.
685 Subsequent lines are stored as the macro
686 .Ar macro-name ;
687 a null line
688 .Po
689 consecutive newline characters in a file or carriage
690 returns from the terminal
691 .Pc
692 terminates macro input mode.
693 There is a limit of 16 macros and 4096 total characters in all
694 defined macros.
695 Macro names can be a maximum of 8 characters.
696 Macros are only applicable to the current session they are
697 defined within
698 .Po
699 or if defined outside a session, to the session
700 invoked with the next
701 .Ic open
702 command
703 .Pc ,
704 and remain defined until a
705 .Ic close
706 command is executed.
707 To invoke a macro, use the
708 .Ic $
709 command (see above).
710 .Pp
711 The macro processor interprets
712 .Ql $
713 and
714 .Ql \e
715 as special characters.
716 A
717 .Ql $
718 followed by a number (or numbers) is replaced by the
719 corresponding argument on the macro invocation command line.
720 A
721 .Ql $
722 followed by an
723 .Ql i
724 signals the macro processor that the executing macro is to be
725 looped.
726 On the first pass
727 .Ql $i
728 is replaced by the first argument on the macro invocation command
729 line, on the second pass it is replaced by the second argument,
730 and so on.
731 A
732 .Ql \e
733 followed by any character is replaced by that character.
734 Use the
735 .Ql \e
736 to prevent special treatment of the
737 .Ql $ .
738 .It Ic mdelete Op Ar remote-files
739 Delete the
740 .Ar remote-files
741 on the remote machine.
742 .It Ic mdir Ar remote-files local-file
743 Like
744 .Ic dir ,
745 except multiple remote files may be specified.
746 If interactive prompting is on,
747 .Nm
748 will prompt the user to verify that the last argument is indeed the
749 target local file for receiving
750 .Ic mdir
751 output.
752 .It Ic mget Ar remote-files
753 Expand the
754 .Ar remote-files
755 on the remote machine
756 and do a
757 .Ic get
758 for each file name thus produced.
759 See
760 .Ic glob
761 for details on the filename expansion.
762 Resulting file names will then be processed according to
763 .Ic case ,
764 .Ic ntrans ,
765 and
766 .Ic nmap
767 settings.
768 Files are transferred into the local working directory,
769 which can be changed with
770 .Ic lcd Ar directory ;
771 new local directories can be created with
772 .Ic \&! mkdir Ar directory .
773 .It Ic mkdir Ar directory-name
774 Make a directory on the remote machine.
775 .It Ic mls Ar remote-files local-file
776 Like
777 .Ic ls ,
778 except multiple remote files may be specified,
779 and the
780 .Ar local-file
781 must be specified.
782 If interactive prompting is on,
783 .Nm
784 will prompt the user to verify that the last argument is indeed the
785 target local file for receiving
786 .Ic mls
787 output.
788 .It Ic mlsd Op Ar remote-path
789 Display the contents of
790 .Ar remote-path
791 .Pq which should default to the current directory if not given
792 in a machine-parsable form, using
793 .Dv MLSD .
794 The format of display can be changed with
795 .Sq Ic remopts mlst Ar \&... .
796 .It Ic mlst Op Ar remote-path
797 Display the details about
798 .Ar remote-path
799 .Pq which should default to the current directory if not given
800 in a machine-parsable form, using
801 .Dv MLST .
802 The format of display can be changed with
803 .Sq Ic remopts mlst Ar \&... .
804 .It Ic mode Ar mode-name
805 Set the file transfer
806 .Ic mode
807 to
808 .Ar mode-name .
809 The default
810 .Pq and only supported
811 mode is
812 .Ql stream .
813 .It Ic modtime Ar remote-file
814 Show the last modification time of the file on the remote machine, in
815 .Li RFC 2822
816 format.
817 .It Ic more Ar file
818 A synonym for
819 .Ic page .
820 .It Ic mput Ar local-files
821 Expand wild cards in the list of local files given as arguments
822 and do a
823 .Ic put
824 for each file in the resulting list.
825 See
826 .Ic glob
827 for details of filename expansion.
828 Resulting file names will then be processed according to
829 .Ic ntrans
830 and
831 .Ic nmap
832 settings.
833 .It Ic mreget Ar remote-files
834 As per
835 .Ic mget ,
836 but performs a
837 .Ic reget
838 instead of
839 .Ic get .
840 .It Ic msend Ar local-files
841 A synonym for
842 .Ic mput .
843 .It Ic newer Ar remote-file Op Ar local-file
844 Get the file only if the modification time of the remote file is more
845 recent that the file on the current system.
846 If the file does not
847 exist on the current system, the remote file is considered
848 .Ic newer .
849 Otherwise, this command is identical to
850 .Ic get .
851 .It Ic nlist Op Ar remote-path Op Ar local-file
852 A synonym for
853 .Ic ls .
854 .It Ic nmap Op Ar inpattern outpattern
855 Set or unset the filename mapping mechanism.
856 If no arguments are specified, the filename mapping mechanism is unset.
857 If arguments are specified, remote filenames are mapped during
858 .Ic mput
859 commands and
860 .Ic put
861 commands issued without a specified remote target filename.
862 If arguments are specified, local filenames are mapped during
863 .Ic mget
864 commands and
865 .Ic get
866 commands issued without a specified local target filename.
867 This command is useful when connecting to a
868 .No non\- Ns Ux
869 remote computer
870 with different file naming conventions or practices.
871 The mapping follows the pattern set by
872 .Ar inpattern
873 and
874 .Ar outpattern .
875 .Pp
876 .Ar inpattern
877 is a template for incoming filenames
878 .Po
879 which may have already been processed according to the
880 .Ic ntrans
881 and
882 .Ic case
883 settings
884 .Pc .
885 Variable templating is accomplished by including the
886 sequences
887 .Ql $1 ,
888 .Ql $2 ,
889 \&...\|,
890 .Ql $9
891 in
892 .Ar inpattern .
893 Use
894 .Ql \e
895 to prevent this special treatment of the
896 .Ql $
897 character.
898 All other characters are treated literally, and are used to determine the
899 .Ic nmap
900 .Op Ar inpattern
901 variable values.
902 For example, given
903 .Ar inpattern
904 .Ql $1.$2
905 and the remote file name
906 .Ql mydata.data ,
907 .Ql $1
908 would have the value
909 .Ql mydata ,
910 and
911 .Ql $2
912 would have the value
913 .Ql data .
914 .Pp
915 The
916 .Ar outpattern
917 determines the resulting mapped filename.
918 The sequences
919 .Ql $1 ,
920 .Ql $2 ,
921 \&...\|,
922 .Ql $9
923 are replaced by any value resulting from the
924 .Ar inpattern
925 template.
926 The sequence
927 .Ql $0
928 is replaced by the original filename.
929 Additionally, the sequence
930 .Sm off
931 .Li \&[ Ar seq1 Li \&, Ar seq2 Li \&]
932 .Sm on
933 is replaced by
934 .Ar seq1
935 if
936 .Ar seq1
937 is not a null string; otherwise it is replaced by
938 .Ar seq2 .
939 For example, the command
940 .Pp
941 .Dl nmap $1.$2.$3 [$1,$2].[$2,file]
942 .Pp
943 would yield
944 the output filename
945 .Ql myfile.data
946 for input filenames
947 .Ql myfile.data
948 and
949 .Ql myfile.data.old ,
950 .Ql myfile.file
951 for the input filename
952 .Ql myfile ,
953 and
954 .Ql myfile.myfile
955 for the input filename
956 .Ql \&.myfile .
957 Spaces may be included in
958 .Ar outpattern ,
959 as in the example:
960 .Pp
961 .Dl nmap $1 sed "s/ *$//" > $1
962 .Pp
963 Use the
964 .Ql \e
965 character to prevent special treatment
966 of the
967 .Ql $ ,
968 .Ql \&[ ,
969 .Ql \&] ,
970 and
971 .Ql \&,
972 characters.
973 .It Ic ntrans Op Ar inchars Op Ar outchars
974 Set or unset the filename character translation mechanism.
975 If no arguments are specified, the filename character
976 translation mechanism is unset.
977 If arguments are specified, characters in
978 remote filenames are translated during
979 .Ic mput
980 commands and
981 .Ic put
982 commands issued without a specified remote target filename.
983 If arguments are specified, characters in
984 local filenames are translated during
985 .Ic mget
986 commands and
987 .Ic get
988 commands issued without a specified local target filename.
989 This command is useful when connecting to a
990 .No non\- Ns Ux
991 remote computer
992 with different file naming conventions or practices.
993 Characters in a filename matching a character in
994 .Ar inchars
995 are replaced with the corresponding character in
996 .Ar outchars .
997 If the character's position in
998 .Ar inchars
999 is longer than the length of
1000 .Ar outchars ,
1001 the character is deleted from the file name.
1002 .It Ic open Ar host Op Ar port
1003 Establish a connection to the specified
1004 .Ar host
1005 .Tn FTP
1006 server.
1007 An optional port number may be supplied,
1008 in which case,
1009 .Nm
1010 will attempt to contact an
1011 .Tn FTP
1012 server at that port.
1013 If the
1014 .Ic "set auto-login"
1015 option is on (default),
1016 .Nm
1017 will also attempt to automatically log the user in to
1018 the
1019 .Tn FTP
1020 server (see below).
1021 .It Ic page Ar file
1022 Retrieve
1023 .Ic file
1024 and display with the program specified by the
1025 .Ic "set pager"
1026 option.
1027 .It Ic passive Op Cm auto
1028 Toggle passive mode (if no arguments are given).
1029 If
1030 .Cm auto
1031 is given, act as if
1032 .Ev FTPMODE
1033 is set to
1034 .Sq auto .
1035 If passive mode is turned on (default),
1036 .Nm
1037 will send a
1038 .Dv PASV
1039 command for all data connections instead of a
1040 .Dv PORT
1041 command.
1042 The
1043 .Dv PASV
1044 command requests that the remote server open a port for the data connection
1045 and return the address of that port.
1046 The remote server listens on that port and the client connects to it.
1047 When using the more traditional
1048 .Dv PORT
1049 command, the client listens on a port and sends that address to the remote
1050 server, who connects back to it.
1051 Passive mode is useful when using
1052 .Nm
1053 through a gateway router or host that controls the directionality of
1054 traffic.
1055 .Po
1056 Note that though
1057 .Tn FTP
1058 servers are required to support the
1059 .Dv PASV
1060 command by
1061 .Li RFC 1123 ,
1062 some do not.
1063 .Pc
1064 .It Ic pdir Op Ar remote-path
1065 Perform
1066 .Ic dir
1067 .Op Ar remote-path ,
1068 and display the result with the program specified by the
1069 .Ic "set pager"
1070 option.
1071 .It Ic pls Op Ar remote-path
1072 Perform
1073 .Ic ls
1074 .Op Ar remote-path ,
1075 and display the result with the program specified by the
1076 .Ic "set pager"
1077 option.
1078 .It Ic pmlsd Op Ar remote-path
1079 Perform
1080 .Ic mlsd
1081 .Op Ar remote-path ,
1082 and display the result with the program specified by the
1083 .Ic "set pager"
1084 option.
1085 .It Ic preserve
1086 Toggle preservation of modification times on retrieved files.
1087 .It Ic progress
1088 Toggle display of transfer progress bar.
1089 The progress bar will be disabled for a transfer that has
1090 .Ar local-file
1091 as
1092 .Sq Fl
1093 or a command that starts with
1094 .Ql \&| .
1095 Refer to
1096 .Sx FILE NAMING CONVENTIONS
1097 for more information.
1098 Enabling
1099 .Ic progress
1100 disables
1101 .Ic hash .
1102 .It Ic prompt
1103 Toggle interactive prompting.
1104 Interactive prompting
1105 occurs during multiple file transfers to allow the
1106 user to selectively retrieve or store files.
1107 If prompting is turned off (default is on), any
1108 .Ic mget
1109 or
1110 .Ic mput
1111 will transfer all files, and any
1112 .Ic mdelete
1113 will delete all files.
1114 .Pp
1115 When prompting is on, the following commands are available at a prompt:
1116 .Bl -tag -width 2n -offset indent
1117 .It Cm a
1118 Answer
1119 .Sq yes
1120 to the current file, and automatically answer
1121 .Sq yes
1122 to any remaining files for the current command.
1123 .It Cm n
1124 Answer
1125 .Sq no ,
1126 and do not transfer the file.
1127 .It Cm p
1128 Answer
1129 .Sq yes
1130 to the current file, and turn off prompt mode
1131 .Po
1132 as if
1133 .Ic prompt off
1134 had been given
1135 .Pc .
1136 .It Cm q
1137 Terminate the current operation.
1138 .It Cm y
1139 Answer
1140 .Sq yes ,
1141 and transfer the file.
1142 .It Cm \&?
1143 Display a help message.
1144 .El
1145 .Pp
1146 Any other response will answer
1147 .Sq yes
1148 to the current file.
1149 .It Ic proxy Ar ftp-command
1150 Execute an
1151 .Tn FTP
1152 command on a secondary control connection.
1153 This command allows simultaneous connection to two remote
1154 .Tn FTP
1155 servers for transferring files between the two servers.
1156 The first
1157 .Ic proxy
1158 command should be an
1159 .Ic open ,
1160 to establish the secondary control connection.
1161 Enter the command
1162 .Sq Li "proxy ?"
1163 to see other
1164 .Tn FTP
1165 commands executable on the secondary connection.
1166 The following commands behave differently when prefaced by
1167 .Ic proxy\^ :
1168 .Ic open
1169 will not define new macros during the auto-login process,
1170 .Ic close
1171 will not erase existing macro definitions,
1172 .Ic get
1173 and
1174 .Ic mget
1175 transfer files from the host on the primary control connection
1176 to the host on the secondary control connection, and
1177 .Ic put ,
1178 .Ic mput ,
1179 and
1180 .Ic append
1181 transfer files from the host on the secondary control connection
1182 to the host on the primary control connection.
1183 Third party file transfers depend upon support of the
1184 .Tn FTP
1185 protocol
1186 .Dv PASV
1187 command by the server on the secondary control connection.
1188 .It Ic put Ar local-file Op Ar remote-file
1189 Store a local file on the remote machine.
1190 If
1191 .Ar remote-file
1192 is left unspecified, the local file name is used
1193 after processing according to any
1194 .Ic ntrans
1195 or
1196 .Ic nmap
1197 settings
1198 in naming the remote file.
1199 File transfer uses the
1200 current settings for
1201 .Ic type ,
1202 .Ic format ,
1203 .Ic mode ,
1204 and
1205 .Ic structure .
1206 .It Ic pwd
1207 Print the name of the current working directory on the remote
1208 machine.
1209 .It Ic quit
1210 A synonym for
1211 .Ic bye .
1212 .It Ic quote Op Ar arg ...
1213 The arguments specified are sent, verbatim, to the remote
1214 .Tn FTP
1215 server.
1216 .It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc
1217 Throttle the maximum transfer rate to
1218 .Ar maximum
1219 bytes/second.
1220 If
1221 .Ar maximum
1222 is 0, disable the throttle.
1223 .Pp
1224 .Ar direction
1225 may be one of:
1226 .Bl -tag -width ".Cm all" -offset indent -compact
1227 .It Cm all
1228 Both directions.
1229 .It Cm get
1230 Incoming transfers.
1231 .It Cm put
1232 Outgoing transfers.
1233 .El
1234 .Pp
1235 .Ar maximum
1236 can be modified on the fly by
1237 .Ar increment
1238 bytes (default: 1024) each time a given signal is received:
1239 .Bl -tag -width ".Dv SIGUSR1" -offset indent
1240 .It Dv SIGUSR1
1241 Increment
1242 .Ar maximum
1243 by
1244 .Ar increment
1245 bytes.
1246 .It Dv SIGUSR2
1247 Decrement
1248 .Ar maximum
1249 by
1250 .Ar increment
1251 bytes.
1252 The result must be a positive number.
1253 .El
1254 .Pp
1255 If
1256 .Ar maximum
1257 is not supplied, the current throttle rates are displayed.
1258 .Pp
1259 Note:
1260 .Ic rate
1261 is not yet implemented for ascii mode transfers.
1262 .It Ic rcvbuf Ar size
1263 Set the size of the socket receive buffer to
1264 .Ar size .
1265 .It Ic recv Ar remote-file Op Ar local-file
1266 A synonym for
1267 .Ic get .
1268 .It Ic reget Ar remote-file Op Ar local-file
1269 .Ic reget
1270 acts like
1271 .Ic get ,
1272 except that if
1273 .Ar local-file
1274 exists and is
1275 smaller than
1276 .Ar remote-file ,
1277 .Ar local-file
1278 is presumed to be
1279 a partially transferred copy of
1280 .Ar remote-file
1281 and the transfer
1282 is continued from the apparent point of failure.
1283 This command
1284 is useful when transferring very large files over networks that
1285 are prone to dropping connections.
1286 .It Ic remopts Ar command Op Ar command-options
1287 Set options on the remote
1288 .Tn FTP
1289 server for
1290 .Ar command
1291 to
1292 .Ar command-options
1293 .Pq whose absence is handled on a command-specific basis .
1294 Remote
1295 .Tn FTP
1296 commands known to support options include:
1297 .Dv MLST
1298 .Po
1299 used for
1300 .Dv MLSD
1301 and
1302 .Dv MLST
1303 .Pc .
1304 .It Ic rename Op Ar from Op Ar to
1305 Rename the file
1306 .Ar from
1307 on the remote machine, to the file
1308 .Ar to .
1309 .It Ic reset
1310 Clear reply queue.
1311 This command re-synchronizes command/reply sequencing with the remote
1312 .Tn FTP
1313 server.
1314 Resynchronization may be necessary following a violation of the
1315 .Tn FTP
1316 protocol by the remote server.
1317 .It Ic restart Ar marker
1318 Restart the immediately following
1319 .Ic get
1320 or
1321 .Ic put
1322 at the
1323 indicated
1324 .Ar marker .
1325 On
1326 .Ux
1327 systems, marker is usually a byte
1328 offset into the file.
1329 .It Ic rhelp Op Ar command-name
1330 Request help from the remote
1331 .Tn FTP
1332 server.
1333 If a
1334 .Ar command-name
1335 is specified it is supplied to the server as well.
1336 .It Ic rmdir Ar directory-name
1337 Delete a directory on the remote machine.
1338 .It Ic rstatus Op Ar remote-file
1339 With no arguments, show status of remote machine.
1340 If
1341 .Ar remote-file
1342 is specified, show status of
1343 .Ar remote-file
1344 on remote machine.
1345 .It Ic runique
1346 Toggle storing of files on the local system with unique filenames.
1347 If a file already exists with a name equal to the target
1348 local filename for a
1349 .Ic get
1350 or
1351 .Ic mget
1352 command, a
1353 .Ql \&.1
1354 is appended to the name.
1355 If the resulting name matches another existing file,
1356 a
1357 .Ql \&.2
1358 is appended to the original name.
1359 If this process continues up to
1360 .Ql .99 ,
1361 an error
1362 message is printed, and the transfer does not take place.
1363 The generated unique filename will be reported.
1364 Note that
1365 .Ic runique
1366 will not affect local files generated from a shell command
1367 (see below).
1368 The default value is off.
1369 .It Ic send Ar local-file Op Ar remote-file
1370 A synonym for
1371 .Ic put .
1372 .It Ic sendport
1373 Toggle the use of
1374 .Dv PORT
1375 commands.
1376 By default,
1377 .Nm
1378 will attempt to use a
1379 .Dv PORT
1380 command when establishing
1381 a connection for each data transfer.
1382 The use of
1383 .Dv PORT
1384 commands can prevent delays
1385 when performing multiple file transfers.
1386 If the
1387 .Dv PORT
1388 command fails,
1389 .Nm
1390 will use the default data port.
1391 When the use of
1392 .Dv PORT
1393 commands is disabled, no attempt will be made to use
1394 .Dv PORT
1395 commands for each data transfer.
1396 This is useful
1397 for certain
1398 .Tn FTP
1399 implementations which do ignore
1400 .Dv PORT
1401 commands but, incorrectly, indicate they've been accepted.
1402 .It Ic set Op Ar option Ar value
1403 Set
1404 .Ar option
1405 to
1406 .Ar value .
1407 If
1408 .Ar option
1409 and
1410 .Ar value
1411 are not given, display all of the options and their values.
1412 The currently supported options are:
1413 .Bl -tag -width ".Cm sslnoverify" -offset indent
1414 .It Cm anonpass
1415 Defaults to
1416 .Ev $FTPANONPASS
1417 .It Cm ftp_proxy
1418 Defaults to
1419 .Ev $ftp_proxy .
1420 .It Cm http_proxy
1421 Defaults to
1422 .Ev $http_proxy .
1423 .It Cm https_proxy
1424 Defaults to
1425 .Ev $https_proxy .
1426 .It Cm no_proxy
1427 Defaults to
1428 .Ev $no_proxy .
1429 .It Cm pager
1430 Defaults to
1431 .Ev $PAGER .
1432 .It Cm prompt
1433 Defaults to
1434 .Ev $FTPPROMPT .
1435 .It Cm rprompt
1436 Defaults to
1437 .Ev $FTPRPROMPT .
1438 .It Cm sslnoverify
1439 Defaults to
1440 .Ev $FTPSSLNOVERIFY .
1441 .El
1442 .It Ic site Op Ar arg ...
1443 The arguments specified are sent, verbatim, to the remote
1444 .Tn FTP
1445 server as a
1446 .Dv SITE
1447 command.
1448 .It Ic size Ar remote-file
1449 Return size of
1450 .Ar remote-file
1451 on remote machine.
1452 .It Ic sndbuf Ar size
1453 Set the size of the socket send buffer to
1454 .Ar size .
1455 .It Ic status
1456 Show the current status of
1457 .Nm tnftp .
1458 .It Ic struct Ar struct-name
1459 Set the file transfer
1460 .Ar structure
1461 to
1462 .Ar struct-name .
1463 The default (and only supported)
1464 structure is
1465 .Ql file .
1466 .It Ic sunique
1467 Toggle storing of files on remote machine under unique file names.
1468 The remote
1469 .Tn FTP
1470 server must support
1471 .Tn FTP
1472 protocol
1473 .Dv STOU
1474 command for
1475 successful completion.
1476 The remote server will report unique name.
1477 Default value is off.
1478 .It Ic system
1479 Show the type of operating system running on the remote machine.
1480 .It Ic tenex
1481 Set the file transfer type to that needed to
1482 talk to
1483 .Tn TENEX
1484 machines.
1485 .It Ic throttle
1486 A synonym for
1487 .Ic rate .
1488 .It Ic trace
1489 Toggle packet tracing.
1490 .It Ic type Op Ar type-name
1491 Set the file transfer
1492 .Ic type
1493 to
1494 .Ar type-name .
1495 If no type is specified, the current type
1496 is printed.
1497 The default type is network
1498 .Tn ASCII .
1499 .It Ic umask Op Ar newmask
1500 Set the default umask on the remote server to
1501 .Ar newmask .
1502 If
1503 .Ar newmask
1504 is omitted, the current umask is printed.
1505 .It Ic unset Ar option
1506 Unset
1507 .Ar option .
1508 Refer to
1509 .Ic set
1510 for more information.
1511 .It Ic usage Ar command
1512 Print the usage message for
1513 .Ar command .
1514 .It Ic user Ar user-name Oo Ar password Oo Ar account Oc Oc
1515 Identify yourself to the remote
1516 .Tn FTP
1517 server.
1518 If the
1519 .Ar password
1520 is not specified and the server requires it,
1521 .Nm
1522 will prompt the user for it (after disabling local echo).
1523 If an
1524 .Ar account
1525 field is not specified, and the
1526 .Tn FTP
1527 server
1528 requires it, the user will be prompted for it.
1529 If an
1530 .Ar account
1531 field is specified, an account command will
1532 be relayed to the remote server after the login sequence
1533 is completed if the remote server did not require it
1534 for logging in.
1535 Unless
1536 .Nm
1537 is invoked with
1538 .Dq auto-login
1539 disabled, this process is done automatically on initial connection to the
1540 .Tn FTP
1541 server.
1542 .It Ic verbose
1543 Toggle verbose mode.
1544 In verbose mode, all responses from
1545 the
1546 .Tn FTP
1547 server are displayed to the user.
1548 In addition,
1549 if verbose is on, when a file transfer completes, statistics
1550 regarding the efficiency of the transfer are reported.
1551 By default,
1552 verbose is on.
1553 .It Ic xferbuf Ar size
1554 Set the size of the socket send and receive buffers to
1555 .Ar size .
1556 .It Ic \&? Op Ar command
1557 A synonym for
1558 .Ic help .
1559 .El
1560 .Pp
1561 Command arguments which have embedded spaces may be quoted with
1562 quote
1563 .Ql \&\(dq
1564 marks.
1565 .Pp
1566 Commands which toggle settings can take an explicit
1567 .Ic on
1568 or
1569 .Ic off
1570 argument to force the setting appropriately.
1571 .Pp
1572 Commands which take a byte count as an argument
1573 .Po
1574 e.g.,
1575 .Ic hash ,
1576 .Ic rate ,
1577 and
1578 .Ic xferbuf
1579 .Pc
1580 support an optional suffix on the argument which changes the
1581 interpretation of the argument.
1582 Supported suffixes are:
1583 .Bl -tag -width 3n -offset indent -compact
1584 .It Li b
1585 Causes no modification.
1586 (Optional)
1587 .It Li k
1588 Kilo; multiply the argument by 1024
1589 .It Li m
1590 Mega; multiply the argument by 1048576
1591 .It Li g
1592 Giga; multiply the argument by 1073741824
1593 .El
1594 .Pp
1595 If
1596 .Nm
1597 receives a
1598 .Dv SIGINFO
1599 .Po
1600 see the
1601 .Cm status
1602 argument of
1603 .Xr stty 1
1604 .Pc
1605 or
1606 .Dv SIGQUIT
1607 signal whilst a transfer is in progress, the current transfer rate
1608 statistics will be written to the standard error output, in the
1609 same format as the standard completion message.
1610 .Sh AUTO-FETCHING FILES
1611 In addition to standard commands, this version of
1612 .Nm
1613 supports an auto-fetch feature.
1614 To enable auto-fetch, simply pass the list of hostnames/files
1615 on the command line.
1616 .Pp
1617 The following formats are valid syntax for an auto-fetch element:
1618 .Bl -tag -width "FOO "
1619 .\" [user@]host:[path][/]
1620 .It Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Li \&: Ns Oo Ar path Oc \
1621 Ns Oo Li / Oc
1622 .Dq Classic
1623 .Tn FTP
1624 format.
1625 .Pp
1626 If
1627 .Ar path
1628 contains a glob character and globbing is enabled,
1629 (see
1630 .Ic glob ) ,
1631 then the equivalent of
1632 .Ic mget Ar path
1633 is performed.
1634 .Pp
1635 If the directory component of
1636 .Ar path
1637 contains no globbing characters,
1638 it is stored locally with the name basename (see
1639 .Xr basename 1 )
1640 of
1641 .Ic path ,
1642 in the current directory.
1643 Otherwise, the full remote name is used as the local name,
1644 relative to the local root directory.
1645 .\" ftp://[user[:password]@]host[:port]/path[/][;type=type]
1646 .It Li ftp:// Ns Oo Ar user Ns Oo Ns Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1647 Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path Ns Oo Li / Oc \
1648 Ns Oo Li ;type= Ns Ar type Oc
1649 An
1650 .Tn FTP
1651 URL, retrieved using the
1652 .Tn FTP
1653 protocol if
1654 .Ic "set ftp_proxy"
1655 isn't defined.
1656 Otherwise, transfer the URL using
1657 .Tn HTTP
1658 via the proxy defined in
1659 .Ic "set ftp_proxy" .
1660 If
1661 .Ic "set ftp_proxy"
1662 isn't defined and
1663 .Ar user
1664 is given, login as
1665 .Ar user .
1666 In this case, use
1667 .Ar password
1668 if supplied, otherwise prompt the user for one.
1669 .Pp
1670 If a suffix of
1671 .Ql \&;type=A
1672 or
1673 .Ql \&;type=I
1674 is supplied, then the transfer type will take place as
1675 ascii or binary (respectively).
1676 The default transfer type is binary.
1677 .Pp
1678 In order to be compliant with
1679 .Li RFC 3986 ,
1680 .Nm
1681 interprets the
1682 .Ar path
1683 part of an
1684 .Ql ftp://
1685 auto-fetch URL as follows:
1686 .Bl -bullet
1687 .It
1688 The
1689 .Ql /
1690 immediately after the
1691 .Ar host Ns Oo Li \&: Ns Ar port Oc
1692 is interpreted as a separator before the
1693 .Ar path ,
1694 and not as part of the
1695 .Ar path
1696 itself.
1697 .It
1698 The
1699 .Ar path
1700 is interpreted as a
1701 .So Li / Sc Ns -separated
1702 list of name components.
1703 For all but the last such component,
1704 .Nm
1705 performs the equivalent of a
1706 .Ic cd
1707 command.
1708 For the last path component,
1709 .Nm
1710 performs the equivalent of a
1711 .Ic get
1712 command.
1713 .It
1714 Empty name components,
1715 which result from
1716 .Ql //
1717 within the
1718 .Ar path ,
1719 or from an extra
1720 .Ql /
1721 at the beginning of the
1722 .Ar path ,
1723 will cause the equivalent of a
1724 .Ic cd
1725 command without a directory name.
1726 This is unlikely to be useful.
1727 .It
1728 Any
1729 .Sq Cm \&% Ns Ar XX\^
1730 codes
1731 (per
1732 .Li RFC 3986 )
1733 within the path components are decoded, with
1734 .Ar XX
1735 representing a character code in hexadecimal.
1736 This decoding takes place after the
1737 .Ar path
1738 has been split into components,
1739 but before each component is used in the equivalent of a
1740 .Ic cd
1741 or
1742 .Ic get
1743 command.
1744 Some often-used codes are
1745 .Ql \&%2F
1746 (which represents
1747 .Ql / )
1748 and
1749 .Ql \&%7E
1750 .Po
1751 which represents
1752 .Ql ~
1753 .Pc .
1754 .El
1755 .Pp
1756 The above interpretation has the following consequences:
1757 .Bl -bullet
1758 .It
1759 The path is interpreted relative to the
1760 default login directory of the specified user or of the
1761 .Sq anonymous
1762 user.
1763 If the
1764 .Pa /
1765 directory is required, use a leading path of
1766 .Ql \&%2F .
1767 If a user's home directory is required
1768 .Pq and the remote server supports the syntax ,
1769 use a leading path of
1770 .Ql \&%7E Ns Ar user Ns Li / .
1771 For example, to retrieve
1772 .Pa /etc/motd
1773 from
1774 .Ql localhost
1775 as the user
1776 .Ql myname
1777 with the password
1778 .Ql mypass ,
1779 use
1780 .Ql ftp://myname:mypass@localhost/%2fetc/motd
1781 .It
1782 The exact
1783 .Ic cd
1784 and
1785 .Ic get
1786 commands can be controlled by careful choice of
1787 where to use
1788 .Ql /
1789 and where to use
1790 .Ql \&%2F
1791 (or
1792 .Ql %2f ) .
1793 For example, the following URLs correspond to the
1794 equivalents of the indicated commands:
1795 .Bl -tag -width "ftp://host/%2Fdir1%2Fdir2%2Ffile"
1796 .It Xo \" ftp://host/dir1/dir2/file
1797 .Sm off
1798 .Ic ftp:// Ar host
1799 .Ic / Ar dir1
1800 .Ic / Ar dir2
1801 .Ic / Ar file
1802 .Sm on
1803 .Xc
1804 .Ic cd Ar dir1 ,
1805 .Ic cd Ar dir2 ,
1806 .Ic get Ar file .
1807 .It Xo \" ftp://host/%2Fdir1/dir2/file
1808 .Sm off
1809 .Ic ftp:// Ar host
1810 .Ic /%2F Ar dir1
1811 .Ic / Ar dir2
1812 .Ic / Ar file
1813 .Sm on
1814 .Xc
1815 .Ic cd / Ns Ar dir1 ,
1816 .Ic cd Ar dir2 ,
1817 .Ic get Ar file .
1818 .It Xo \" ftp://host/dir1%2Fdir2/file
1819 .Sm off
1820 .Ic ftp:// Ar host
1821 .Ic / Ar dir1
1822 .Ic %2F Ar dir2
1823 .Ic / Ar file
1824 .Sm on
1825 .Xc
1826 .Ic cd Ar dir1 Ns Ic / Ns Ar dir2 ,
1827 .Ic get Ar file .
1828 .El
1829 .It
1830 You must have appropriate access permission for each of the
1831 intermediate directories that is used in the equivalent of a
1832 .Ic cd
1833 command.
1834 .El
1835 .\" http://[user[:password]@]host[:port]/path
1836 .It Li http:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1837 Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
1838 An
1839 .Tn HTTP
1840 URL, retrieved using the
1841 .Tn HTTP
1842 protocol.
1843 If
1844 .Ic "set http_proxy"
1845 is defined, it is used as a URL to an
1846 .Tn HTTP
1847 proxy server.
1848 If
1849 .Tn HTTP
1850 authorization is required to retrieve
1851 .Ar path ,
1852 and
1853 .Ar user
1854 (and optionally
1855 .Ar password\^ )
1856 is in the URL, use them for the first attempt to authenticate.
1857 .\" https://[user[:password]@]host[:port]/path
1858 .It Li https:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1859 Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
1860 An
1861 .Tn HTTPS
1862 URL, retrieved using the
1863 .Tn HTTPS
1864 protocol.
1865 If
1866 .Ic "set https_proxy"
1867 is defined, it is used as a URL to an
1868 .Tn HTTPS
1869 proxy server.
1870 If
1871 .Tn HTTPS
1872 authorization is required to retrieve
1873 .Ar path ,
1874 and
1875 .Ar user
1876 (and optionally
1877 .Ar password\^ )
1878 is in the URL, use them for the first attempt to authenticate.
1879 There is currently no certificate validation and verification.
1880 .\" file:///path
1881 .It Li file:/// Ns Ar path
1882 A local URL, copied from
1883 .Pa / Ns Ar path
1884 on the local host.
1885 .\" about:
1886 .It Li about: Ns Ar topic
1887 Display information regarding
1888 .Ar topic ;
1889 no file is retrieved for this auto-fetched element.
1890 Supported values include:
1891 .Bl -tag -width "about:version"
1892 .It Li about:ftp
1893 Information about
1894 .Nm tnftp .
1895 .It Li about:version
1896 The version of
1897 .Nm tnftp .
1898 Useful to provide when reporting problems.
1899 .El
1900 .El
1901 .Pp
1902 Unless noted otherwise above, and
1903 .Fl o Ar output
1904 is not given, the file is stored in the current directory as the
1905 .Xr basename 1
1906 of
1907 .Ar path .
1908 Note that if a
1909 .Tn HTTP
1910 redirect is received, the fetch is retried using the new target URL
1911 supplied by the server, with a corresponding new
1912 .Ar path .
1913 Using an explicit
1914 .Fl o Ar output
1915 is recommended, to avoid writing to unexpected file names.
1916 .Pp
1917 If a classic format or an
1918 .Tn FTP
1919 URL format has a trailing
1920 .Ql /
1921 or an empty
1922 .Ar path
1923 component, then
1924 .Nm
1925 will connect to the site and
1926 .Ic cd
1927 to the directory given as the path, and leave the user in interactive
1928 mode ready for further input.
1929 This will not work if
1930 .Ic "set ftp_proxy"
1931 is being used.
1932 .Pp
1933 Direct
1934 .Tn HTTP
1935 transfers use HTTP 1.1.
1936 Proxied
1937 .Tn FTP
1938 and
1939 .Tn HTTP
1940 transfers use HTTP 1.0.
1941 .Pp
1942 If
1943 .Fl R
1944 is given, all auto-fetches that don't go via the
1945 .Tn FTP
1946 or
1947 .Tn HTTP
1948 proxies will be restarted.
1949 For
1950 .Tn FTP ,
1951 this is implemented by using
1952 .Ic reget
1953 instead of
1954 .Ic get .
1955 For
1956 .Tn HTTP ,
1957 this is implemented by using the
1958 .Sq "Range: bytes="
1959 .Tn "HTTP/1.1"
1960 directive.
1961 .Pp
1962 If WWW or proxy WWW authentication is required, you will be prompted
1963 to enter a username and password to authenticate with.
1964 .Pp
1965 When specifying IPv6 numeric addresses in a URL, you need to
1966 surround the address in square brackets.
1967 E.g.:
1968 .Ql ftp://[::1]:21/ .
1969 This is because colons are used in IPv6 numeric address as well as
1970 being the separator for the port number.
1971 .Sh ABORTING A FILE TRANSFER
1972 To abort a file transfer, use the terminal interrupt key
1973 (usually Ctrl-C).
1974 Sending transfers will be immediately halted.
1975 Receiving transfers will be halted by sending an
1976 .Tn FTP
1977 protocol
1978 .Dv ABOR
1979 command to the remote server, and discarding any further data received.
1980 The speed at which this is accomplished depends upon the remote
1981 server's support for
1982 .Dv ABOR
1983 processing.
1984 If the remote server does not support the
1985 .Dv ABOR
1986 command, the prompt will not appear until the remote server has completed
1987 sending the requested file.
1988 .Pp
1989 If the terminal interrupt key sequence is used whilst
1990 .Nm
1991 is awaiting a reply from the remote server for the
1992 .Dv ABOR
1993 processing,
1994 then the connection will be closed.
1995 This is different from the traditional behaviour (which ignores the
1996 terminal interrupt during this phase), but is considered more useful.
1997 .Sh FILE NAMING CONVENTIONS
1998 Files specified as arguments to
1999 .Nm
2000 commands are processed according to the following rules.
2001 .Bl -enum
2002 .It
2003 If the file name
2004 .Sq Fl
2005 is specified, the
2006 .Va stdin
2007 (for reading) or
2008 .Va stdout
2009 (for writing) is used.
2010 .It
2011 If the first character of the file name is
2012 .Ql \&| ,
2013 the
2014 remainder of the argument is interpreted as a shell command.
2015 .Nm
2016 then forks a shell, using
2017 .Xr popen 3
2018 with the argument supplied, and reads (writes) from the stdout
2019 (stdin).
2020 If the shell command includes spaces, the argument
2021 must be quoted; e.g.
2022 .Ql \*q|\~ls\~\-lt\*q .
2023 A particularly
2024 useful example of this mechanism is:
2025 .Ql dir\~\*q\*q\~|more .
2026 .It
2027 Failing the above checks, if globbing
2028 is enabled, local file names are expanded according to the rules
2029 used in the
2030 .Xr csh 1 ;
2031 see the
2032 .Ic glob
2033 command.
2034 If the
2035 .Nm
2036 command expects a single local file (e.g.
2037 .Ic put ) ,
2038 only the first filename generated by the globbing operation is used.
2039 .It
2040 For
2041 .Ic mget
2042 commands and
2043 .Ic get
2044 commands with unspecified local file names, the local filename is
2045 the remote filename, which may be altered by a
2046 .Ic case ,
2047 .Ic ntrans ,
2048 or
2049 .Ic nmap
2050 setting.
2051 The resulting filename may then be altered if
2052 .Ic runique
2053 is on.
2054 .It
2055 For
2056 .Ic mput
2057 commands and
2058 .Ic put
2059 commands with unspecified remote file names, the remote filename is
2060 the local filename, which may be altered by a
2061 .Ic ntrans
2062 or
2063 .Ic nmap
2064 setting.
2065 The resulting filename may then be altered by the remote server if
2066 .Ic sunique
2067 is on.
2068 .El
2069 .Sh FILE TRANSFER PARAMETERS
2070 The
2071 .Tn FTP
2072 specification specifies many parameters which may affect a file transfer.
2073 The
2074 .Ic type
2075 may be one of
2076 .Dq ascii ,
2077 .Dq image
2078 (binary),
2079 .Dq ebcdic ,
2080 and
2081 .Dq local byte size
2082 (for
2083 .Tn PDP Ns -10's
2084 and
2085 .Tn PDP Ns -20's
2086 mostly).
2087 .Nm
2088 supports the ascii and image types of file transfer,
2089 plus local byte size 8 for
2090 .Ic tenex
2091 mode transfers.
2092 .Pp
2093 .Nm
2094 supports only the default values for the remaining
2095 file transfer parameters:
2096 .Ic mode ,
2097 .Ic form ,
2098 and
2099 .Ic struct .
2100 .Sh THE .netrc FILE
2101 The
2102 .Pa .netrc
2103 file contains login and initialization information
2104 used by the auto-login process.
2105 It resides in the user's home directory,
2106 unless overridden with the
2107 .Fl N Ar netrc
2108 option, or specified in the
2109 .Ev NETRC
2110 environment variable.
2111 The following tokens are recognized; they may be separated by spaces,
2112 tabs, or new-lines:
2113 .Bl -tag -width password
2114 .It Ic machine Ar name
2115 Identify a remote machine
2116 .Ar name .
2117 The auto-login process searches the
2118 .Pa .netrc
2119 file for a
2120 .Ic machine
2121 token that matches the remote machine specified on the
2122 .Nm
2123 command line or as an
2124 .Ic open
2125 command argument.
2126 Once a match is made, the subsequent
2127 .Pa .netrc
2128 tokens are processed,
2129 stopping when the end of file is reached or another
2130 .Ic machine
2131 or a
2132 .Ic default
2133 token is encountered.
2134 .It Ic default
2135 This is the same as
2136 .Ic machine
2137 .Ar name
2138 except that
2139 .Ic default
2140 matches any name.
2141 There can be only one
2142 .Ic default
2143 token, and it must be after all
2144 .Ic machine
2145 tokens.
2146 This is normally used as:
2147 .Pp
2148 .Dl default login anonymous password user@site
2149 .Pp
2150 thereby giving the user an automatic anonymous
2151 .Tn FTP
2152 login to
2153 machines not specified in
2154 .Pa .netrc .
2155 This can be overridden
2156 by using the
2157 .Fl n
2158 flag to disable auto-login.
2159 .It Ic login Ar name
2160 Identify a user on the remote machine.
2161 If this token is present, the auto-login process will initiate
2162 a login using the specified
2163 .Ar name .
2164 .It Ic password Ar string
2165 Supply a password.
2166 If this token is present, the auto-login process will supply the
2167 specified string if the remote server requires a password as part
2168 of the login process.
2169 Note that if this token is present in the
2170 .Pa .netrc
2171 file for any user other
2172 than
2173 .Ar anonymous ,
2174 .Nm
2175 will abort the auto-login process if the
2176 .Pa .netrc
2177 is readable by
2178 anyone besides the user.
2179 .It Ic account Ar string
2180 Supply an additional account password.
2181 If this token is present, the auto-login process will supply the
2182 specified string if the remote server requires an additional
2183 account password, or the auto-login process will initiate an
2184 .Dv ACCT
2185 command if it does not.
2186 .It Ic macdef Ar name
2187 Define a macro.
2188 This token functions like the
2189 .Nm
2190 .Ic macdef
2191 command functions.
2192 A macro is defined with the specified name; its contents begin with the
2193 next
2194 .Pa .netrc
2195 line and continue until a blank line (consecutive new-line
2196 characters) is encountered.
2197 Like the other tokens in the
2198 .Pa .netrc
2199 file, a
2200 .Ic macdef
2201 is applicable only to the
2202 .Ic machine
2203 definition preceding it.
2204 A
2205 .Ic macdef
2206 entry cannot be used by multiple
2207 .Ic machine
2208 definitions; rather, it must be defined following each
2209 .Ic machine
2210 it is intended to be used with.
2211 If a macro named
2212 .Ic init
2213 is defined, it is automatically executed as the last step in the
2214 auto-login process.
2215 For example,
2216 .Bd -literal -offset indent
2217 default
2218 macdef init
2219 epsv4 off
2220 .Ed
2221 .Pp
2222 followed by a blank line.
2223 .El
2224 .Sh COMMAND LINE EDITING
2225 .Nm
2226 supports interactive command line editing, via the
2227 .Xr editline 3
2228 library.
2229 It is enabled with the
2230 .Ic edit
2231 command, and is enabled by default if input is from a tty.
2232 Previous lines can be recalled and edited with the arrow keys,
2233 and other GNU Emacs-style editing keys may be used as well.
2234 .Pp
2235 The
2236 .Xr editline 3
2237 library is configured with a
2238 .Pa .editrc
2239 file \(em refer to
2240 .Xr editrc 5
2241 for more information.
2242 .Pp
2243 An extra key binding is available to
2244 .Nm
2245 to provide context sensitive command and filename completion
2246 (including remote file completion).
2247 To use this, bind a key to the
2248 .Xr editline 3
2249 command
2250 .Ic ftp-complete .
2251 By default, this is bound to the TAB key.
2252 .Sh COMMAND LINE PROMPT
2253 By default,
2254 .Nm
2255 displays a command line prompt of
2256 .Sq Li ftp>\~
2257 to the user.
2258 This can be changed with the
2259 .Ic "set prompt"
2260 command.
2261 .Pp
2262 A prompt can be displayed on the right side of the screen (after the
2263 command input) with the
2264 .Ic "set rprompt"
2265 command.
2266 .Pp
2267 The following formatting sequences are replaced by the given
2268 information:
2269 .Bl -tag -width "%% " -offset indent
2270 .It Li \&%/
2271 The current remote working directory.
2272 .\" %c[[0]n], %.[[0]n]
2273 .It Li \&%c Ns Oo Oo Li 0 Oc Ns Ar n Oc , Li \&%. Ns Oo Oo Li 0 Oc Ns Ar n Oc
2274 The trailing component of the current remote working directory, or
2275 .Ar n
2276 trailing components if a digit
2277 .Ar n
2278 is given.
2279 If
2280 .Ar n
2281 begins with
2282 .Ql 0 ,
2283 the number of skipped components precede the trailing component(s) in
2284 the format
2285 .\" ``/<number>trailing''
2286 .Do
2287 .Sm off
2288 .Li / Li < Ar number Li >
2289 .Ar trailing
2290 .Sm on
2291 .Dc
2292 (for
2293 .Ql \&%c )
2294 or
2295 .\" ``...trailing''
2296 .Dq Li \&... Ns Ar trailing
2297 (for
2298 .Ql \&%. ) .
2299 .It Li \&%M
2300 The remote host name.
2301 .It Li \&%m
2302 The remote host name, up to the first dot
2303 .Ql \&. .
2304 .It Li \&%n
2305 The remote user name.
2306 .It Li \&%%
2307 A single percent character
2308 .Ql % .
2309 .El
2310 .Sh ENVIRONMENT
2311 .Nm
2312 uses the following environment variables.
2313 .Bl -tag -width "FTPSERVERPORT"
2314 .It Ev FTPANONPASS
2315 Password to send in an anonymous
2316 .Tn FTP
2317 transfer.
2318 Defaults to
2319 .Dq Li \&\`whoami\`@ .
2320 .It Ev FTPMODE
2321 Overrides the default operation mode.
2322 Support values are:
2323 .Bl -tag -width "passive"
2324 .It Cm active
2325 active mode
2326 .Tn FTP
2327 only
2328 .It Cm auto
2329 automatic determination of passive or active (this is the default)
2330 .It Cm gate
2331 gate-ftp mode
2332 .It Cm passive
2333 passive mode
2334 .Tn FTP
2335 only
2336 .El
2337 .It Ev FTPPROMPT
2338 Command-line prompt to use.
2339 Defaults to
2340 .Sq Li ftp>\~ .
2341 Refer to
2342 .Sx COMMAND LINE PROMPT
2343 for more information.
2344 .It Ev FTPRPROMPT
2345 Command-line right side prompt to use.
2346 Defaults to empty string.
2347 Refer to
2348 .Sx COMMAND LINE PROMPT
2349 for more information.
2350 .It Ev FTPSERVER
2351 Host to use as gate-ftp server when
2352 .Ic gate
2353 is enabled.
2354 .It Ev FTPSERVERPORT
2355 Port to use when connecting to gate-ftp server when
2356 .Ic gate
2357 is enabled.
2358 Default is port returned by a
2359 .Xr getservbyname 3
2360 lookup of
2361 .Dq Li ftpgate/tcp .
2362 .It Ev FTPUSERAGENT
2363 The value to send for the
2364 .Tn HTTP
2365 User-Agent
2366 header.
2367 .It Ev FTPSSLNOVERIFY
2368 Set to 1 to not verify SSL certificates.
2369 .It Ev HOME
2370 For default location of a
2371 .Pa .netrc
2372 file, if one exists.
2373 .It Ev NETRC
2374 An alternate location of the
2375 .Pa .netrc
2376 file.
2377 .It Ev PAGER
2378 Used by various commands to display files.
2379 Defaults to
2380 .Xr more 1
2381 if empty or not set.
2382 .It Ev SHELL
2383 For default shell.
2384 .It Ev ftp_proxy
2385 URL of
2386 .Tn FTP
2387 proxy to use when making
2388 .Tn FTP
2389 URL requests
2390 (if not defined, use the standard
2391 .Tn FTP
2392 protocol).
2393 .Pp
2394 See
2395 .Ev http_proxy
2396 for further notes about proxy use.
2397 .It Ev http_proxy
2398 URL of
2399 .Tn HTTP
2400 proxy to use when making
2401 .Tn HTTP
2402 URL requests.
2403 If proxy authentication is required and there is a username and
2404 password in this URL, they will automatically be used in the first
2405 attempt to authenticate to the proxy.
2406 .Pp
2407 If
2408 .Dq unsafe
2409 URL characters are required in the username or password
2410 (for example
2411 .Ql @
2412 or
2413 .Ql / ) ,
2414 encode them with
2415 .Li RFC 3986
2416 .Ql \&% Ns Ar XX\^
2417 encoding.
2418 .Pp
2419 Note that the use of a username and password in
2420 .Ev ftp_proxy
2421 and
2422 .Ev http_proxy
2423 may be incompatible with other programs that use it
2424 (such as
2425 .Xr lynx 1 ) .
2426 .Pp
2427 .Em NOTE :
2428 this is not used for interactive sessions, only for command-line
2429 fetches.
2430 .It Ev https_proxy
2431 URL of
2432 .Tn HTTPS
2433 proxy to use when making
2434 .Tn HTTPS
2435 URL requests.
2436 .Pp
2437 See
2438 .Ev http_proxy
2439 for further notes about proxy use.
2440 .It Ev no_proxy
2441 A space or comma separated list of hosts (or domains) for which
2442 proxying is not to be used.
2443 Each entry may have an optional trailing
2444 .Ql \&: Ns Ar port ,
2445 which restricts
2446 the matching to connections to that port.
2447 .El
2448 .Sh EXTENDED PASSIVE MODE AND FIREWALLS
2449 Some firewall configurations do not allow
2450 .Nm
2451 to use extended passive mode.
2452 If you find that even a simple
2453 .Ic ls
2454 appears to hang after printing a message such as this:
2455 .Pp
2456 .Dl 229 Entering Extended Passive Mode (|||58551|)
2457 .Pp
2458 then you will need to disable extended passive mode with
2459 .Ic epsv4 off .
2460 See the above section
2461 .Sx The .netrc File
2462 for an example of how to make this automatic.
2463 .Sh SEE ALSO
2464 .Xr getservbyname 3 ,
2465 .Xr editrc 5 ,
2466 .Xr services 5 ,
2467 .Xr ftpd 8
2468 .Sh STANDARDS
2469 .Nm
2470 attempts to be compliant with:
2471 .Bl -tag -offset indent -width 8n
2472 .It Li RFC 959
2473 .Em File Transfer Protocol
2474 .It Li RFC 1123
2475 .Em Requirements for Internet Hosts - Application and Support
2476 .It Li RFC 1635
2477 .Em How to Use Anonymous FTP
2478 .It Li RFC 2389
2479 .Em Feature negotiation mechanism for the File Transfer Protocol
2480 .It Li RFC 2428
2481 .Em FTP Extensions for IPv6 and NATs
2482 .It Li RFC 2616
2483 .Em Hypertext Transfer Protocol -- HTTP/1.1
2484 .It Li RFC 2822
2485 .Em Internet Message Format
2486 .It Li RFC 3659
2487 .Em Extensions to FTP
2488 .It Li RFC 3986
2489 .Em Uniform Resource Identifier (URI)
2490 .El
2491 .Sh HISTORY
2492 The
2493 .Nm
2494 command appeared in
2495 .Bx 4.2 .
2496 .Pp
2497 Various features such as command line editing, context sensitive
2498 command and file completion, dynamic progress bar, automatic
2499 fetching of files and URLs, modification time preservation,
2500 transfer rate throttling, configurable command line prompt,
2501 and other enhancements over the standard
2502 .Bx
2503 .Nm
2504 were implemented in
2505 .Nx 1.3
2506 and later releases
2507 by
2508 .An Luke Mewburn
2509 .Aq [email protected] .
2510 .Pp
2511 IPv6 support was added by the WIDE/KAME project
2512 (but may not be present in all non-NetBSD versions of this program, depending
2513 if the operating system supports IPv6 in a similar manner to KAME).
2514 .Sh BUGS
2515 Correct execution of many commands depends upon proper behavior
2516 by the remote server.
2517 .Pp
2518 An error in the treatment of carriage returns
2519 in the
2520 .Bx 4.2
2521 ascii-mode transfer code
2522 has been corrected.
2523 This correction may result in incorrect transfers of binary files
2524 to and from
2525 .Bx 4.2
2526 servers using the ascii type.
2527 Avoid this problem by using the binary image type.
2528 .Pp
2529 .Nm
2530 assumes that all IPv4 mapped addresses
2531 .Po
2532 IPv6 addresses with a form like
2533 .Li ::ffff:10.1.1.1
2534 .Pc
2535 indicate IPv4 destinations which can be handled by
2536 .Dv AF_INET
2537 sockets.
2538 However, in certain IPv6 network configurations, this assumption is not true.
2539 In such an environment, IPv4 mapped addresses must be passed to
2540 .Dv AF_INET6
2541 sockets directly.
2542 For example, if your site uses a SIIT translator for IPv6-to-IPv4 translation,
2543 .Nm
2544 is unable to support your configuration.