xref: /openbsd-src/usr.bin/ftp/ftp.1 (revision f1dd7b858388b4a23f4f67a4957ec5ff656ebbe8)
1.\"	$OpenBSD: ftp.1,v 1.122 2021/02/02 12:58:42 robert Exp $
2.\"	$NetBSD: ftp.1,v 1.22 1997/08/18 10:20:22 lukem Exp $
3.\"
4.\" Copyright (c) 1985, 1989, 1990, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
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. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"	@(#)ftp.1	8.3 (Berkeley) 10/9/94
32.\"
33.Dd $Mdocdate: February 2 2021 $
34.Dt FTP 1
35.Os
36.Sh NAME
37.Nm ftp
38.Nd Internet file transfer program
39.Sh SYNOPSIS
40.Nm ftp
41.Op Fl 46AadEegiMmnptVv
42.Op Fl D Ar title
43.Op Fl k Ar seconds
44.Op Fl P Ar port
45.Op Fl r Ar seconds
46.Op Fl s Ar sourceaddr
47.Op Ar host Op Ar port
48.Nm ftp
49.Op Fl C
50.Op Fl N Ar name
51.Op Fl o Ar output
52.Op Fl s Ar sourceaddr
53.Sm off
54.Pf ftp:// Op Ar user : password No @
55.Ar host Op : Ar port
56.No / Ar file Op /
57.Sm on
58.Ar ...
59.Nm ftp
60.Op Fl CTu
61.Op Fl c Ar cookie
62.Op Fl N Ar name
63.Op Fl o Ar output
64.Op Fl S Ar ssl_options
65.Op Fl s Ar sourceaddr
66.Op Fl U Ar useragent
67.Op Fl w Ar seconds
68.Sm off
69.Pf http Oo s Oc ://
70.Op Ar user : password No @
71.Ar host Op : Ar port
72.No / Ar file
73.Sm on
74.Ar ...
75.Nm ftp
76.Op Fl C
77.Op Fl N Ar name
78.Op Fl o Ar output
79.Op Fl s Ar sourceaddr
80.Pf file: Ar
81.Nm ftp
82.Op Fl C
83.Op Fl N Ar name
84.Op Fl o Ar output
85.Op Fl s Ar sourceaddr
86.Ar host : Ns / Ns Ar file Ns Op /
87.Ar ...
88.Sh DESCRIPTION
89.Nm
90is the user interface to the Internet standard File Transfer
91Protocol (FTP).
92The program allows a user to transfer files to and from a
93remote network site.
94.Pp
95The latter four usage formats will fetch a file using either the
96FTP, HTTP, or HTTPS protocols into the current directory.
97This is ideal for scripts.
98Refer to
99.Sx AUTO-FETCHING FILES
100below for more information.
101.Pp
102The options are as follows:
103.Bl -tag -width Ds
104.It Fl 4
105Forces
106.Nm
107to use IPv4 addresses only.
108.It Fl 6
109Forces
110.Nm
111to use IPv6 addresses only.
112.It Fl A
113Force active mode FTP.
114By default,
115.Nm
116will try to use passive mode FTP and fall back to active mode
117if passive is not supported by the server.
118This option causes
119.Nm
120to always use an active connection.
121It is only useful for connecting
122to very old servers that do not implement passive mode properly.
123.It Fl a
124Causes
125.Nm
126to bypass the normal login procedure and use an anonymous login instead.
127.It Fl C
128Continue a previously interrupted file transfer.
129.Nm
130will continue transferring from an offset equal to the length of
131.Ar file .
132.Pp
133Resuming HTTP(S) transfers are only supported
134if the remote server supports the
135.Dq Range
136header.
137.It Fl c Ar cookie
138Load a Netscape-like cookiejar file
139for HTTP and HTTPS transfers.
140With this option relevant cookies from the jar are sent with each HTTP(S)
141request.
142Setting the
143.Ev http_cookies
144environment variable has the same effect.
145If both the
146.Ev http_cookies
147environment variable is set and the
148.Fl c
149argument is given, the latter takes precedence.
150.It Fl D Ar title
151Specify a short
152.Ar title
153for the start of the progress bar.
154.It Fl d
155Enables debugging.
156.It Fl E
157Disables EPSV/EPRT command on IPv4 connections.
158.It Fl e
159Disables command line editing.
160Useful for Emacs ange-ftp.
161.It Fl g
162Disables file name globbing.
163.It Fl i
164Turns off interactive prompting during
165multiple file transfers.
166.It Fl k Ar seconds
167When greater than zero,
168sends a byte after each
169.Ar seconds
170period over the control connection during long transfers,
171so that incorrectly configured network equipment won't
172aggressively drop it.
173The FTP protocol supports a
174.Dv NOOP
175command that can be used for that purpose.
176This assumes the FTP server can deal with extra commands coming over
177the control connection during a transfer.
178Well-behaved servers queue those commands, and process them after the
179transfer.
180By default,
181.Nm
182will send a byte every 60 seconds.
183.It Fl M
184Causes
185.Nm
186to never display the progress meter in cases where it would do
187so by default.
188.It Fl m
189Causes
190.Nm
191to always display the progress meter in cases where it would not do
192so by default.
193.It Fl N Ar name
194Use this alternative name instead of
195.Nm
196in some error reports.
197.It Fl n
198Restrains
199.Nm
200from attempting
201.Dq auto-login
202upon initial connection.
203If auto-login is enabled,
204.Nm
205will check the
206.Pa .netrc
207file (see below) in the user's home directory for an entry describing
208an account on the remote machine.
209If no entry exists,
210.Nm
211will prompt for the remote machine login name (default is the user
212identity on the local machine) and, if necessary, prompt for a password
213and an account with which to log in.
214.It Fl o Ar output
215When fetching a single file or URL, save the contents in
216.Ar output .
217To make the contents go to stdout,
218use
219.Sq -
220for
221.Ar output .
222.It Fl P Ar port
223Sets the port number to
224.Ar port .
225.It Fl p
226Enable passive mode operation for use behind connection filtering firewalls.
227This option has been deprecated as
228.Nm
229now tries to use passive mode by default, falling back to active mode
230if the server does not support passive connections.
231.It Fl r Ar seconds
232Retry to connect if failed, pausing for number of
233.Ar seconds .
234.It Fl S Ar ssl_options
235SSL/TLS options to use with HTTPS transfers.
236The following settings are available:
237.Bl -tag -width Ds
238.It Cm cafile Ns = Ns Ar /path/to/cert.pem
239PEM encoded file containing CA certificates used for certificate
240validation.
241.It Cm capath Ns = Ns Ar /path/to/certs/
242Directory containing PEM encoded CA certificates used for certificate
243validation.
244Such a directory can be prepared using the c_rehash script distributed with
245OpenSSL.
246.It Cm ciphers Ns = Ns Ar cipher_list
247Specify the list of ciphers that will be used by
248.Nm .
249See the
250.Xr openssl 1
251.Cm ciphers
252subcommand.
253.It Cm depth Ns = Ns Ar max_depth
254Maximum depth of the certificate chain allowed when performing
255validation.
256.It Cm do
257Perform server certificate validation.
258.It Cm dont
259Don't perform server certificate validation.
260.It Cm muststaple
261Require the server to present a valid OCSP stapling in the TLS handshake.
262.It Cm noverifytime
263Disable validation of certificate times and OCSP validation.
264.It Cm protocols Ns = Ns Ar protocol_list
265Specify the TLS protocols that will be supported by
266.Nm
267(see
268.Xr tls_config_parse_protocols 3
269for details).
270.It Cm session Ns = Ns Ar /path/to/session
271Specify a file to use for TLS session data.
272If this file has a non-zero length, the session data will be read from this file
273and the client will attempt to resume the TLS session with the server.
274Upon completion of a successful TLS handshake this file will be updated
275with new session data, if available.
276This file will be created if it does not already exist.
277.El
278.Pp
279By default, server certificate validation is performed, and if it fails
280.Nm
281will abort.
282If no
283.Cm cafile
284or
285.Cm capath
286setting is provided,
287.Pa /etc/ssl/cert.pem
288will be used.
289.It Fl s Ar sourceaddr
290Set the source address for connections, which is useful on machines
291with multiple interfaces.
292.It Fl T
293Send an
294.Dq If-Modified-Since
295header to the remote to determine if the remote file's timestamp
296has changed.
297.It Fl t
298Enables packet tracing.
299.It Fl U Ar useragent
300Set
301.Ar useragent
302as the User-Agent for HTTP(S) URL requests.
303If not specified, the default User-Agent is
304.Dq OpenBSD ftp .
305.It Fl u
306Disable setting the local file's timestamps based
307on the
308.Dq Last-Modified
309header.
310By default the local file's timestamps are set to match those
311from the remote.
312.It Fl V
313Disable verbose mode, overriding the default of enabled when input
314is from a terminal.
315.It Fl v
316Enable verbose mode.
317This is the default if input is from a terminal.
318Forces
319.Nm
320to show all responses from the remote server, as well
321as report on data transfer statistics.
322.It Fl w Ar seconds
323For URL format connections to HTTP/HTTPS servers, abort a
324slow connection after
325.Ar seconds .
326.El
327.Pp
328The host with which
329.Nm
330is to communicate may be specified on the command line.
331If this is done,
332.Nm
333will immediately attempt to establish a connection to an
334FTP server on that host; otherwise,
335.Nm
336will enter its command interpreter and await instructions
337from the user.
338When
339.Nm
340is awaiting commands, the prompt
341.Dq ftp\*(Gt
342is provided to the user.
343The following commands are recognized
344by
345.Nm :
346.Bl -tag -width Ds
347.It Ic \&! Oo Ar command
348.Op Ar arg ...
349.Oc
350Invoke an interactive shell on the local machine.
351If there are arguments, the first is taken to be a command to execute
352directly, with the rest of the arguments as its arguments.
353.It Ic \&$ Ar macro-name Op Ar arg ...
354Execute the macro
355.Ar macro-name
356that was defined with the
357.Ic macdef
358command.
359Arguments are passed to the macro unglobbed.
360.It Ic \&? Op Ar command
361A synonym for
362.Ic help .
363.It Ic account Op Ar password
364Supply a supplemental password required by a remote system for access
365to resources once a login has been successfully completed.
366If no argument is included, the user will be prompted for an account
367password in a non-echoing input mode.
368.It Ic append Ar local-file Op Ar remote-file
369Append a local file to a file on the remote machine.
370If
371.Ar remote-file
372is left unspecified, the local file name is used in naming the
373remote file after being altered by any
374.Ic ntrans
375or
376.Ic nmap
377setting.
378File transfer uses the current settings for
379.Ic type ,
380.Ic format ,
381.Ic mode ,
382and
383.Ic structure .
384.It Ic ascii
385Set the file transfer
386.Ic type
387to network ASCII.
388.It Ic bell Op Ic on | off
389Arrange that a bell be sounded after each file transfer
390command is completed.
391.It Ic binary
392Set the file transfer
393.Ic type
394to support binary image transfer.
395This is the default type.
396.It Ic bye
397Terminate the FTP session with the remote server and exit
398.Nm .
399An end-of-file will also terminate the session and exit.
400.It Ic case Op Ic on | off
401Toggle remote computer file name case mapping during
402.Ic mget
403commands.
404When
405.Ic case
406is on (default is off), remote computer file names with all letters in
407upper case are written in the local directory with the letters mapped
408to lower case.
409.It Ic cd Ar remote-directory
410Change the working directory on the remote machine
411to
412.Ar remote-directory .
413.It Ic cdup
414Change the remote machine working directory to the parent of the
415current remote machine working directory.
416.It Ic chmod Ar mode file
417Change the permission modes of
418.Ar file
419on the remote
420system to
421.Ar mode .
422.It Ic close
423Terminate the FTP session with the remote server and
424return to the command interpreter.
425Any defined macros are erased.
426.It Ic cr Op Ic on | off
427Toggle carriage return stripping during
428ASCII type file retrieval.
429Records are denoted by a carriage return/linefeed sequence
430during ASCII type file transfer.
431When
432.Ic cr
433is on (the default), carriage returns are stripped from this
434sequence to conform with the
435.Ux
436single linefeed record delimiter.
437Records on non-UNIX
438remote systems may contain single linefeeds;
439when an ASCII type transfer is made, these linefeeds may be
440distinguished from a record delimiter only when
441.Ic cr
442is off.
443.It Ic debug Oo Ic on | off |
444.Ar debuglevel
445.Oc
446Toggle debugging mode.
447If an optional
448.Ar debuglevel
449is specified, it is used to set the debugging level.
450When debugging is on,
451.Nm
452prints each command sent to the remote machine,
453preceded by the string
454.Ql --\*(Gt .
455.It Ic delete Ar remote-file
456Delete the file
457.Ar remote-file
458on the remote machine.
459.It Ic dir Op Ar remote-directory Op Ar local-file
460A synonym for
461.Ic ls .
462.It Ic disconnect
463A synonym for
464.Ic close .
465.It Ic edit Op Ic on | off
466Toggle command line editing, and context sensitive command and file
467completion.
468This is automatically enabled if input is from a terminal, and
469disabled otherwise.
470.It Ic epsv4 Op Ic on | off
471Toggle use of EPSV/EPRT command on IPv4 connection.
472.It Ic exit
473A synonym for
474.Ic bye .
475.It Ic form Ar format
476Set the file transfer
477.Ic form
478to
479.Ar format .
480The default format is
481.Dq file .
482.It Ic ftp Ar host Op Ar port
483A synonym for
484.Ic open .
485.It Ic gate Oo Ic on | off |
486.Ar host Op Ar port
487.Oc
488Toggle gate-ftp mode.
489This will not be permitted if the gate-ftp server hasn't been set
490(either explicitly by the user, or from the
491.Ev FTPSERVER
492environment variable).
493If
494.Ar host
495is given,
496then gate-ftp mode will be enabled, and the gate-ftp server will be set to
497.Ar host .
498If
499.Ar port
500is also given, that will be used as the port to connect to on the
501gate-ftp server.
502.It Ic get Ar remote-file Op Ar local-file
503Retrieve the
504.Ar remote-file
505and store it on the local machine.
506If the local
507file name is not specified, it is given the same
508name it has on the remote machine, subject to
509alteration by the current
510.Ic case ,
511.Ic ntrans ,
512and
513.Ic nmap
514settings.
515The current settings for
516.Ic type ,
517.Ic form ,
518.Ic mode ,
519and
520.Ic structure
521are used while transferring the file.
522.It Ic glob Op Ic on | off
523Toggle filename expansion for
524.Ic mdelete ,
525.Ic mget
526and
527.Ic mput .
528If globbing is turned off with
529.Ic glob ,
530the file name arguments
531are taken literally and not expanded.
532Globbing for
533.Ic mput
534is done as in
535.Xr csh 1 .
536For
537.Ic mdelete
538and
539.Ic mget ,
540each remote file name is expanded
541separately on the remote machine and the lists are not merged.
542Expansion of a directory name is likely to be
543different from expansion of the name of an ordinary file:
544the exact result depends on the foreign operating system and FTP server,
545and can be previewed by doing
546.Dq mls remote-files - .
547Note:
548.Ic mget
549and
550.Ic mput
551are not meant to transfer
552entire directory subtrees of files.
553That can be done by
554transferring a
555.Xr tar 1
556archive of the subtree (in binary mode).
557.It Ic hash Oo Ic on | off |
558.Ar size
559.Oc
560Toggle hash mark
561.Pq Ql #
562printing for each data block transferred.
563The size of a data block defaults to 1024 bytes.
564This can be changed by specifying
565.Ar size
566in bytes.
567.It Ic help Op Ar command
568Print an informative message about the meaning of
569.Ar command .
570If no argument is given,
571.Nm
572prints a list of the known commands.
573.It Ic idle Op Ar seconds
574Set the inactivity timer on the remote server to
575.Ar seconds
576seconds.
577If
578.Ar seconds
579is omitted, the current inactivity timer is printed.
580.It Ic lcd Op Ar local-directory
581Change the working directory on the local machine.
582If
583no
584.Ar local-directory
585is specified, the user's home directory is used.
586.It Ic less Ar file
587A synonym for
588.Ic page .
589.It Ic lpwd
590Print the working directory on the local machine.
591.It Ic ls Op Ar remote-directory Op Ar local-file
592Print a listing of the contents of a directory on the remote machine.
593The listing includes any system-dependent information that the server
594chooses to include; for example, most
595.Ux
596systems will produce output from the command
597.Ql ls -l .
598If
599.Ar remote-directory
600is left unspecified, the current working directory is used.
601If interactive prompting is on,
602.Nm
603will prompt the user to verify that the last argument is indeed the
604target local file for receiving
605.Ic ls
606output.
607If no local file is specified, or if
608.Ar local-file
609is
610.Sq - ,
611the output is sent to the terminal.
612.It Ic macdef Ar macro-name
613Define a macro.
614Subsequent lines are stored as the macro
615.Ar macro-name ;
616a null line (consecutive newline characters
617in a file or
618carriage returns from the terminal) terminates macro input mode.
619There is a limit of 16 macros and 4096 total characters in all
620defined macros.
621Macro names can be a maximum of 8 characters.
622Macros are only applicable to the current session they are
623defined in (or if defined outside a session, to the session
624invoked with the next
625.Ic open
626command), and remain defined until a
627.Ic close
628command is executed.
629To invoke a macro,
630use the
631.Ic $
632command (see above).
633.Pp
634The macro processor interprets
635.Ql $
636and
637.Ql \e
638as special characters.
639A
640.Ql $
641followed by a number (or numbers) is replaced by the
642corresponding argument on the macro invocation command line.
643A
644.Ql $
645followed by an
646.Sq i
647tells the macro processor that the
648executing macro is to be looped.
649On the first pass
650.Ql $i
651is
652replaced by the first argument on the macro invocation command line,
653on the second pass it is replaced by the second argument, and so on.
654A
655.Ql \e
656followed by any character is replaced by that character.
657Use the
658.Ql \e
659to prevent special treatment of the
660.Ql $ .
661.It Ic mdelete Op Ar remote-files
662Delete the
663.Ar remote-files
664on the remote machine.
665.It Ic mdir Ar remote-files local-file
666A synonym for
667.Ic mls .
668.It Xo Ic mget
669.Op Fl cnr
670.Op Fl d Ar depth
671.Ar remote-files
672.Xc
673Expand the
674.Ar remote-files
675on the remote machine
676and do a
677.Ic get
678for each file name thus produced.
679See
680.Ic glob
681for details on the filename expansion.
682Resulting file names will then be processed according to
683.Ic case ,
684.Ic ntrans ,
685and
686.Ic nmap
687settings.
688Files are transferred into the local working directory,
689which can be changed with
690.Ql lcd directory ;
691new local directories can be created with
692.Ql "\&! mkdir directory" .
693.Pp
694The options are as follows:
695.Bl -tag -width Ds
696.It Fl c
697Use
698.Ic reget
699instead of
700.Ic get .
701.It Fl d Ar depth
702Specify the maximum recursion level
703.Ar depth .
704The default is 0, which means unlimited.
705.It Fl n
706Use
707.Ic newer
708instead of
709.Ic get .
710.It Fl r
711Recursively descend the directory tree, transferring all files and
712directories.
713.El
714.It Ic mkdir Ar directory-name
715Make a directory on the remote machine.
716.It Ic mls Ar remote-files local-file
717Like
718.Ic ls ,
719except multiple remote files may be specified,
720and the
721.Ar local-file
722must be specified.
723If interactive prompting is on,
724.Nm
725will prompt the user to verify that the last argument is indeed the
726target local file for receiving
727.Ic mls
728output.
729.It Ic mode Op Ar mode-name
730Set the file transfer
731.Ic mode
732to
733.Ar mode-name .
734The default mode is
735.Dq stream
736mode.
737.It Ic modtime Ar file
738Show the last modification time of
739.Ar file
740on the remote machine.
741.It Ic more Ar file
742A synonym for
743.Ic page .
744.It Xo Ic mput
745.Op Fl cr
746.Op Fl d Ar depth
747.Ar local-files
748.Xc
749Expand wild cards in the list of local files given as arguments
750and do a
751.Ic put
752for each file in the resulting list.
753See
754.Ic glob
755for details of filename expansion.
756Resulting file names will then be processed according to
757.Ic ntrans
758and
759.Ic nmap
760settings.
761.Pp
762If the
763.Fl c
764flag is specified then
765The options are as follows:
766.Bl -tag -width Ds
767.It Fl c
768Use
769.Ic reput
770instead of
771.Ic put .
772.It Fl d Ar depth
773Specify the maximum recursion level
774.Ar depth .
775The default is 0, which means unlimited.
776.It Fl r
777Recursively descend the directory tree, transferring all files and
778directories.
779.El
780.It Xo Ic msend
781.Op Fl c
782.Ar local-files
783.Xc
784A synonym for
785.Ic mput .
786.It Ic newer Ar remote-file Op Ar local-file
787Get the file only if the modification time of the remote file is more
788recent than the file on the current system.
789If the file does not
790exist on the current system, the remote file is considered
791.Ic newer .
792Otherwise, this command is identical to
793.Ar get .
794.It Ic nlist Op Ar remote-directory Op Ar local-file
795Print a list of the files in a
796directory on the remote machine.
797If
798.Ar remote-directory
799is left unspecified, the current working directory is used.
800If interactive prompting is on,
801.Nm
802will prompt the user to verify that the last argument is indeed the
803target local file for receiving
804.Ic nlist
805output.
806If no local file is specified, or if
807.Ar local-file
808is
809.Sq - ,
810the output is sent to the terminal.
811Note that on some servers, the
812.Ic nlist
813command will only return information on normal files (not directories
814or special files).
815.It Ic nmap Op Ar inpattern outpattern
816Set or unset the filename mapping mechanism.
817If no arguments are specified, the filename mapping mechanism is unset.
818If arguments are specified, remote filenames are mapped during
819.Ic mput
820commands and
821.Ic put
822commands issued without a specified remote target filename.
823If arguments are specified, local filenames are mapped during
824.Ic mget
825commands and
826.Ic get
827commands issued without a specified local target filename.
828This command is useful when connecting to a non-UNIX remote computer
829with different file naming conventions or practices.
830.Pp
831The mapping follows the pattern set by
832.Ar inpattern
833and
834.Ar outpattern .
835.Ar inpattern
836is a template for incoming filenames (which may have already been
837processed according to the
838.Ic ntrans
839and
840.Ic case
841settings).
842Variable templating is accomplished by including the
843sequences
844.Ql $1 ,
845.Ql $2 ,
846\&...,
847.Ql $9
848in
849.Ar inpattern .
850Use
851.Ql \e
852to prevent this special treatment of the
853.Ql $
854character.
855All other characters are treated literally, and are used to determine the
856.Ic nmap
857.Ar inpattern
858variable values.
859.Pp
860For example, given
861.Ar inpattern
862$1.$2 and the remote file name "mydata.data", $1 would have the value
863"mydata", and $2 would have the value "data".
864The
865.Ar outpattern
866determines the resulting mapped filename.
867The sequences
868.Ql $1 ,
869.Ql $2 ,
870\&...,
871.Ql $9
872are replaced by any value resulting from the
873.Ar inpattern
874template.
875The sequence
876.Ql $0
877is replaced by the original filename.
878Additionally, the sequence
879.Sq Op Ar seq1 , Ar seq2
880is replaced by
881.Ar seq1
882if
883.Ar seq1
884is not a null string; otherwise it is replaced by
885.Ar seq2 .
886For example:
887.Pp
888.Dl nmap $1.$2.$3 [$1,$2].[$2,file]
889.Pp
890This command would yield the output filename
891.Pa myfile.data
892for input filenames
893.Pa myfile.data
894and
895.Pa myfile.data.old ;
896.Pa myfile.file
897for the input filename
898.Pa myfile ;
899and
900.Pa myfile.myfile
901for the input filename
902.Pa .myfile .
903Spaces may be included in
904.Ar outpattern
905by quoting them,
906as in the following example:
907.Bd -literal -offset indent
908nmap $1.$2 "$1 $2"
909.Ed
910.Pp
911Use the
912.Ql \e
913character to prevent special treatment
914of the
915.Ql $ ,
916.Ql \&[ ,
917.Ql \&] ,
918and
919.Ql \&,
920characters.
921.It Ic ntrans Op Ar inchars Op Ar outchars
922Set or unset the filename character translation mechanism.
923If no arguments are specified, the filename character
924translation mechanism is unset.
925If arguments are specified, characters in
926remote filenames are translated during
927.Ic mput
928commands and
929.Ic put
930commands issued without a specified remote target filename.
931If arguments are specified, characters in
932local filenames are translated during
933.Ic mget
934commands and
935.Ic get
936commands issued without a specified local target filename.
937This command is useful when connecting to a non-UNIX remote computer
938with different file naming conventions or practices.
939Characters in a filename matching a character in
940.Ar inchars
941are replaced with the corresponding character in
942.Ar outchars .
943If the character's position in
944.Ar inchars
945is longer than the length of
946.Ar outchars ,
947the character is deleted from the file name.
948.It Ic open Ar host Op Ar port
949Establish a connection to the specified
950.Ar host
951FTP server.
952An optional port number may be supplied,
953in which case
954.Nm
955will attempt to contact an FTP server at that port.
956If the
957.Ic auto-login
958option is on (default),
959.Nm
960will also attempt to automatically log the user in to
961the FTP server (see below).
962.It Ic page Ar file
963Retrieve
964.Ic file
965and display with the program defined in
966.Ev PAGER
967(defaulting to
968.Xr more 1
969if
970.Ev PAGER
971is null or not defined).
972.It Ic passive Op Ic on | off
973Toggle passive mode.
974If passive mode is turned on (default is on),
975.Nm
976will send a
977.Dv EPSV
978command for all data connections instead of the usual
979.Dv PORT
980command.
981The
982.Dv PASV
983command requests that the remote server open a port for the data connection
984and return the address of that port.
985The remote server listens on that port and the client connects to it.
986When using the more traditional
987.Dv PORT
988command, the client listens on a port and sends that address to the remote
989server, who connects back to it.
990Passive mode is useful when using
991.Nm
992through a gateway router or host that controls the directionality of
993traffic.
994(Note that though FTP servers are required to support the
995.Dv PASV
996command by RFC 1123, some do not.)
997.It Ic preserve Op Ic on | off
998Toggle preservation of modification times on retrieved files.
999.It Ic progress Op Ic on | off
1000Toggle display of transfer progress bar.
1001The progress bar will be disabled for a transfer that has
1002.Ar local-file
1003as
1004.Sq -
1005or a command that starts with
1006.Sq \&| .
1007Refer to
1008.Sx FILE NAMING CONVENTIONS
1009for more information.
1010.It Ic prompt Op Ic on | off
1011Toggle interactive prompting.
1012Interactive prompting
1013occurs during multiple file transfers to allow the
1014user to selectively retrieve or store files.
1015If prompting is turned off (default is on), any
1016.Ic mget
1017or
1018.Ic mput
1019will transfer all files, and any
1020.Ic mdelete
1021will delete all files.
1022.Pp
1023When prompting is on, the following commands are available at a prompt:
1024.Bl -tag -width 2n -offset indent
1025.It Ic ?\&
1026Print help message.
1027.It Ic a
1028Answer
1029.Dq yes
1030to the current file and automatically answer
1031.Dq yes
1032to any remaining files for the current command.
1033.It Ic n
1034Do not transfer the file.
1035.It Ic p
1036Answer
1037.Dq yes
1038to the current file and turn off prompt mode
1039(as if
1040.Dq prompt off
1041had been given).
1042.It Ic q
1043Answer
1044.Dq no
1045to the current file and automatically answer
1046.Dq no
1047to any remaining files for the current command.
1048.It Ic y
1049Transfer the file.
1050.El
1051.It Ic proxy Ar command
1052Execute an FTP command on a secondary control connection.
1053This command allows simultaneous connection to two remote FTP
1054servers for transferring files between the two servers.
1055The first
1056.Ic proxy
1057command should be an
1058.Ic open ,
1059to establish the secondary control connection.
1060Enter the command
1061.Ic proxy ?\&
1062to see other FTP commands executable on the
1063secondary connection.
1064The following commands behave differently when prefaced by
1065.Ic proxy :
1066.Ic open
1067will not define new macros during the auto-login process;
1068.Ic close
1069will not erase existing macro definitions;
1070.Ic get
1071and
1072.Ic mget
1073transfer files from the host on the primary control connection
1074to the host on the secondary control connection; and
1075.Ic put ,
1076.Ic mput ,
1077and
1078.Ic append
1079transfer files from the host on the secondary control connection
1080to the host on the primary control connection.
1081Third party file transfers depend upon support of the FTP protocol
1082.Dv PASV
1083command by the server on the secondary control connection.
1084.It Ic put Ar local-file Op Ar remote-file
1085Store a local file on the remote machine.
1086If
1087.Ar remote-file
1088is left unspecified, the local file name is used
1089after processing according to any
1090.Ic ntrans
1091or
1092.Ic nmap
1093settings
1094in naming the remote file.
1095File transfer uses the
1096current settings for
1097.Ic type ,
1098.Ic format ,
1099.Ic mode ,
1100and
1101.Ic structure .
1102.It Ic pwd
1103Print the name of the current working directory on the remote
1104machine.
1105.It Ic quit
1106A synonym for
1107.Ic bye .
1108.It Ic quote Ar arg ...
1109The arguments specified are sent, verbatim, to the remote FTP server.
1110.It Ic recv Ar remote-file Op Ar local-file
1111A synonym for
1112.Ic get .
1113.It Ic reget Ar remote-file Op Ar local-file
1114Reget acts like get, except that if
1115.Ar local-file
1116exists and is
1117smaller than
1118.Ar remote-file ,
1119.Ar local-file
1120is presumed to be
1121a partially transferred copy of
1122.Ar remote-file
1123and the transfer
1124is continued from the apparent point of failure.
1125This command
1126is useful when transferring very large files over networks that
1127are prone to dropping connections.
1128.It Ic rename Ar from-name to-name
1129Rename the file
1130.Ar from-name
1131on the remote machine to the file
1132.Ar to-name .
1133.It Ic reput Ar local-file Op Ar remote-file
1134Reput acts like put, except that if
1135.Ar remote-file
1136exists and is
1137smaller than
1138.Ar local-file ,
1139.Ar remote-file
1140is presumed to be
1141a partially transferred copy of
1142.Ar local-file
1143and the transfer
1144is continued from the apparent point of failure.
1145This command
1146is useful when transferring very large files over networks that
1147are prone to dropping connections.
1148.It Ic reset
1149Clear reply queue.
1150This command re-synchronizes command/reply sequencing with the remote
1151FTP server.
1152Resynchronization may be necessary following a violation of the FTP protocol
1153by the remote server.
1154.It Ic restart Ar marker
1155Restart the immediately following
1156.Ic get
1157or
1158.Ic put
1159at the
1160indicated
1161.Ar marker .
1162On
1163.Ux
1164systems,
1165.Ar marker
1166is usually a byte
1167offset into the file.
1168.It Ic rhelp Op Ar command-name
1169Request help from the remote FTP server.
1170If a
1171.Ar command-name
1172is specified, it is supplied to the server as well.
1173.It Ic rmdir Ar directory-name
1174Delete a directory on the remote machine.
1175.It Ic rstatus Op Ar file
1176With no arguments, show status of remote machine.
1177If
1178.Ar file
1179is specified, show status of
1180.Ar file
1181on remote machine.
1182.It Ic runique Op Ic on | off
1183Toggle storing of files on the local system with unique filenames.
1184If a file already exists with a name equal to the target
1185local filename for a
1186.Ic get
1187or
1188.Ic mget
1189command, a
1190.Dq .1
1191is appended to the name.
1192If the resulting name matches another existing file,
1193a
1194.Dq .2
1195is appended to the original name.
1196If this process continues up to
1197.Dq .99 ,
1198an error message is printed, and the transfer does not take place.
1199The generated unique filename will be reported.
1200Note that
1201.Ic runique
1202will not affect local files generated from a shell command
1203(see below).
1204The default value is off.
1205.It Ic send Ar local-file Op Ar remote-file
1206A synonym for
1207.Ic put .
1208.It Ic sendport Op Ic on | off
1209Toggle the use of
1210.Dv PORT
1211commands.
1212By default,
1213.Nm
1214will attempt to use a
1215.Dv PORT
1216command when establishing
1217a connection for each data transfer.
1218The use of
1219.Dv PORT
1220commands can prevent delays
1221when performing multiple file transfers.
1222If the
1223.Dv PORT
1224command fails,
1225.Nm
1226will use the default data port.
1227When the use of
1228.Dv PORT
1229commands is disabled, no attempt will be made to use
1230.Dv PORT
1231commands for each data transfer.
1232This is useful for certain FTP implementations which do ignore
1233.Dv PORT
1234commands but, incorrectly, indicate they've been accepted.
1235.It Ic site Ar arg ...
1236The arguments specified are sent, verbatim, to the remote FTP server as a
1237.Dv SITE
1238command.
1239.It Ic size Ar file
1240Return size of
1241.Ar file
1242on remote machine.
1243.It Ic status
1244Show the current status of
1245.Nm .
1246.\" .It Ic struct Op Ar struct-name
1247.\" Set the file transfer
1248.\" .Ar structure
1249.\" to
1250.\" .Ar struct-name .
1251.\" By default,
1252.\" .Dq file
1253.\" structure is used.
1254.It Ic sunique Op Ic on | off
1255Toggle storing of files on remote machine under unique file names.
1256The remote FTP server must support the FTP protocol
1257.Dv STOU
1258command for
1259successful completion.
1260The remote server will report the unique name.
1261Default value is off.
1262.It Ic system
1263Show the type of operating system running on the remote machine.
1264.It Ic trace Op Ic on | off
1265Toggle packet tracing.
1266.It Ic type Op Ar type-name
1267Set the file transfer
1268.Ic type
1269to
1270.Ar type-name .
1271If no type is specified, the current type
1272is printed.
1273The default type is
1274.Dq binary .
1275.It Ic umask Op Ar newmask
1276Set the default umask on the remote server to
1277.Ar newmask .
1278If
1279.Ar newmask
1280is omitted, the current umask is printed.
1281.It Xo
1282.Ic user Ar username
1283.Op Ar password Op Ar account
1284.Xc
1285Identify yourself to the remote FTP server.
1286If the
1287.Ar password
1288is not specified and the server requires it,
1289.Nm
1290will prompt the user for it (after disabling local echo).
1291If an
1292.Ar account
1293field is not specified, and the FTP server requires it,
1294the user will be prompted for it.
1295If an
1296.Ar account
1297field is specified, an account command will
1298be relayed to the remote server after the login sequence
1299is completed if the remote server did not require it
1300for logging in.
1301Unless
1302.Nm
1303is invoked with
1304.Dq auto-login
1305disabled, this process is done automatically on initial connection to the
1306FTP server.
1307.It Ic verbose Op Ic on | off
1308Toggle verbose mode.
1309In verbose mode, all responses from
1310the FTP server are displayed to the user.
1311In addition,
1312if verbose is on, when a file transfer completes, statistics
1313regarding the efficiency of the transfer are reported.
1314By default,
1315verbose is on.
1316.El
1317.Pp
1318Command arguments which have embedded spaces may be quoted with
1319quote
1320.Pq Ql \&"
1321marks.
1322.Pp
1323Commands which toggle settings can take an explicit
1324.Ic on
1325or
1326.Ic off
1327argument to force the setting appropriately.
1328.Pp
1329If
1330.Nm
1331receives a
1332.Dv SIGINFO
1333(see the
1334.Dq status
1335argument of
1336.Xr stty 1 )
1337signal whilst a transfer is in progress, the current transfer rate
1338statistics will be written to the standard error output, in the
1339same format as the standard completion message.
1340.Sh AUTO-FETCHING FILES
1341In addition to standard commands, this version of
1342.Nm
1343supports an auto-fetch feature.
1344To enable auto-fetch, simply pass the list of hostnames/files
1345on the command line.
1346.Pp
1347The following formats are valid syntax for an auto-fetch element:
1348.Bl -tag -width Ds
1349.It Ar host : Ns / Ns Ar file Ns Op /
1350.Dq Classic
1351.Nm
1352format.
1353.Sm off
1354.It Xo
1355.Pf ftp:// Op Ar user : password No @
1356.Ar host Op : Ar port
1357.No / Ar file Op /
1358.Xc
1359.Sm on
1360An FTP URL, retrieved using the FTP protocol if
1361.Ev ftp_proxy
1362isn't defined.
1363Otherwise, transfer using HTTP via the proxy defined in
1364.Ev ftp_proxy .
1365If a
1366.Ar user
1367and
1368.Ar password
1369are given and
1370.Ev ftp_proxy
1371isn't defined,
1372log in as
1373.Ar user
1374with a password of
1375.Ar password .
1376.Sm off
1377.It Xo
1378.Pf http:// Op Ar user : password No @
1379.Ar host Op : Ar port
1380.No / Ar file
1381.Xc
1382.Sm on
1383An HTTP URL, retrieved using the HTTP protocol.
1384If
1385.Ev http_proxy
1386is defined, it is used as a URL to an HTTP proxy server.
1387If a
1388.Ar user
1389and
1390.Ar password
1391are given and
1392.Ev http_proxy
1393isn't defined,
1394log in as
1395.Ar user
1396with a password of
1397.Ar password
1398using Basic authentication.
1399.Sm off
1400.It Xo
1401.Pf https:// Op Ar user : password No @
1402.Ar host Op : Ar port
1403.No / Ar file
1404.Xc
1405.Sm on
1406An HTTPS URL, retrieved using the HTTPS protocol.
1407If
1408.Ev http_proxy
1409is defined, this HTTPS proxy server will be used to fetch the
1410file using the CONNECT method.
1411If a
1412.Ar user
1413and
1414.Ar password
1415are given and
1416.Ev http_proxy
1417isn't defined,
1418log in as
1419.Ar user
1420with a password of
1421.Ar password
1422using Basic authentication.
1423.It Pf file: Ar file
1424.Ar file
1425is retrieved from a mounted file system.
1426.El
1427.Pp
1428If a classic format or an FTP URL format has a trailing
1429.Sq / ,
1430then
1431.Nm
1432will connect to the site and
1433.Ic cd
1434to the directory given as the path, and leave the user in interactive
1435mode ready for further input.
1436.Pp
1437If
1438.Ar file
1439contains a glob character and globbing is enabled
1440(see
1441.Ic glob ) ,
1442then the equivalent of
1443.Ic mget Ar file
1444is performed.
1445.Pp
1446If no
1447.Fl o
1448option is specified, and
1449the directory component of
1450.Ar file
1451contains no globbing characters,
1452then
1453it is stored in the current directory as the
1454.Xr basename 1
1455of
1456.Ar file .
1457If
1458.Fl o Ar output
1459is specified, then
1460.Ar file
1461is stored as
1462.Ar output .
1463Otherwise, the remote name is used as the local name.
1464.Sh ABORTING A FILE TRANSFER
1465To abort a file transfer, use the terminal interrupt key
1466(usually Ctrl-C).
1467Sending transfers will be immediately halted.
1468Receiving transfers will be halted by sending an FTP protocol
1469.Dv ABOR
1470command to the remote server, and discarding any further data received.
1471The speed at which this is accomplished depends upon the remote
1472server's support for
1473.Dv ABOR
1474processing.
1475If the remote server does not support the
1476.Dv ABOR
1477command, an
1478.Ql ftp\*(Gt
1479prompt will not appear until the remote server has completed
1480sending the requested file.
1481.Pp
1482The terminal interrupt key sequence will be ignored when
1483.Nm
1484has completed any local processing and is awaiting a reply
1485from the remote server.
1486A long delay in this mode may result from the ABOR processing described
1487above, or from unexpected behavior by the remote server, including
1488violations of the FTP protocol.
1489If the delay results from unexpected remote server behavior, the local
1490.Nm
1491program must be killed by hand.
1492.Sh FILE NAMING CONVENTIONS
1493Files specified as arguments to
1494.Nm
1495commands are processed according to the following rules.
1496.Bl -enum
1497.It
1498If
1499.Sq -
1500is specified as a local file name, the standard input (for reading)
1501or standard output (for writing)
1502is used.
1503.It
1504If the first character of a local file name is
1505.Sq \&| ,
1506the
1507remainder of the argument is interpreted as a shell command.
1508.Nm
1509then forks a shell, using
1510.Xr popen 3
1511with the argument supplied, and reads (writes) from the standard output
1512(standard input).
1513If the shell command includes spaces, the argument
1514must be quoted; e.g.,
1515.Qq ls -lt .
1516A particularly
1517useful example of this mechanism is:
1518.Qq ls \&. |more .
1519.It
1520Failing the above checks, if
1521.Dq globbing
1522is enabled,
1523local file names are expanded
1524according to the rules used in the
1525.Xr csh 1
1526.Ic glob
1527command.
1528If the
1529.Nm
1530command expects a single local file (e.g.,
1531.Ic put ) ,
1532only the first filename generated by the
1533.Dq globbing
1534operation is used.
1535.It
1536For
1537.Ic mget
1538commands and
1539.Ic get
1540commands with unspecified local file names, the local filename is
1541the remote filename, which may be altered by a
1542.Ic case ,
1543.Ic ntrans ,
1544or
1545.Ic nmap
1546setting.
1547The resulting filename may then be altered if
1548.Ic runique
1549is on.
1550.It
1551For
1552.Ic mput
1553commands and
1554.Ic put
1555commands with unspecified remote file names, the remote filename is
1556the local filename, which may be altered by a
1557.Ic ntrans
1558or
1559.Ic nmap
1560setting.
1561The resulting filename may then be altered by the remote server if
1562.Ic sunique
1563is on.
1564.El
1565.Sh FILE TRANSFER PARAMETERS
1566The FTP specification specifies many parameters which may
1567affect a file transfer.
1568The
1569.Ic type
1570may be one of
1571.Dq ascii ,
1572.Dq binary ,
1573or
1574.Dq image .
1575.Nm
1576supports the ASCII and image types of file transfer.
1577.Pp
1578.Nm
1579supports only the default values for the remaining
1580file transfer parameters:
1581.Ic mode ,
1582.Ic form ,
1583and
1584.Ic struct .
1585.Sh THE .netrc FILE
1586The
1587.Pa .netrc
1588file contains login and initialization information
1589used by the auto-login process.
1590It resides in the user's home directory.
1591The following tokens are recognized; they may be separated by spaces,
1592tabs, or new-lines:
1593.Bl -tag -width password
1594.It Ic machine Ar name
1595Identify a remote machine
1596.Ar name .
1597The auto-login process searches the
1598.Pa .netrc
1599file for a
1600.Ic machine
1601token that matches the remote machine specified on the
1602.Nm
1603command line or as an
1604.Ic open
1605command argument.
1606Once a match is made, the subsequent
1607.Pa .netrc
1608tokens are processed,
1609stopping when the end of file is reached or another
1610.Ic machine
1611or a
1612.Ic default
1613token is encountered.
1614.It Ic default
1615This is the same as
1616.Ic machine
1617.Ar name
1618except that
1619.Ic default
1620matches any name.
1621There can be only one
1622.Ic default
1623token, and it must be after all
1624.Ic machine
1625tokens.
1626This is normally used as:
1627.Pp
1628.Dl default login anonymous password user@site
1629.Pp
1630thereby giving the user
1631.Ar automatic
1632anonymous FTP login to
1633machines not specified in
1634.Pa .netrc .
1635This can be overridden
1636by using the
1637.Fl n
1638flag to disable auto-login.
1639.It Ic login Ar name
1640Identify a user on the remote machine.
1641If this token is present, the auto-login process will initiate
1642a login using the specified
1643.Ar name .
1644.It Ic password Ar string
1645Supply a password.
1646If this token is present, the auto-login process will supply the
1647specified string if the remote server requires a password as part
1648of the login process.
1649Note that if this token is present in the
1650.Pa .netrc
1651file for any user other
1652than
1653.Ar anonymous ,
1654.Nm
1655will abort the auto-login process if the
1656.Pa .netrc
1657is readable by
1658anyone besides the user.
1659.It Ic account Ar string
1660Supply an additional account password.
1661If this token is present, the auto-login process will supply the
1662specified string if the remote server requires an additional
1663account password, or the auto-login process will initiate an
1664.Dv ACCT
1665command if it does not.
1666.It Ic macdef Ar name
1667Define a macro.
1668This token functions like the
1669.Nm
1670.Ic macdef
1671command functions.
1672A macro is defined with the specified name; its contents begin with the
1673next
1674.Pa .netrc
1675line and continue until a null line (consecutive new-line
1676characters) is encountered.
1677Like the other tokens in the
1678.Pa .netrc
1679file, a
1680.Ic macdef
1681is applicable only to the
1682.Ic machine
1683definition preceding it.
1684A
1685.Ic macdef
1686entry cannot be utilized by multiple
1687.Ic machine
1688definitions; rather, it must be defined following each
1689.Ic machine
1690it is intended to be used with.
1691If a macro named
1692.Ic init
1693is defined, it is automatically executed as the last step in the
1694auto-login process.
1695.El
1696.Sh COMMAND LINE EDITING
1697.Nm
1698supports interactive command line editing, via the
1699.Xr editline 3
1700library.
1701It is enabled with the
1702.Ic edit
1703command, and is enabled by default if input is from a tty.
1704Previous lines can be recalled and edited with the arrow keys,
1705and other GNU Emacs-style editing keys may be used as well.
1706.Pp
1707The
1708.Xr editline 3
1709library is configured with a
1710.Pa .editrc
1711file \- refer to
1712.Xr editrc 5
1713for more information.
1714.Pp
1715An extra key binding is available to
1716.Nm
1717to provide context sensitive command and filename completion
1718(including remote file completion).
1719To use this, bind a key to the
1720.Xr editline 3
1721command
1722.Ic ftp-complete .
1723By default, this is bound to the TAB key.
1724.Sh ENVIRONMENT
1725.Nm
1726utilizes the following environment variables:
1727.Bl -tag -width "FTPSERVERPORT"
1728.It Ev FTPMODE
1729Overrides the default operation mode.
1730Recognized values are:
1731.Pp
1732.Bl -tag -width "passive  " -offset indent -compact
1733.It passive
1734passive mode FTP only
1735.It active
1736active mode FTP only
1737.It auto
1738automatic determination of passive or active (this is the default)
1739.It gate
1740gate-ftp mode
1741.El
1742.It Ev FTPSERVER
1743Host to use as gate-ftp server when
1744.Ic gate
1745is enabled.
1746.It Ev FTPSERVERPORT
1747Port to use when connecting to gate-ftp server when
1748.Ic gate
1749is enabled.
1750Default is port returned by a
1751.Fn getservbyname
1752lookup of
1753.Dq ftpgate/tcp .
1754.It Ev HOME
1755For default location of a
1756.Pa .netrc
1757file, if one exists.
1758.It Ev PAGER
1759Used by
1760.Ic page
1761to display files.
1762.It Ev SHELL
1763For default shell.
1764.It Ev ftp_proxy
1765URL of FTP proxy to use when making FTP URL requests
1766(if not defined, use the standard FTP protocol).
1767.It Ev http_proxy
1768URL of HTTP proxy to use when making HTTP or HTTPS URL requests.
1769.It Ev http_cookies
1770Path of a Netscape-like cookiejar file to use when making
1771HTTP or HTTPS URL requests.
1772.El
1773.Sh PORT ALLOCATION
1774For active mode data connections,
1775.Nm
1776will listen to a random high TCP port.
1777The interval of ports used are configurable using
1778.Xr sysctl 8
1779variables
1780.Va net.inet.ip.porthifirst
1781and
1782.Va net.inet.ip.porthilast .
1783.Sh SEE ALSO
1784.Xr basename 1 ,
1785.Xr csh 1 ,
1786.Xr more 1 ,
1787.Xr stty 1 ,
1788.Xr tar 1 ,
1789.Xr tftp 1 ,
1790.Xr editline 3 ,
1791.Xr getservbyname 3 ,
1792.Xr popen 3 ,
1793.Xr editrc 5 ,
1794.Xr services 5 ,
1795.Xr ftp-proxy 8 ,
1796.Xr ftpd 8
1797.Sh STANDARDS
1798.Rs
1799.%A J. Postel
1800.%A J. Reynolds
1801.%D October 1985
1802.%R RFC 959
1803.%T FILE TRANSFER PROTOCOL (FTP)
1804.Re
1805.Pp
1806.Rs
1807.%A P. Hethmon
1808.%D March 2007
1809.%R RFC 3659
1810.%T Extensions to FTP
1811.Re
1812.Sh HISTORY
1813The
1814.Nm
1815command appeared in
1816.Bx 4.2 .
1817.Sh BUGS
1818Correct execution of many commands depends upon proper behavior
1819by the remote server.
1820.Pp
1821In the recursive mode of
1822.Ic mget ,
1823files and directories starting with whitespace are ignored
1824because the list cannot be parsed any other way.
1825