1 .\" $FreeBSD: src/usr.bin/ftp/ftp.1,v 1.15.2.7 2002/08/27 09:55:08 yar Exp $
2 .\" $NetBSD: ftp.1,v 1.21 1997/06/10 21:59:58 lukem Exp $
4 .\" Copyright (c) 1985, 1989, 1990, 1993
5 .\" The Regents of the University of California. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\" must display the following acknowledgement:
17 .\" This product includes software developed by the University of
18 .\" California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\" may be used to endorse or promote products derived from this software
21 .\" without specific prior written permission.
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
41 .Nm ftp , pftp , gate-ftp
50 .Op Ar host Op Ar port
52 ftp://[\fIuser\fR:\fIpassword\fR@]\fIhost\fR[:\fIport\fR]/\fIfile\fR[/]
54 http://\fIhost\fR[:\fIport\fR]/\fIfile\fR
56 \fIhost\fR:[/\fIpath\fR/]\fIfile\fR[/]
59 is the user interface to the
61 standard File Transfer Protocol.
62 The program allows a user to transfer files to and from a
64 The version supports IPv6 (Internet protocol version 6), as well as IPv4.
66 The latter three usage formats will fetch a file using either the
67 HTTP or FTP protocols into the current directory.
68 This is ideal for scripts.
70 .Sx AUTO-FETCHING FILES
71 below for more information.
73 Options may be specified at the command line, or to the
79 to use IPv4 addresses only.
83 to use IPv6 addresses only.
87 to bypass normal login procedure, and use an anonymous login instead.
91 Disables command line editing.
93 Disables file name globbing.
95 Turns off interactive prompting during
96 multiple file transfers.
102 upon initial connection.
103 If auto-login is enabled,
107 (see below) file in the user's home directory for an entry describing
108 an account on the remote machine.
111 will prompt for the remote machine login name (default is the user
112 identity on the local machine), and, if necessary, prompt for a password
113 and an account with which to login.
115 Enables passive mode operation for use behind connection filtering firewalls.
118 command has the same effect.
120 Sets the port number to
123 Sets the local IP address for all connections to
125 which can be an IP address or a host name.
127 Enables packet tracing.
129 Disable data port range restrictions.
132 This is the default if input is from a terminal.
135 to show all responses from the remote server, as well
136 as report on data transfer statistics.
138 Disable verbose mode, overriding the default of enabled when input
142 The client host with which
144 is to communicate may be specified on the command line.
147 will immediately attempt to establish a connection to an
149 server on that host; otherwise,
151 will enter its command interpreter and await instructions
155 is awaiting commands from the user the prompt
157 is provided to the user.
158 The following commands are recognized
162 .It Ic \&! Op Ar command Op Ar args
163 Invoke an interactive shell on the local machine.
164 If there are arguments, the first is taken to be a command to execute
165 directly, with the rest of the arguments as its arguments.
166 .It Ic \&$ Ar macro-name Op Ar args
169 that was defined with the
172 Arguments are passed to the macro unglobbed.
173 .It Ic account Op Ar passwd
174 Supply a supplemental password required by a remote system for access
175 to resources once a login has been successfully completed.
176 If no argument is included, the user will be prompted for an account
177 password in a non-echoing input mode.
178 .It Ic append Ar local-file Op Ar remote-file
179 Append a local file to a file on the remote machine.
182 is left unspecified, the local file name is used in naming the
183 remote file after being altered by any
188 File transfer uses the current settings for
195 Set the file transfer
199 This is the default type.
201 Arrange that a bell be sounded after each file transfer
202 command is completed.
204 Set the file transfer
206 to support binary image transfer.
210 session with the remote server
213 An end of file will also terminate the session and exit.
215 Toggle remote computer file name case mapping during
220 is on (default is off), remote computer file names with all letters in
221 upper case are written in the local directory with the letters mapped
223 .It Ic \&cd Ar remote-directory
224 Change the working directory on the remote machine
226 .Ar remote-directory .
228 Change the remote machine working directory to the parent of the
229 current remote machine working directory.
230 .It Ic chmod Ar mode file-name
231 Change the permission modes of the file
239 session with the remote server, and
240 return to the command interpreter.
241 Any defined macros are erased.
243 Toggle carriage return stripping during
244 ascii type file retrieval.
245 Records are denoted by a carriage return/linefeed sequence
246 during ascii type file transfer.
249 is on (the default), carriage returns are stripped from this
250 sequence to conform with the
252 single linefeed record
256 remote systems may contain single linefeeds;
257 when an ascii type transfer is made, these linefeeds may be
258 distinguished from a record delimiter only when
261 .It Ic delete Ar remote-file
264 on the remote machine.
265 .It Ic debug Op Ar debug-value
266 Toggle debugging mode.
269 is specified, it is used to set the debugging level.
270 When debugging is on,
272 prints each command sent to the remote machine, preceded
275 .It Ic dir Op Ar remote-directory Op Ar local-file
276 Print a listing of the contents of a
277 directory on the remote machine.
278 The listing includes any system-dependent information that the server
279 chooses to include; for example, most
282 output from the command
288 is left unspecified, the current working directory is used.
289 If interactive prompting is on,
291 will prompt the user to verify that the last argument is indeed the
292 target local file for receiving
295 If no local file is specified, or if
299 the output is sent to the terminal.
301 As this command provides extra information which is system-dependent,
304 command instead if you only want a plain list of files.
309 Toggle command line editing, and context sensitive command and file
311 This is automatically enabled if input is from a terminal, and
316 commands on IPv4 FTP sessions.
317 Turning this option off may remedy problems with some
318 firewalls, e.g., IPFilter.
322 .It Ic ftp Ar host Op Ar port
325 .It Ic form Ar format
326 Set the file transfer
330 The default format is \*(Lqfile\*(Rq.
331 .It Ic get Ar remote-file Op Ar local-file
334 and store it on the local machine.
336 file name is not specified, it is given the same
337 name it has on the remote machine, subject to
338 alteration by the current
344 The current settings for
350 are used while transferring the file.
351 .It Ic gate Op Ar host Op Ar port
352 Toggle gate-ftp mode.
353 This will not be permitted if the gate-ftp server hasn't been set
354 (either explicitly by the user, or from the
356 environment variable).
360 then gate-ftp mode will be enabled, and the gate-ftp server will be set to
364 is also given, that will be used as the port to connect to on the
367 Toggle filename expansion for
372 If globbing is turned off with
374 the file name arguments
375 are taken literally and not expanded.
384 each remote file name is expanded
385 separately on the remote machine and the lists are not merged.
386 Expansion of a directory name is likely to be
387 different from expansion of the name of an ordinary file:
388 the exact result depends on the foreign operating system and ftp server,
389 and can be previewed by doing
390 .Ql mls remote-files \-
395 are not meant to transfer
396 entire directory subtrees of files.
400 archive of the subtree (in binary mode).
401 .It Ic hash Op Ar size
402 Toggle hash-sign (``#'') printing for each data block
404 The size of a data block defaults to 1024 bytes.
405 This can be changed by specifying
408 .It Ic help Op Ar command
409 Print an informative message about the meaning of
411 If no argument is given,
413 prints a list of the known commands.
414 .It Ic idle Op Ar seconds
415 Set the inactivity timer on the remote server to
420 is omitted, the current inactivity timer is printed.
421 .It Ic lcd Op Ar directory
422 Change the working directory on the local machine.
426 is specified, the user's home directory is used.
431 Print the working directory on the local machine.
432 .It Ic \&ls Op Ar remote-directory Op Ar local-file
435 .It Ic macdef Ar macro-name
437 Subsequent lines are stored as the macro
439 a null line (consecutive newline characters
441 carriage returns from the terminal) terminates macro input mode.
442 There is a limit of 16 macros and 4096 total characters in all
444 Macros remain defined until a
447 The macro processor interprets `$' and `\e' as special characters.
448 A `$' followed by a number (or numbers) is replaced by the
449 corresponding argument on the macro invocation command line.
450 A `$' followed by an `i' signals that macro processor that the
451 executing macro is to be looped.
452 On the first pass `$i' is
453 replaced by the first argument on the macro invocation command line,
454 on the second pass it is replaced by the second argument, and so on.
455 A `\e' followed by any character is replaced by that character.
456 Use the `\e' to prevent special treatment of the `$'.
457 .It Ic mdelete Op Ar remote-files
460 on the remote machine.
461 .It Ic mdir Ar remote-files local-file
464 except multiple remote files may be specified.
465 If interactive prompting is on,
467 will prompt the user to verify that the last argument is indeed the
468 target local file for receiving
471 .It Ic mget Ar remote-files
474 on the remote machine
477 for each file name thus produced.
480 for details on the filename expansion.
481 Resulting file names will then be processed according to
487 Files are transferred into the local working directory,
488 which can be changed with
490 new local directories can be created with
491 .Ql "\&! mkdir directory" .
492 .It Ic mkdir Ar directory-name
493 Make a directory on the remote machine.
494 .It Ic mls Ar remote-files local-file
497 except multiple remote files may be specified,
501 If interactive prompting is on,
503 will prompt the user to verify that the last argument is indeed the
504 target local file for receiving
507 .It Ic mode Op Ar mode-name
508 Set the file transfer
512 The default mode is \*(Lqstream\*(Rq mode.
513 .It Ic modtime Ar file-name
514 Show the last modification time of the file on the remote machine.
518 .It Ic mput Ar local-files
519 Expand wild cards in the list of local files given as arguments
522 for each file in the resulting list.
525 for details of filename expansion.
526 Resulting file names will then be processed according to
531 .It Ic msend Ar local-files
534 .It Ic newer Ar file-name
535 Get the file only if the modification time of the remote file is more
536 recent that the file on the current system.
538 exist on the current system, the remote file is considered
540 Otherwise, this command is identical to
542 .It Ic nlist Op Ar remote-directory Op Ar local-file
543 Print a list of the files in a
544 directory on the remote machine.
547 is left unspecified, the current working directory is used.
548 If interactive prompting is on,
550 will prompt the user to verify that the last argument is indeed the
551 target local file for receiving
554 If no local file is specified, or if
558 the output is sent to the terminal.
560 Note that this command only returns the filenames in the remote
561 directory. If you wish to see more information about the files (often
562 size, modification time, and so on),
566 .It Ic nmap Op Ar inpattern outpattern
567 Set or unset the filename mapping mechanism.
568 If no arguments are specified, the filename mapping mechanism is unset.
569 If arguments are specified, remote filenames are mapped during
573 commands issued without a specified remote target filename.
574 If arguments are specified, local filenames are mapped during
578 commands issued without a specified local target filename.
579 This command is useful when connecting to a
582 with different file naming conventions or practices.
583 The mapping follows the pattern set by
588 is a template for incoming filenames (which may have already been
589 processed according to the
594 Variable templating is accomplished by including the
595 sequences `$1', `$2', ..., `$9' in
597 Use `\\' to prevent this special treatment of the `$' character.
598 All other characters are treated literally, and are used to determine the
604 $1.$2 and the remote file name "mydata.data", $1 would have the value
605 "mydata", and $2 would have the value "data".
608 determines the resulting mapped filename.
609 The sequences `$1', `$2', ...., `$9' are replaced by any value resulting
613 The sequence `$0' is replace by the original filename.
614 Additionally, the sequence
615 .Ql Op Ar seq1 , Ar seq2
620 is not a null string; otherwise it is replaced by
622 For example, the command
624 .Bd -literal -offset indent -compact
625 nmap $1.$2.$3 [$1,$2].[$2,file]
629 the output filename "myfile.data" for input filenames "myfile.data" and
630 "myfile.data.old", "myfile.file" for the input filename "myfile", and
631 "myfile.myfile" for the input filename ".myfile".
632 Spaces may be included in
634 as in the example: `nmap $1 sed "s/ *$//" > $1' .
635 Use the `\e' character to prevent special treatment
636 of the `$','[',']' and `,' characters.
637 .It Ic ntrans Op Ar inchars Op Ar outchars
638 Set or unset the filename character translation mechanism.
639 If no arguments are specified, the filename character
640 translation mechanism is unset.
641 If arguments are specified, characters in
642 remote filenames are translated during
646 commands issued without a specified remote target filename.
647 If arguments are specified, characters in
648 local filenames are translated during
652 commands issued without a specified local target filename.
653 This command is useful when connecting to a
656 with different file naming conventions or practices.
657 Characters in a filename matching a character in
659 are replaced with the corresponding character in
661 If the character's position in
663 is longer than the length of
665 the character is deleted from the file name.
666 .It Ic open Ar host Op Ar port
667 Establish a connection to the specified
671 An optional port number may be supplied,
674 will attempt to contact an
679 option is on (default),
681 will also attempt to automatically log the user in to
688 and display with the program defined in
693 Toggle passive mode. If passive mode is turned on
694 (default is off), the ftp client will
697 command for all data connections instead of the usual
701 command requests that the remote server open a port for the data connection
702 and return the address of that port. The remote server listens on that
703 port and the client connects to it. When using the more traditional
705 command, the client listens on a port and sends that address to the remote
706 server, who connects back to it. Passive mode is useful when using
708 through a gateway router or host that controls the directionality of
710 (Note that though ftp servers are required to support the
712 command by RFC 1123, some do not.
713 Please note that if you are connecting to IPv6 ftp server,
723 The meaning is the same.)
725 Toggle preservation of modification times on retrieved files.
727 Toggle display of transfer progress bar.
728 The progress bar will be disabled for a transfer that has
732 or a command that starts with
735 .Sx FILE NAMING CONVENTIONS
736 for more information.
738 Toggle interactive prompting.
739 Interactive prompting
740 occurs during multiple file transfers to allow the
741 user to selectively retrieve or store files.
742 If prompting is turned off (default is on), any
746 will transfer all files, and any
748 will delete all files.
750 When prompting is on, the following commands are available at a prompt:
751 .Bl -tag -width 2n -offset indent
753 Do not transfer the file.
757 to the current file, and automatically answer
759 to any remaining files for the current command.
763 to the current file, and turn off prompt mode
769 Any other reponse will answer
772 .It Ic proxy Ar ftp-command
773 Execute an ftp command on a secondary control connection.
774 This command allows simultaneous connection to two remote ftp
775 servers for transferring files between the two servers.
780 to establish the secondary control connection.
781 Enter the command "proxy ?" to see other ftp commands executable on the
782 secondary connection.
783 The following commands behave differently when prefaced by
786 will not define new macros during the auto-login process,
788 will not erase existing macro definitions,
792 transfer files from the host on the primary control connection
793 to the host on the secondary control connection, and
798 transfer files from the host on the secondary control connection
799 to the host on the primary control connection.
800 Third party file transfers depend upon support of the ftp protocol
802 command by the server on the secondary control connection.
803 .It Ic put Ar local-file Op Ar remote-file
804 Store a local file on the remote machine.
807 is left unspecified, the local file name is used
808 after processing according to any
813 in naming the remote file.
814 File transfer uses the
822 Print the name of the current working directory on the remote
827 .It Ic quote Ar arg1 arg2 ...
828 The arguments specified are sent, verbatim, to the remote
831 .It Ic recv Ar remote-file Op Ar local-file
834 .It Ic reget Ar remote-file Op Ar local-file
835 Reget acts like get, except that if
842 a partially transferred copy of
845 is continued from the apparent point of failure.
847 is useful when transferring very large files over networks that
848 are prone to dropping connections.
849 .It Ic remotehelp Op Ar command-name
850 Request help from the remote
855 is specified it is supplied to the server as well.
856 .It Ic rstatus Op Ar file-name
857 With no arguments, show status of remote machine.
860 is specified, show status of
863 .It Ic rename Op Ar from Op Ar to
866 on the remote machine, to the file
870 This command re-synchronizes command/reply sequencing with the remote
872 Resynchronization may be necessary following a violation of the ftp protocol
873 by the remote server.
874 .It Ic restart Ar marker
875 Restart the immediately following
884 systems, marker is usually a byte
885 offset into the file.
887 Toggle data port range restrictions.
888 When not operating in passive mode, the
890 client program requests that the remote server open a connection back
891 to the client host on a separate data port. In previous versions, that
892 remote port fell in the range 1024..4999. However, most firewall setups
893 filter that range of TCP ports because other services reside there.
894 The default behavior now is for the client to request that the server
895 connect back to the client using the port range 49152..65535. Firewall
896 administrators can chose to allow TCP connections in that range, if they
897 deem it to not be a security risk.
898 .It Ic rmdir Ar directory-name
899 Delete a directory on the remote machine.
901 Toggle storing of files on the local system with unique filenames.
902 If a file already exists with a name equal to the target
907 command, a ".1" is appended to the name.
908 If the resulting name matches another existing file,
909 a ".2" is appended to the original name.
910 If this process continues up to ".99", an error
911 message is printed, and the transfer does not take place.
912 The generated unique filename will be reported.
915 will not affect local files generated from a shell command
917 The default value is off.
918 .It Ic send Ar local-file Op Ar remote-file
927 will attempt to use a
929 command when establishing
930 a connection for each data transfer.
933 commands can prevent delays
934 when performing multiple file transfers.
939 will use the default data port.
942 commands is disabled, no attempt will be made to use
944 commands for each data transfer.
948 implementations which do ignore
950 commands but, incorrectly, indicate they've been accepted.
951 .It Ic site Ar arg1 arg2 ...
952 The arguments specified are sent, verbatim, to the remote
957 .It Ic size Ar file-name
962 Show the current status of
964 .It Ic struct Op Ar struct-name
965 Set the file transfer
969 By default \*(Lqstream\*(Rq structure is used.
971 Toggle storing of files on remote machine under unique file names.
972 Remote ftp server must support ftp protocol
975 successful completion.
976 The remote server will report unique name.
977 Default value is off.
979 Show the type of operating system running on the remote machine.
981 Set the file transfer type to that needed to
986 Toggle packet tracing.
987 .It Ic type Op Ar type-name
988 Set the file transfer
992 If no type is specified, the current type
994 The default type is network
996 .It Ic umask Op Ar newmask
997 Set the default umask on the remote server to
1001 is omitted, the current umask is printed.
1003 .Ic user Ar user-name
1004 .Op Ar password Op Ar account
1006 Identify yourself to the remote
1011 is not specified and the server requires it,
1013 will prompt the user for it (after disabling local echo).
1016 field is not specified, and the
1019 requires it, the user will be prompted for it.
1022 field is specified, an account command will
1023 be relayed to the remote server after the login sequence
1024 is completed if the remote server did not require it
1028 is invoked with \*(Lqauto-login\*(Rq disabled, this
1029 process is done automatically on initial connection to
1034 Toggle verbose mode.
1035 In verbose mode, all responses from
1038 server are displayed to the user.
1040 if verbose is on, when a file transfer completes, statistics
1041 regarding the efficiency of the transfer are reported.
1044 .It Ic \&? Op Ar command
1049 Command arguments which have embedded spaces may be quoted with
1052 Commands which toggle settings can take an explicit
1056 argument to force the setting appropriately.
1066 signal whilst a transfer is in progress, the current transfer rate
1067 statistics will be written to the standard error output, in the
1068 same format as the standard completion message.
1069 .Sh AUTO-FETCHING FILES
1070 In addition to standard commands, this version of
1072 supports an auto-fetch feature.
1073 To enable auto-fetch, simply pass the list of hostnames/files
1074 on the command line.
1076 The following formats are valid syntax for an auto-fetch element:
1077 .Bl -tag -width "host:/file"
1081 .It ftp://[user:password@]host[:port]/file
1082 An ftp URL, retrieved using the ftp protocol if
1085 Otherwise, transfer using http via the proxy defined in
1091 isn't defined, login as
1095 .It http://host[:port]/file
1096 An HTTP URL, retrieved using the http protocol.
1099 is defined, it is used as a URL to an HTTP proxy server.
1102 If a classic format or a ftp URL format has a trailing
1106 will connect to the site and
1108 to the directory given as the path, and leave the user in interactive
1109 mode ready for further input.
1111 If successive auto-fetch ftp elements refer to the same host, then
1112 the connection is maintained between transfers, reducing overhead on
1113 connection creation and deletion.
1117 contains a glob character and globbing is enabled,
1120 then the equivalent of
1124 If the directory component of
1126 contains no globbing characters,
1127 it is stored in the current directory as the
1131 Otherwise, the remote name is used as the local name.
1132 .Sh ABORTING A FILE TRANSFER
1133 To abort a file transfer, use the terminal interrupt key
1135 Sending transfers will be immediately halted.
1136 Receiving transfers will be halted by sending a ftp protocol
1138 command to the remote server, and discarding any further data received.
1139 The speed at which this is accomplished depends upon the remote
1140 server's support for
1143 If the remote server does not support the
1147 prompt will not appear until the remote server has completed
1148 sending the requested file.
1150 The terminal interrupt key sequence will be ignored when
1152 has completed any local processing and is awaiting a reply
1153 from the remote server.
1154 A long delay in this mode may result from the ABOR processing described
1155 above, or from unexpected behavior by the remote server, including
1156 violations of the ftp protocol.
1157 If the delay results from unexpected remote server behavior, the local
1159 program must be killed by hand.
1160 .Sh FILE NAMING CONVENTIONS
1161 Files specified as arguments to
1163 commands are processed according to the following rules.
1172 (for writing) is used.
1174 If the first character of the file name is
1177 remainder of the argument is interpreted as a shell command.
1179 then forks a shell, using
1181 with the argument supplied, and reads (writes) from the stdin
1183 If the shell command includes spaces, the argument
1184 must be quoted; e.g.\&
1185 \*(Lq" ls -lt"\*(Rq.
1187 useful example of this mechanism is: \*(Lqdir \&|more\*(Rq.
1189 Failing the above checks, if
1192 local file names are expanded
1193 according to the rules used in the
1200 command expects a single local file (e.g.\&
1202 only the first filename generated by the "globbing" operation is used.
1208 commands with unspecified local file names, the local filename is
1209 the remote filename, which may be altered by a
1215 The resulting filename may then be altered if
1223 commands with unspecified remote file names, the remote filename is
1224 the local filename, which may be altered by a
1229 The resulting filename may then be altered by the remote server if
1233 .Sh FILE TRANSFER PARAMETERS
1234 The FTP specification specifies many parameters which may
1235 affect a file transfer.
1238 may be one of \*(Lqascii\*(Rq, \*(Lqimage\*(Rq (binary),
1239 \*(Lqebcdic\*(Rq and \*(Lqlocal byte size\*(Rq (for
1245 supports the ascii and image types of file transfer,
1246 plus local byte size 8 for
1251 supports only the default values for the remaining
1252 file transfer parameters:
1260 file contains login and initialization information
1261 used by the auto-login process.
1262 It resides in the user's home directory.
1263 The following tokens are recognized; they may be separated by spaces,
1265 .Bl -tag -width password
1266 .It Ic machine Ar name
1267 Identify a remote machine
1269 The auto-login process searches the
1273 token that matches the remote machine specified on the
1275 command line or as an
1278 Once a match is made, the subsequent
1280 tokens are processed,
1281 stopping when the end of file is reached or another
1285 token is encountered.
1293 There can be only one
1295 token, and it must be after all
1298 This is normally used as:
1300 .Dl default login anonymous password user@site
1302 thereby giving the user
1304 anonymous ftp login to
1305 machines not specified in
1307 This can be overridden
1310 flag to disable auto-login.
1311 .It Ic login Ar name
1312 Identify a user on the remote machine.
1313 If this token is present, the auto-login process will initiate
1314 a login using the specified
1316 .It Ic password Ar string
1318 If this token is present, the auto-login process will supply the
1319 specified string if the remote server requires a password as part
1320 of the login process.
1321 Note that if this token is present in the
1323 file for any user other
1327 will abort the auto-login process if the
1330 anyone besides the user.
1331 .It Ic account Ar string
1332 Supply an additional account password.
1333 If this token is present, the auto-login process will supply the
1334 specified string if the remote server requires an additional
1335 account password, or the auto-login process will initiate an
1337 command if it does not.
1338 .It Ic macdef Ar name
1340 This token functions like the
1344 A macro is defined with the specified name; its contents begin with the
1347 line and continue until a null line (consecutive new-line
1348 characters) is encountered.
1351 is defined, it is automatically executed as the last step in the
1354 .Sh COMMAND LINE EDITING
1356 supports interactive command line editing, via the
1359 It is enabled with the
1361 command, and is enabled by default if input is from a tty.
1362 Previous lines can be recalled and edited with the arrow keys,
1363 and other GNU Emacs-style editing keys may be used as well.
1367 library is configured with a
1371 for more information.
1373 An extra key binding is available to
1375 to provide context sensitive command and filename completion
1376 (including remote file completion).
1377 To use this, bind a key to the
1381 By default, this is bound to the TAB key.
1384 utilizes the following environment variables.
1385 .Bl -tag -width "FTP_PASSIVE_MODE"
1386 .It Ev FTP_PASSIVE_MODE
1387 If this variable is set to something else than
1390 will use passive mode by default.
1392 Host to use as gate-ftp server when
1395 .It Ev FTPSERVERPORT
1396 Port to use when connecting to gate-ftp server when
1399 Default is port returned by a
1404 For default location of a
1406 file, if one exists.
1414 URL of FTP proxy to use when making FTP URL requests
1415 (if not defined, use the standard ftp protocol).
1417 URL of HTTP proxy to use when making HTTP URL requests.
1420 .Xr getservbyname 3 ,
1429 commands are links to
1437 Various features such as command line editing, context sensitive
1438 command and file completion, dynamic progress bar, automatic
1439 fetching of files, ftp and http URLs, and modification time
1440 preservation were implemented in
1442 by Luke Mewburn, with assistance from Jason Thorpe.
1444 IPv6 support was added by WIDE/KAME Project.
1446 Correct execution of many commands depends upon proper behavior
1447 by the remote server.
1449 An error in the treatment of carriage returns
1452 ascii-mode transfer code
1454 This correction may result in incorrect transfers of binary files
1457 servers using the ascii type.
1458 Avoid this problem by using the binary image type.
1460 Proxying functionalities, such as
1462 may not work for IPv6 connection.