1 .\" $FreeBSD: src/usr.bin/ftp/ftp.1,v 1.15.2.7 2002/08/27 09:55:08 yar Exp $
2 .\" $DragonFly: src/usr.bin/ftp/Attic/ftp.1,v 1.4 2005/08/05 22:35:11 swildner Exp $
3 .\" $NetBSD: ftp.1,v 1.21 1997/06/10 21:59:58 lukem Exp $
5 .\" Copyright (c) 1985, 1989, 1990, 1993
6 .\" The Regents of the University of California. All rights reserved.
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in the
15 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\" must display the following acknowledgement:
18 .\" This product includes software developed by the University of
19 .\" California, Berkeley and its contributors.
20 .\" 4. Neither the name of the University nor the names of its contributors
21 .\" may be used to endorse or promote products derived from this software
22 .\" without specific prior written permission.
24 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
53 .Op Ar host Op Ar port
55 ftp://[\fIuser\fR:\fIpassword\fR@]\fIhost\fR[:\fIport\fR]/\fIfile\fR[/]
57 http://\fIhost\fR[:\fIport\fR]/\fIfile\fR
59 \fIhost\fR:[/\fIpath\fR/]\fIfile\fR[/]
62 is the user interface to the
64 standard File Transfer Protocol.
65 The program allows a user to transfer files to and from a
67 The version supports IPv6 (Internet protocol version 6), as well as IPv4.
69 The latter three usage formats will fetch a file using either the
70 HTTP or FTP protocols into the current directory.
71 This is ideal for scripts.
73 .Sx AUTO-FETCHING FILES
74 below for more information.
76 Options may be specified at the command line, or to the
82 to use IPv4 addresses only.
86 to use IPv6 addresses only.
90 to bypass normal login procedure, and use an anonymous login instead.
94 Disables command line editing.
96 Disables file name globbing.
98 Turns off interactive prompting during
99 multiple file transfers.
105 upon initial connection.
106 If auto-login is enabled,
110 (see below) file in the user's home directory for an entry describing
111 an account on the remote machine.
114 will prompt for the remote machine login name (default is the user
115 identity on the local machine), and, if necessary, prompt for a password
116 and an account with which to login.
118 Enables passive mode operation for use behind connection filtering firewalls.
121 command has the same effect.
123 Sets the port number to
126 Sets the local IP address for all connections to
128 which can be an IP address or a host name.
130 Enables packet tracing.
132 Disable data port range restrictions.
135 This is the default if input is from a terminal.
138 to show all responses from the remote server, as well
139 as report on data transfer statistics.
141 Disable verbose mode, overriding the default of enabled when input
145 The client host with which
147 is to communicate may be specified on the command line.
150 will immediately attempt to establish a connection to an
152 server on that host; otherwise,
154 will enter its command interpreter and await instructions
158 is awaiting commands from the user the prompt
160 is provided to the user.
161 The following commands are recognized
165 .It Ic \&! Op Ar command Op Ar args
166 Invoke an interactive shell on the local machine.
167 If there are arguments, the first is taken to be a command to execute
168 directly, with the rest of the arguments as its arguments.
169 .It Ic \&$ Ar macro-name Op Ar args
172 that was defined with the
175 Arguments are passed to the macro unglobbed.
176 .It Ic account Op Ar passwd
177 Supply a supplemental password required by a remote system for access
178 to resources once a login has been successfully completed.
179 If no argument is included, the user will be prompted for an account
180 password in a non-echoing input mode.
181 .It Ic append Ar local-file Op Ar remote-file
182 Append a local file to a file on the remote machine.
185 is left unspecified, the local file name is used in naming the
186 remote file after being altered by any
191 File transfer uses the current settings for
198 Set the file transfer
202 This is the default type.
204 Arrange that a bell be sounded after each file transfer
205 command is completed.
207 Set the file transfer
209 to support binary image transfer.
213 session with the remote server
216 An end of file will also terminate the session and exit.
218 Toggle remote computer file name case mapping during
223 is on (default is off), remote computer file names with all letters in
224 upper case are written in the local directory with the letters mapped
226 .It Ic \&cd Ar remote-directory
227 Change the working directory on the remote machine
229 .Ar remote-directory .
231 Change the remote machine working directory to the parent of the
232 current remote machine working directory.
233 .It Ic chmod Ar mode file-name
234 Change the permission modes of the file
242 session with the remote server, and
243 return to the command interpreter.
244 Any defined macros are erased.
246 Toggle carriage return stripping during
247 ascii type file retrieval.
248 Records are denoted by a carriage return/linefeed sequence
249 during ascii type file transfer.
252 is on (the default), carriage returns are stripped from this
253 sequence to conform with the
255 single linefeed record
259 remote systems may contain single linefeeds;
260 when an ascii type transfer is made, these linefeeds may be
261 distinguished from a record delimiter only when
264 .It Ic delete Ar remote-file
267 on the remote machine.
268 .It Ic debug Op Ar debug-value
269 Toggle debugging mode.
272 is specified, it is used to set the debugging level.
273 When debugging is on,
275 prints each command sent to the remote machine, preceded
278 .It Ic dir Op Ar remote-directory Op Ar local-file
279 Print a listing of the contents of a
280 directory on the remote machine.
281 The listing includes any system-dependent information that the server
282 chooses to include; for example, most
285 output from the command
291 is left unspecified, the current working directory is used.
292 If interactive prompting is on,
294 will prompt the user to verify that the last argument is indeed the
295 target local file for receiving
298 If no local file is specified, or if
302 the output is sent to the terminal.
304 As this command provides extra information which is system-dependent,
307 command instead if you only want a plain list of files.
312 Toggle command line editing, and context sensitive command and file
314 This is automatically enabled if input is from a terminal, and
319 commands on IPv4 FTP sessions.
320 Turning this option off may remedy problems with some
321 firewalls, e.g., IPFilter.
325 .It Ic ftp Ar host Op Ar port
328 .It Ic form Ar format
329 Set the file transfer
333 The default format is \*(Lqfile\*(Rq.
334 .It Ic get Ar remote-file Op Ar local-file
337 and store it on the local machine.
339 file name is not specified, it is given the same
340 name it has on the remote machine, subject to
341 alteration by the current
347 The current settings for
353 are used while transferring the file.
354 .It Ic gate Op Ar host Op Ar port
355 Toggle gate-ftp mode.
356 This will not be permitted if the gate-ftp server hasn't been set
357 (either explicitly by the user, or from the
359 environment variable).
363 then gate-ftp mode will be enabled, and the gate-ftp server will be set to
367 is also given, that will be used as the port to connect to on the
370 Toggle filename expansion for
375 If globbing is turned off with
377 the file name arguments
378 are taken literally and not expanded.
387 each remote file name is expanded
388 separately on the remote machine and the lists are not merged.
389 Expansion of a directory name is likely to be
390 different from expansion of the name of an ordinary file:
391 the exact result depends on the foreign operating system and ftp server,
392 and can be previewed by doing
393 .Ql mls remote-files \-
398 are not meant to transfer
399 entire directory subtrees of files.
403 archive of the subtree (in binary mode).
404 .It Ic hash Op Ar size
405 Toggle hash-sign (``#'') printing for each data block
407 The size of a data block defaults to 1024 bytes.
408 This can be changed by specifying
411 .It Ic help Op Ar command
412 Print an informative message about the meaning of
414 If no argument is given,
416 prints a list of the known commands.
417 .It Ic idle Op Ar seconds
418 Set the inactivity timer on the remote server to
423 is omitted, the current inactivity timer is printed.
424 .It Ic lcd Op Ar directory
425 Change the working directory on the local machine.
429 is specified, the user's home directory is used.
434 Print the working directory on the local machine.
435 .It Ic \&ls Op Ar remote-directory Op Ar local-file
438 .It Ic macdef Ar macro-name
440 Subsequent lines are stored as the macro
442 a null line (consecutive newline characters
444 carriage returns from the terminal) terminates macro input mode.
445 There is a limit of 16 macros and 4096 total characters in all
447 Macros remain defined until a
450 The macro processor interprets `$' and `\e' as special characters.
451 A `$' followed by a number (or numbers) is replaced by the
452 corresponding argument on the macro invocation command line.
453 A `$' followed by an `i' signals that macro processor that the
454 executing macro is to be looped.
455 On the first pass `$i' is
456 replaced by the first argument on the macro invocation command line,
457 on the second pass it is replaced by the second argument, and so on.
458 A `\e' followed by any character is replaced by that character.
459 Use the `\e' to prevent special treatment of the `$'.
460 .It Ic mdelete Op Ar remote-files
463 on the remote machine.
464 .It Ic mdir Ar remote-files local-file
467 except multiple remote files may be specified.
468 If interactive prompting is on,
470 will prompt the user to verify that the last argument is indeed the
471 target local file for receiving
474 .It Ic mget Ar remote-files
477 on the remote machine
480 for each file name thus produced.
483 for details on the filename expansion.
484 Resulting file names will then be processed according to
490 Files are transferred into the local working directory,
491 which can be changed with
493 new local directories can be created with
494 .Ql "\&! mkdir directory" .
495 .It Ic mkdir Ar directory-name
496 Make a directory on the remote machine.
497 .It Ic mls Ar remote-files local-file
500 except multiple remote files may be specified,
504 If interactive prompting is on,
506 will prompt the user to verify that the last argument is indeed the
507 target local file for receiving
510 .It Ic mode Op Ar mode-name
511 Set the file transfer
515 The default mode is \*(Lqstream\*(Rq mode.
516 .It Ic modtime Ar file-name
517 Show the last modification time of the file on the remote machine.
521 .It Ic mput Ar local-files
522 Expand wild cards in the list of local files given as arguments
525 for each file in the resulting list.
528 for details of filename expansion.
529 Resulting file names will then be processed according to
534 .It Ic msend Ar local-files
537 .It Ic newer Ar file-name
538 Get the file only if the modification time of the remote file is more
539 recent that the file on the current system.
541 exist on the current system, the remote file is considered
543 Otherwise, this command is identical to
545 .It Ic nlist Op Ar remote-directory Op Ar local-file
546 Print a list of the files in a
547 directory on the remote machine.
550 is left unspecified, the current working directory is used.
551 If interactive prompting is on,
553 will prompt the user to verify that the last argument is indeed the
554 target local file for receiving
557 If no local file is specified, or if
561 the output is sent to the terminal.
563 Note that this command only returns the filenames in the remote
564 directory. If you wish to see more information about the files (often
565 size, modification time, and so on),
569 .It Ic nmap Op Ar inpattern outpattern
570 Set or unset the filename mapping mechanism.
571 If no arguments are specified, the filename mapping mechanism is unset.
572 If arguments are specified, remote filenames are mapped during
576 commands issued without a specified remote target filename.
577 If arguments are specified, local filenames are mapped during
581 commands issued without a specified local target filename.
582 This command is useful when connecting to a
585 with different file naming conventions or practices.
586 The mapping follows the pattern set by
591 is a template for incoming filenames (which may have already been
592 processed according to the
597 Variable templating is accomplished by including the
598 sequences `$1', `$2', ..., `$9' in
600 Use `\\' to prevent this special treatment of the `$' character.
601 All other characters are treated literally, and are used to determine the
607 $1.$2 and the remote file name "mydata.data", $1 would have the value
608 "mydata", and $2 would have the value "data".
611 determines the resulting mapped filename.
612 The sequences `$1', `$2', ...., `$9' are replaced by any value resulting
616 The sequence `$0' is replace by the original filename.
617 Additionally, the sequence
618 .Sq Op Ar seq1 , Ar seq2
623 is not a null string; otherwise it is replaced by
625 For example, the command
627 .Bd -literal -offset indent -compact
628 nmap $1.$2.$3 [$1,$2].[$2,file]
632 the output filename "myfile.data" for input filenames "myfile.data" and
633 "myfile.data.old", "myfile.file" for the input filename "myfile", and
634 "myfile.myfile" for the input filename ".myfile".
635 Spaces may be included in
637 as in the example: `nmap $1 sed "s/ *$//" > $1' .
638 Use the `\e' character to prevent special treatment
639 of the `$','[',']' and `,' characters.
640 .It Ic ntrans Op Ar inchars Op Ar outchars
641 Set or unset the filename character translation mechanism.
642 If no arguments are specified, the filename character
643 translation mechanism is unset.
644 If arguments are specified, characters in
645 remote filenames are translated during
649 commands issued without a specified remote target filename.
650 If arguments are specified, characters in
651 local filenames are translated during
655 commands issued without a specified local target filename.
656 This command is useful when connecting to a
659 with different file naming conventions or practices.
660 Characters in a filename matching a character in
662 are replaced with the corresponding character in
664 If the character's position in
666 is longer than the length of
668 the character is deleted from the file name.
669 .It Ic open Ar host Op Ar port
670 Establish a connection to the specified
674 An optional port number may be supplied,
677 will attempt to contact an
682 option is on (default),
684 will also attempt to automatically log the user in to
691 and display with the program defined in
696 Toggle passive mode. If passive mode is turned on
697 (default is off), the ftp client will
700 command for all data connections instead of the usual
704 command requests that the remote server open a port for the data connection
705 and return the address of that port. The remote server listens on that
706 port and the client connects to it. When using the more traditional
708 command, the client listens on a port and sends that address to the remote
709 server, who connects back to it. Passive mode is useful when using
711 through a gateway router or host that controls the directionality of
713 (Note that though ftp servers are required to support the
715 command by RFC 1123, some do not.
716 Please note that if you are connecting to IPv6 ftp server,
726 The meaning is the same.)
728 Toggle preservation of modification times on retrieved files.
730 Toggle display of transfer progress bar.
731 The progress bar will be disabled for a transfer that has
735 or a command that starts with
738 .Sx FILE NAMING CONVENTIONS
739 for more information.
741 Toggle interactive prompting.
742 Interactive prompting
743 occurs during multiple file transfers to allow the
744 user to selectively retrieve or store files.
745 If prompting is turned off (default is on), any
749 will transfer all files, and any
751 will delete all files.
753 When prompting is on, the following commands are available at a prompt:
754 .Bl -tag -width 2n -offset indent
756 Do not transfer the file.
760 to the current file, and automatically answer
762 to any remaining files for the current command.
766 to the current file, and turn off prompt mode
772 Any other reponse will answer
775 .It Ic proxy Ar ftp-command
776 Execute an ftp command on a secondary control connection.
777 This command allows simultaneous connection to two remote ftp
778 servers for transferring files between the two servers.
783 to establish the secondary control connection.
784 Enter the command "proxy ?" to see other ftp commands executable on the
785 secondary connection.
786 The following commands behave differently when prefaced by
789 will not define new macros during the auto-login process,
791 will not erase existing macro definitions,
795 transfer files from the host on the primary control connection
796 to the host on the secondary control connection, and
801 transfer files from the host on the secondary control connection
802 to the host on the primary control connection.
803 Third party file transfers depend upon support of the ftp protocol
805 command by the server on the secondary control connection.
806 .It Ic put Ar local-file Op Ar remote-file
807 Store a local file on the remote machine.
810 is left unspecified, the local file name is used
811 after processing according to any
816 in naming the remote file.
817 File transfer uses the
825 Print the name of the current working directory on the remote
830 .It Ic quote Ar arg1 arg2 ...
831 The arguments specified are sent, verbatim, to the remote
834 .It Ic recv Ar remote-file Op Ar local-file
837 .It Ic reget Ar remote-file Op Ar local-file
838 Reget acts like get, except that if
845 a partially transferred copy of
848 is continued from the apparent point of failure.
850 is useful when transferring very large files over networks that
851 are prone to dropping connections.
852 .It Ic remotehelp Op Ar command-name
853 Request help from the remote
858 is specified it is supplied to the server as well.
859 .It Ic rstatus Op Ar file-name
860 With no arguments, show status of remote machine.
863 is specified, show status of
866 .It Ic rename Op Ar from Op Ar to
869 on the remote machine, to the file
873 This command re-synchronizes command/reply sequencing with the remote
875 Resynchronization may be necessary following a violation of the ftp protocol
876 by the remote server.
877 .It Ic restart Ar marker
878 Restart the immediately following
887 systems, marker is usually a byte
888 offset into the file.
890 Toggle data port range restrictions.
891 When not operating in passive mode, the
893 client program requests that the remote server open a connection back
894 to the client host on a separate data port. In previous versions, that
895 remote port fell in the range 1024..4999. However, most firewall setups
896 filter that range of TCP ports because other services reside there.
897 The default behavior now is for the client to request that the server
898 connect back to the client using the port range 49152..65535. Firewall
899 administrators can chose to allow TCP connections in that range, if they
900 deem it to not be a security risk.
901 .It Ic rmdir Ar directory-name
902 Delete a directory on the remote machine.
904 Toggle storing of files on the local system with unique filenames.
905 If a file already exists with a name equal to the target
910 command, a ".1" is appended to the name.
911 If the resulting name matches another existing file,
912 a ".2" is appended to the original name.
913 If this process continues up to ".99", an error
914 message is printed, and the transfer does not take place.
915 The generated unique filename will be reported.
918 will not affect local files generated from a shell command
920 The default value is off.
921 .It Ic send Ar local-file Op Ar remote-file
930 will attempt to use a
932 command when establishing
933 a connection for each data transfer.
936 commands can prevent delays
937 when performing multiple file transfers.
942 will use the default data port.
945 commands is disabled, no attempt will be made to use
947 commands for each data transfer.
951 implementations which do ignore
953 commands but, incorrectly, indicate they've been accepted.
954 .It Ic site Ar arg1 arg2 ...
955 The arguments specified are sent, verbatim, to the remote
960 .It Ic size Ar file-name
965 Show the current status of
967 .It Ic struct Op Ar struct-name
968 Set the file transfer
972 By default \*(Lqstream\*(Rq structure is used.
974 Toggle storing of files on remote machine under unique file names.
975 Remote ftp server must support ftp protocol
978 successful completion.
979 The remote server will report unique name.
980 Default value is off.
982 Show the type of operating system running on the remote machine.
984 Set the file transfer type to that needed to
989 Toggle packet tracing.
990 .It Ic type Op Ar type-name
991 Set the file transfer
995 If no type is specified, the current type
997 The default type is network
999 .It Ic umask Op Ar newmask
1000 Set the default umask on the remote server to
1004 is omitted, the current umask is printed.
1006 .Ic user Ar user-name
1007 .Op Ar password Op Ar account
1009 Identify yourself to the remote
1014 is not specified and the server requires it,
1016 will prompt the user for it (after disabling local echo).
1019 field is not specified, and the
1022 requires it, the user will be prompted for it.
1025 field is specified, an account command will
1026 be relayed to the remote server after the login sequence
1027 is completed if the remote server did not require it
1031 is invoked with \*(Lqauto-login\*(Rq disabled, this
1032 process is done automatically on initial connection to
1037 Toggle verbose mode.
1038 In verbose mode, all responses from
1041 server are displayed to the user.
1043 if verbose is on, when a file transfer completes, statistics
1044 regarding the efficiency of the transfer are reported.
1047 .It Ic \&? Op Ar command
1052 Command arguments which have embedded spaces may be quoted with
1055 Commands which toggle settings can take an explicit
1059 argument to force the setting appropriately.
1069 signal whilst a transfer is in progress, the current transfer rate
1070 statistics will be written to the standard error output, in the
1071 same format as the standard completion message.
1072 .Sh AUTO-FETCHING FILES
1073 In addition to standard commands, this version of
1075 supports an auto-fetch feature.
1076 To enable auto-fetch, simply pass the list of hostnames/files
1077 on the command line.
1079 The following formats are valid syntax for an auto-fetch element:
1080 .Bl -tag -width "host:/file"
1084 .It ftp://[user:password@]host[:port]/file
1085 An ftp URL, retrieved using the ftp protocol if
1088 Otherwise, transfer using http via the proxy defined in
1094 isn't defined, login as
1098 .It http://host[:port]/file
1099 An HTTP URL, retrieved using the http protocol.
1102 is defined, it is used as a URL to an HTTP proxy server.
1105 If a classic format or a ftp URL format has a trailing
1109 will connect to the site and
1111 to the directory given as the path, and leave the user in interactive
1112 mode ready for further input.
1114 If successive auto-fetch ftp elements refer to the same host, then
1115 the connection is maintained between transfers, reducing overhead on
1116 connection creation and deletion.
1120 contains a glob character and globbing is enabled,
1123 then the equivalent of
1127 If the directory component of
1129 contains no globbing characters,
1130 it is stored in the current directory as the
1134 Otherwise, the remote name is used as the local name.
1135 .Sh ABORTING A FILE TRANSFER
1136 To abort a file transfer, use the terminal interrupt key
1138 Sending transfers will be immediately halted.
1139 Receiving transfers will be halted by sending a ftp protocol
1141 command to the remote server, and discarding any further data received.
1142 The speed at which this is accomplished depends upon the remote
1143 server's support for
1146 If the remote server does not support the
1150 prompt will not appear until the remote server has completed
1151 sending the requested file.
1153 The terminal interrupt key sequence will be ignored when
1155 has completed any local processing and is awaiting a reply
1156 from the remote server.
1157 A long delay in this mode may result from the ABOR processing described
1158 above, or from unexpected behavior by the remote server, including
1159 violations of the ftp protocol.
1160 If the delay results from unexpected remote server behavior, the local
1162 program must be killed by hand.
1163 .Sh FILE NAMING CONVENTIONS
1164 Files specified as arguments to
1166 commands are processed according to the following rules.
1175 (for writing) is used.
1177 If the first character of the file name is
1180 remainder of the argument is interpreted as a shell command.
1182 then forks a shell, using
1184 with the argument supplied, and reads (writes) from the stdin
1186 If the shell command includes spaces, the argument
1187 must be quoted; e.g.\&
1188 \*(Lq" ls -lt"\*(Rq.
1190 useful example of this mechanism is: \*(Lqdir \&|more\*(Rq.
1192 Failing the above checks, if
1195 local file names are expanded
1196 according to the rules used in the
1203 command expects a single local file (e.g.\&
1205 only the first filename generated by the "globbing" operation is used.
1211 commands with unspecified local file names, the local filename is
1212 the remote filename, which may be altered by a
1218 The resulting filename may then be altered if
1226 commands with unspecified remote file names, the remote filename is
1227 the local filename, which may be altered by a
1232 The resulting filename may then be altered by the remote server if
1236 .Sh FILE TRANSFER PARAMETERS
1237 The FTP specification specifies many parameters which may
1238 affect a file transfer.
1241 may be one of \*(Lqascii\*(Rq, \*(Lqimage\*(Rq (binary),
1242 \*(Lqebcdic\*(Rq and \*(Lqlocal byte size\*(Rq (for
1248 supports the ascii and image types of file transfer,
1249 plus local byte size 8 for
1254 supports only the default values for the remaining
1255 file transfer parameters:
1263 file contains login and initialization information
1264 used by the auto-login process.
1265 It resides in the user's home directory.
1266 The following tokens are recognized; they may be separated by spaces,
1268 .Bl -tag -width password
1269 .It Ic machine Ar name
1270 Identify a remote machine
1272 The auto-login process searches the
1276 token that matches the remote machine specified on the
1278 command line or as an
1281 Once a match is made, the subsequent
1283 tokens are processed,
1284 stopping when the end of file is reached or another
1288 token is encountered.
1296 There can be only one
1298 token, and it must be after all
1301 This is normally used as:
1303 .Dl default login anonymous password user@site
1305 thereby giving the user
1307 anonymous ftp login to
1308 machines not specified in
1310 This can be overridden
1313 flag to disable auto-login.
1314 .It Ic login Ar name
1315 Identify a user on the remote machine.
1316 If this token is present, the auto-login process will initiate
1317 a login using the specified
1319 .It Ic password Ar string
1321 If this token is present, the auto-login process will supply the
1322 specified string if the remote server requires a password as part
1323 of the login process.
1324 Note that if this token is present in the
1326 file for any user other
1330 will abort the auto-login process if the
1333 anyone besides the user.
1334 .It Ic account Ar string
1335 Supply an additional account password.
1336 If this token is present, the auto-login process will supply the
1337 specified string if the remote server requires an additional
1338 account password, or the auto-login process will initiate an
1340 command if it does not.
1341 .It Ic macdef Ar name
1343 This token functions like the
1347 A macro is defined with the specified name; its contents begin with the
1350 line and continue until a null line (consecutive new-line
1351 characters) is encountered.
1354 is defined, it is automatically executed as the last step in the
1357 .Sh COMMAND LINE EDITING
1359 supports interactive command line editing, via the
1362 It is enabled with the
1364 command, and is enabled by default if input is from a tty.
1365 Previous lines can be recalled and edited with the arrow keys,
1366 and other GNU Emacs-style editing keys may be used as well.
1370 library is configured with a
1374 for more information.
1376 An extra key binding is available to
1378 to provide context sensitive command and filename completion
1379 (including remote file completion).
1380 To use this, bind a key to the
1384 By default, this is bound to the TAB key.
1387 utilizes the following environment variables.
1388 .Bl -tag -width "FTP_PASSIVE_MODE"
1389 .It Ev FTP_PASSIVE_MODE
1390 If this variable is set to something else than
1393 will use passive mode by default.
1395 Host to use as gate-ftp server when
1398 .It Ev FTPSERVERPORT
1399 Port to use when connecting to gate-ftp server when
1402 Default is port returned by a
1407 For default location of a
1409 file, if one exists.
1417 URL of FTP proxy to use when making FTP URL requests
1418 (if not defined, use the standard ftp protocol).
1420 URL of HTTP proxy to use when making HTTP URL requests.
1423 .Xr getservbyname 3 ,
1432 commands are links to
1440 Various features such as command line editing, context sensitive
1441 command and file completion, dynamic progress bar, automatic
1442 fetching of files, ftp and http URLs, and modification time
1443 preservation were implemented in
1445 by Luke Mewburn, with assistance from Jason Thorpe.
1447 IPv6 support was added by WIDE/KAME Project.
1449 Correct execution of many commands depends upon proper behavior
1450 by the remote server.
1452 An error in the treatment of carriage returns
1455 ascii-mode transfer code
1457 This correction may result in incorrect transfers of binary files
1460 servers using the ascii type.
1461 Avoid this problem by using the binary image type.
1463 Proxying functionalities, such as
1465 may not work for IPv6 connection.