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