Deleted Added
full compact
ftp.1 (223308) ftp.1 (223328)
1.\" $NetBSD: ftp.1,v 1.109 2005/02/20 20:54:01 wiz Exp $
1.\" $NetBSD: ftp.1,v 1.13 2009/11/15 10:12:37 lukem Exp $
2.\" from NetBSD: ftp.1,v 1.130 2009/07/11 18:35:48 joerg Exp
2.\"
3.\"
3.\" Copyright (c) 1996-2004 The NetBSD Foundation, Inc.
4.\" Copyright (c) 1996-2008 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Luke Mewburn.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution.
5.\" All rights reserved.
6.\"
7.\" This code is derived from software contributed to The NetBSD Foundation
8.\" by Luke Mewburn.
9.\"
10.\" Redistribution and use in source and binary forms, with or without
11.\" modification, are permitted provided that the following conditions
12.\" are met:
13.\" 1. Redistributions of source code must retain the above copyright
14.\" notice, this list of conditions and the following disclaimer.
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in the
17.\" documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\" must display the following acknowledgement:
19.\" This product includes software developed by the NetBSD
20.\" Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\" contributors may be used to endorse or promote products derived
23.\" from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS

--- 27 unchanged lines hidden (view full) ---

59.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63.\" SUCH DAMAGE.
64.\"
65.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
66.\"
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS

--- 27 unchanged lines hidden (view full) ---

53.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57.\" SUCH DAMAGE.
58.\"
59.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
60.\"
67.Dd January 15, 2005
61.Dd May 10, 2008
68.Dt FTP 1
69.Os
70.Sh NAME
71.Nm ftp
62.Dt FTP 1
63.Os
64.Sh NAME
65.Nm ftp
72.Nd
73Internet file transfer program
66.Nd Internet file transfer program
74.Sh SYNOPSIS
75.Nm
67.Sh SYNOPSIS
68.Nm
76.Op Fl 46AadefginpRtvV
69.Op Fl 46AadefginpRtVv
77.Bk -words
78.Op Fl N Ar netrc
79.Ek
80.Bk -words
81.Op Fl o Ar output
82.Ek
83.Bk -words
84.Op Fl P Ar port
85.Ek
86.Bk -words
87.Op Fl q Ar quittime
88.Ek
89.Bk -words
90.Op Fl r Ar retry
91.Ek
70.Bk -words
71.Op Fl N Ar netrc
72.Ek
73.Bk -words
74.Op Fl o Ar output
75.Ek
76.Bk -words
77.Op Fl P Ar port
78.Ek
79.Bk -words
80.Op Fl q Ar quittime
81.Ek
82.Bk -words
83.Op Fl r Ar retry
84.Ek
85.Op Fl s Ar srcaddr
92.Bk -words
93.\" [-T dir,max[,inc]]
94.Oo
95.Fl T Xo
96.Sm off
97.Ar dir ,
98.Ar max
99.Op , Ar inc

--- 74 unchanged lines hidden (view full) ---

174protocols, or by direct copying, into the current directory.
175This is ideal for scripts.
176Refer to
177.Sx AUTO-FETCHING FILES
178below for more information.
179.Pp
180Options may be specified at the command line, or to the
181command interpreter.
86.Bk -words
87.\" [-T dir,max[,inc]]
88.Oo
89.Fl T Xo
90.Sm off
91.Ar dir ,
92.Ar max
93.Op , Ar inc

--- 74 unchanged lines hidden (view full) ---

168protocols, or by direct copying, into the current directory.
169This is ideal for scripts.
170Refer to
171.Sx AUTO-FETCHING FILES
172below for more information.
173.Pp
174Options may be specified at the command line, or to the
175command interpreter.
182.Bl -tag -width "port "
176.Bl -tag -width Fl
183.It Fl 4
184Forces
185.Nm
186to only use IPv4 addresses.
187.It Fl 6
188Forces
189.Nm
190to only use IPv6 addresses.

--- 23 unchanged lines hidden (view full) ---

214or
215.Tn HTTP
216proxies.
217.It Fl g
218Disables file name globbing.
219.It Fl i
220Turns off interactive prompting during
221multiple file transfers.
177.It Fl 4
178Forces
179.Nm
180to only use IPv4 addresses.
181.It Fl 6
182Forces
183.Nm
184to only use IPv6 addresses.

--- 23 unchanged lines hidden (view full) ---

208or
209.Tn HTTP
210proxies.
211.It Fl g
212Disables file name globbing.
213.It Fl i
214Turns off interactive prompting during
215multiple file transfers.
216.It Fl N Ar netrc
217Use
218.Ar netrc
219instead of
220.Pa ~/.netrc .
221Refer to
222.Sx THE .netrc FILE
223for more information.
222.It Fl n
223Restrains
224.Nm
225from attempting
226.Dq auto-login
227upon initial connection for non auto-fetch transfers.
228If auto-login is enabled,
229.Nm
230will check the
231.Pa .netrc
232(see below) file in the user's home directory for an entry describing
233an account on the remote machine.
234If no entry exists,
235.Nm
236will prompt for the remote machine login name (default is the user
237identity on the local machine), and, if necessary, prompt for a password
238and an account with which to login.
239To override the auto-login for auto-fetch transfers, specify the
240username (and optionally, password) as appropriate.
224.It Fl n
225Restrains
226.Nm
227from attempting
228.Dq auto-login
229upon initial connection for non auto-fetch transfers.
230If auto-login is enabled,
231.Nm
232will check the
233.Pa .netrc
234(see below) file in the user's home directory for an entry describing
235an account on the remote machine.
236If no entry exists,
237.Nm
238will prompt for the remote machine login name (default is the user
239identity on the local machine), and, if necessary, prompt for a password
240and an account with which to login.
241To override the auto-login for auto-fetch transfers, specify the
242username (and optionally, password) as appropriate.
241.It Fl N Ar netrc
242Use
243.Ar netrc
244instead of
245.Pa ~/.netrc .
246Refer to
247.Sx THE .netrc FILE
248for more information.
249.It Fl o Ar output
250When auto-fetching files, save the contents in
251.Ar output .
252.Ar output
253is parsed according to the
254.Sx FILE NAMING CONVENTIONS
255below.
256If
257.Ar output
258is not
259.Sq -
260or doesn't start with
261.Sq \&| ,
262then only the first file specified will be retrieved into
263.Ar output ;
264all other files will be retrieved into the basename of their
265remote name.
243.It Fl o Ar output
244When auto-fetching files, save the contents in
245.Ar output .
246.Ar output
247is parsed according to the
248.Sx FILE NAMING CONVENTIONS
249below.
250If
251.Ar output
252is not
253.Sq -
254or doesn't start with
255.Sq \&| ,
256then only the first file specified will be retrieved into
257.Ar output ;
258all other files will be retrieved into the basename of their
259remote name.
260.It Fl P Ar port
261Sets the port number to
262.Ar port .
266.It Fl p
267Enable passive mode operation for use behind connection filtering firewalls.
268This option has been deprecated as
269.Nm
270now tries to use passive mode by default, falling back to active mode
271if the server does not support passive connections.
263.It Fl p
264Enable passive mode operation for use behind connection filtering firewalls.
265This option has been deprecated as
266.Nm
267now tries to use passive mode by default, falling back to active mode
268if the server does not support passive connections.
272.It Fl P Ar port
273Sets the port number to
274.Ar port .
275.It Fl r Ar wait
276Retry the connection attempt if it failed, pausing for
277.Ar wait
278seconds.
279.It Fl q Ar quittime
280Quit if the connection has stalled for
281.Ar quittime
282seconds.
283.It Fl R
284Restart all non-proxied auto-fetches.
269.It Fl q Ar quittime
270Quit if the connection has stalled for
271.Ar quittime
272seconds.
273.It Fl R
274Restart all non-proxied auto-fetches.
275.It Fl r Ar wait
276Retry the connection attempt if it failed, pausing for
277.Ar wait
278seconds.
279.It Fl s Ar srcaddr
280Uses
281.Ar srcaddr
282as the local IP address for all connections.
285.It Fl t
286Enables packet tracing.
283.It Fl t
284Enables packet tracing.
287.It Xo
288.Fl T
289.Sm off
290.Ar direction ,
291.Ar maximum
292.Op , Ar increment
293.Sm on
294.Xc
285.It Fl T Ar direction Ns , Ns Ar maximum Ns Oo , Ns Ar increment Oc
295Set the maximum transfer rate for
296.Ar direction
297to
298.Ar maximum
299bytes/second,
300and if specified, the increment to
301.Ar increment
302bytes/second.

--- 4 unchanged lines hidden (view full) ---

307Upload files on the command line to
308.Ar URL
309where
310.Ar URL
311is one of the ftp URL types as supported by auto-fetch
312(with an optional target filename for single file uploads), and
313.Ar file
314is one or more local files to be uploaded.
286Set the maximum transfer rate for
287.Ar direction
288to
289.Ar maximum
290bytes/second,
291and if specified, the increment to
292.Ar increment
293bytes/second.

--- 4 unchanged lines hidden (view full) ---

298Upload files on the command line to
299.Ar URL
300where
301.Ar URL
302is one of the ftp URL types as supported by auto-fetch
303(with an optional target filename for single file uploads), and
304.Ar file
305is one or more local files to be uploaded.
306.It Fl V
307Disable
308.Ic verbose
309and
310.Ic progress ,
311overriding the default of enabled when output is to a terminal.
315.It Fl v
316Enable
317.Ic verbose
318and
319.Ic progress .
320This is the default if output is to a terminal (and in the case of
321.Ic progress ,
322.Nm
323is the foreground process).
324Forces
325.Nm
326to show all responses from the remote server, as well
327as report on data transfer statistics.
312.It Fl v
313Enable
314.Ic verbose
315and
316.Ic progress .
317This is the default if output is to a terminal (and in the case of
318.Ic progress ,
319.Nm
320is the foreground process).
321Forces
322.Nm
323to show all responses from the remote server, as well
324as report on data transfer statistics.
328.It Fl V
329Disable
330.Ic verbose
331and
332.Ic progress ,
333overriding the default of enabled when output is to a terminal.
334.El
335.Pp
336The client host with which
337.Nm
338is to communicate may be specified on the command line.
339If this is done,
340.Nm
341will immediately attempt to establish a connection to an

--- 4 unchanged lines hidden (view full) ---

346from the user.
347When
348.Nm
349is awaiting commands from the user the prompt
350.Ql ftp\*[Gt]
351is provided to the user.
352The following commands are recognized
353by
325.El
326.Pp
327The client host with which
328.Nm
329is to communicate may be specified on the command line.
330If this is done,
331.Nm
332will immediately attempt to establish a connection to an

--- 4 unchanged lines hidden (view full) ---

337from the user.
338When
339.Nm
340is awaiting commands from the user the prompt
341.Ql ftp\*[Gt]
342is provided to the user.
343The following commands are recognized
344by
354.Nm ftp :
355.Bl -tag -width Fl
345.Nm ftp :
346.Bl -tag -width Ic
356.It Ic \&! Op Ar command Op Ar args
357Invoke an interactive shell on the local machine.
358If there are arguments, the first is taken to be a command to execute
359directly, with the rest of the arguments as its arguments.
360.It Ic \&$ Ar macro-name Op Ar args
361Execute the macro
362.Ar macro-name
363that was defined with the

--- 86 unchanged lines hidden (view full) ---

450delimiter.
451Records on
452.Pf non\- Ns Ux
453remote systems may contain single linefeeds;
454when an ascii type transfer is made, these linefeeds may be
455distinguished from a record delimiter only when
456.Ic \&cr
457is off.
347.It Ic \&! Op Ar command Op Ar args
348Invoke an interactive shell on the local machine.
349If there are arguments, the first is taken to be a command to execute
350directly, with the rest of the arguments as its arguments.
351.It Ic \&$ Ar macro-name Op Ar args
352Execute the macro
353.Ar macro-name
354that was defined with the

--- 86 unchanged lines hidden (view full) ---

441delimiter.
442Records on
443.Pf non\- Ns Ux
444remote systems may contain single linefeeds;
445when an ascii type transfer is made, these linefeeds may be
446distinguished from a record delimiter only when
447.Ic \&cr
448is off.
458.It Ic debug Op Ar debug-value
459Toggle debugging mode.
460If an optional
461.Ar debug-value
462is specified it is used to set the debugging level.
463When debugging is on,
464.Nm
465prints each command sent to the remote machine, preceded
466by the string
467.Ql \-\-\*[Gt]
468.It Ic delete Ar remote-file
469Delete the file
470.Ar remote-file
471on the remote machine.
472.It Ic dir Op Ar remote-path Op Ar local-file
473Print a listing of the contents of a
474directory on the remote machine.
475The listing includes any system-dependent information that the server

--- 19 unchanged lines hidden (view full) ---

495.It Ic disconnect
496A synonym for
497.Ic close .
498.It Ic edit
499Toggle command line editing, and context sensitive command and file
500completion.
501This is automatically enabled if input is from a terminal, and
502disabled otherwise.
449.It Ic delete Ar remote-file
450Delete the file
451.Ar remote-file
452on the remote machine.
453.It Ic dir Op Ar remote-path Op Ar local-file
454Print a listing of the contents of a
455directory on the remote machine.
456The listing includes any system-dependent information that the server

--- 19 unchanged lines hidden (view full) ---

476.It Ic disconnect
477A synonym for
478.Ic close .
479.It Ic edit
480Toggle command line editing, and context sensitive command and file
481completion.
482This is automatically enabled if input is from a terminal, and
483disabled otherwise.
503.It Ic epsv4
484.It Ic epsv epsv4 epsv6
504Toggle the use of the extended
505.Dv EPSV
506and
507.Dv EPRT
485Toggle the use of the extended
486.Dv EPSV
487and
488.Dv EPRT
508commands on IPv4 connections; first try
489commands on all IP, IPv4, and IPv6 connections respectively.
490First try
509.Dv EPSV /
510.Dv EPRT ,
511and then
512.Dv PASV /
513.Dv PORT .
514This is enabled by default.
515If an extended command fails then this option will be temporarily
516disabled for the duration of the current connection, or until
491.Dv EPSV /
492.Dv EPRT ,
493and then
494.Dv PASV /
495.Dv PORT .
496This is enabled by default.
497If an extended command fails then this option will be temporarily
498disabled for the duration of the current connection, or until
517.Ic epsv4
499.Ic epsv ,
500.Ic epsv4 ,
501or
502.Ic epsv6
518is executed again.
519.It Ic exit
520A synonym for
521.Ic bye .
522.It Ic features
523Display what features the remote server supports (using the
524.Dv FEAT
525command).

--- 7 unchanged lines hidden (view full) ---

533to
534.Ar format .
535The default (and only supported)
536format is
537.Dq non-print .
538.It Ic ftp Ar host Op Ar port
539A synonym for
540.Ic open .
503is executed again.
504.It Ic exit
505A synonym for
506.Ic bye .
507.It Ic features
508Display what features the remote server supports (using the
509.Dv FEAT
510command).

--- 7 unchanged lines hidden (view full) ---

518to
519.Ar format .
520The default (and only supported)
521format is
522.Dq non-print .
523.It Ic ftp Ar host Op Ar port
524A synonym for
525.Ic open .
526.It Ic ftp_debug Op Ar ftp_debug-value
527Toggle debugging mode.
528If an optional
529.Ar ftp_debug-value
530is specified it is used to set the debugging level.
531When debugging is on,
532.Nm
533prints each command sent to the remote machine, preceded
534by the string
535.Ql \-\-\*[Gt] .
541.It Ic gate Op Ar host Op Ar port
542Toggle gate-ftp mode, which used to connect through the
543TIS FWTK and Gauntlet ftp proxies.
544This will not be permitted if the gate-ftp server hasn't been set
545(either explicitly by the user, or from the
546.Ev FTPSERVER
547environment variable).
548If

--- 59 unchanged lines hidden (view full) ---

608.Ic mreget
609are not meant to transfer
610entire directory subtrees of files.
611That can be done by
612transferring a
613.Xr tar 1
614archive of the subtree (in binary mode).
615.It Ic hash Op Ar size
536.It Ic gate Op Ar host Op Ar port
537Toggle gate-ftp mode, which used to connect through the
538TIS FWTK and Gauntlet ftp proxies.
539This will not be permitted if the gate-ftp server hasn't been set
540(either explicitly by the user, or from the
541.Ev FTPSERVER
542environment variable).
543If

--- 59 unchanged lines hidden (view full) ---

603.Ic mreget
604are not meant to transfer
605entire directory subtrees of files.
606That can be done by
607transferring a
608.Xr tar 1
609archive of the subtree (in binary mode).
610.It Ic hash Op Ar size
616Toggle hash-sign (``#'') printing for each data block
617transferred.
611Toggle hash-sign
612.Pq Sq #
613printing for each data block transferred.
618The size of a data block defaults to 1024 bytes.
619This can be changed by specifying
620.Ar size
621in bytes.
622Enabling
623.Ic hash
624disables
625.Ic progress .

--- 32 unchanged lines hidden (view full) ---

658Print the working directory on the local machine.
659.It Ic \&ls Op Ar remote-path Op Ar local-file
660A synonym for
661.Ic dir .
662.It Ic macdef Ar macro-name
663Define a macro.
664Subsequent lines are stored as the macro
665.Ar macro-name ;
614The size of a data block defaults to 1024 bytes.
615This can be changed by specifying
616.Ar size
617in bytes.
618Enabling
619.Ic hash
620disables
621.Ic progress .

--- 32 unchanged lines hidden (view full) ---

654Print the working directory on the local machine.
655.It Ic \&ls Op Ar remote-path Op Ar local-file
656A synonym for
657.Ic dir .
658.It Ic macdef Ar macro-name
659Define a macro.
660Subsequent lines are stored as the macro
661.Ar macro-name ;
666a null line (consecutive newline characters
667in a file or
668carriage returns from the terminal) terminates macro input mode.
662a null line (consecutive newline characters in a file or carriage
663returns from the terminal) terminates macro input mode.
669There is a limit of 16 macros and 4096 total characters in all
670defined macros.
664There is a limit of 16 macros and 4096 total characters in all
665defined macros.
671Macros remain defined until a
666Macro names can be a maximum of 8 characters.
667Macros are only applicable to the current session they are
668defined within (or if defined outside a session, to the session
669invoked with the next
670.Ic open
671command), and remain defined until a
672.Ic close
673command is executed.
672.Ic close
673command is executed.
674The macro processor interprets `$' and `\e' as special characters.
675A `$' followed by a number (or numbers) is replaced by the
674To invoke a macro, use the
675.Ic $
676command (see above).
677.Pp
678The macro processor interprets
679.Sq $
680and
681.Sq \e
682as special characters.
683A
684.Sq $
685followed by a number (or numbers) is replaced by the
676corresponding argument on the macro invocation command line.
686corresponding argument on the macro invocation command line.
677A `$' followed by an `i' signals that macro processor that the
678executing macro is to be looped.
679On the first pass `$i' is
680replaced by the first argument on the macro invocation command line,
681on the second pass it is replaced by the second argument, and so on.
682A `\e' followed by any character is replaced by that character.
683Use the `\e' to prevent special treatment of the `$'.
687A
688.Sq $
689followed by an
690.Sq i
691signals the macro processor that the executing macro is to be
692looped.
693On the first pass
694.Dq $i
695is replaced by the first argument on the macro invocation command
696line, on the second pass it is replaced by the second argument,
697and so on.
698A
699.Sq \e
700followed by any character is replaced by that character.
701Use the
702.Sq \e
703to prevent special treatment of the
704.Sq $ .
684.It Ic mdelete Op Ar remote-files
685Delete the
686.Ar remote-files
687on the remote machine.
688.It Ic mdir Ar remote-files local-file
689Like
690.Ic dir ,
691except multiple remote files may be specified.

--- 59 unchanged lines hidden (view full) ---

751Set the file transfer
752.Ic mode
753to
754.Ar mode-name .
755The default (and only supported)
756mode is
757.Dq stream .
758.It Ic modtime Ar remote-file
705.It Ic mdelete Op Ar remote-files
706Delete the
707.Ar remote-files
708on the remote machine.
709.It Ic mdir Ar remote-files local-file
710Like
711.Ic dir ,
712except multiple remote files may be specified.

--- 59 unchanged lines hidden (view full) ---

772Set the file transfer
773.Ic mode
774to
775.Ar mode-name .
776The default (and only supported)
777mode is
778.Dq stream .
779.It Ic modtime Ar remote-file
759Show the last modification time of the file on the remote machine.
780Show the last modification time of the file on the remote machine, in
781.Li RFC2822
782format.
760.It Ic more Ar file
761A synonym for
762.Ic page .
763.It Ic mput Ar local-files
764Expand wild cards in the list of local files given as arguments
765and do a
766.Ic put
767for each file in the resulting list.

--- 50 unchanged lines hidden (view full) ---

818.Op Ar Inpattern
819is a template for incoming filenames (which may have already been
820processed according to the
821.Ic ntrans
822and
823.Ic case
824settings).
825Variable templating is accomplished by including the
783.It Ic more Ar file
784A synonym for
785.Ic page .
786.It Ic mput Ar local-files
787Expand wild cards in the list of local files given as arguments
788and do a
789.Ic put
790for each file in the resulting list.

--- 50 unchanged lines hidden (view full) ---

841.Op Ar Inpattern
842is a template for incoming filenames (which may have already been
843processed according to the
844.Ic ntrans
845and
846.Ic case
847settings).
848Variable templating is accomplished by including the
826sequences `$1', `$2', ..., `$9' in
849sequences
850.Dq $1 ,
851.Dq $2 ,
852\&...
853.Dq $9
854in
827.Ar inpattern .
855.Ar inpattern .
828Use `\\' to prevent this special treatment of the `$' character.
856Use
857.Sq \e
858to prevent this special treatment of the
859.Sq $
860character.
829All other characters are treated literally, and are used to determine the
830.Ic nmap
831.Op Ar inpattern
832variable values.
833For example, given
834.Ar inpattern
835$1.$2 and the remote file name "mydata.data", $1 would have the value
836"mydata", and $2 would have the value "data".
837The
838.Ar outpattern
839determines the resulting mapped filename.
861All other characters are treated literally, and are used to determine the
862.Ic nmap
863.Op Ar inpattern
864variable values.
865For example, given
866.Ar inpattern
867$1.$2 and the remote file name "mydata.data", $1 would have the value
868"mydata", and $2 would have the value "data".
869The
870.Ar outpattern
871determines the resulting mapped filename.
840The sequences `$1', `$2', ...., `$9' are replaced by any value resulting
841from the
872The sequences
873.Dq $1 ,
874.Dq $2 ,
875\&...
876.Dq $9
877are replaced by any value resulting from the
842.Ar inpattern
843template.
878.Ar inpattern
879template.
844The sequence `$0' is replace by the original filename.
880The sequence
881.Dq $0
882is replaced by the original filename.
845Additionally, the sequence
883Additionally, the sequence
846.Ql Op Ar seq1 , Ar seq2
884.Dq Op Ar seq1 , Ar seq2
847is replaced by
848.Op Ar seq1
849if
850.Ar seq1
851is not a null string; otherwise it is replaced by
852.Ar seq2 .
853For example, the command
854.Pp
855.Bd -literal -offset indent -compact
856nmap $1.$2.$3 [$1,$2].[$2,file]
857.Ed
858.Pp
859would yield
860the output filename "myfile.data" for input filenames "myfile.data" and
861"myfile.data.old", "myfile.file" for the input filename "myfile", and
862"myfile.myfile" for the input filename ".myfile".
863Spaces may be included in
864.Ar outpattern ,
885is replaced by
886.Op Ar seq1
887if
888.Ar seq1
889is not a null string; otherwise it is replaced by
890.Ar seq2 .
891For example, the command
892.Pp
893.Bd -literal -offset indent -compact
894nmap $1.$2.$3 [$1,$2].[$2,file]
895.Ed
896.Pp
897would yield
898the output filename "myfile.data" for input filenames "myfile.data" and
899"myfile.data.old", "myfile.file" for the input filename "myfile", and
900"myfile.myfile" for the input filename ".myfile".
901Spaces may be included in
902.Ar outpattern ,
865as in the example: `nmap $1 sed "s/ *$//" \*[Gt] $1' .
866Use the `\e' character to prevent special treatment
867of the `$','[',']', and `,' characters.
903as in the example:
904.Dl nmap $1 sed "s/ *$//" \*[Gt] $1
905Use the
906.Sq \e
907character to prevent special treatment
908of the
909.Sq $ ,
910.Sq \&[ ,
911.Sq \&] ,
912and
913.Sq \&,
914characters.
868.It Ic ntrans Op Ar inchars Op Ar outchars
869Set or unset the filename character translation mechanism.
870If no arguments are specified, the filename character
871translation mechanism is unset.
872If arguments are specified, characters in
873remote filenames are translated during
874.Ic mput
875commands and

--- 71 unchanged lines hidden (view full) ---

947.Nm
948through a gateway router or host that controls the directionality of
949traffic.
950(Note that though
951.Tn FTP
952servers are required to support the
953.Dv PASV
954command by
915.It Ic ntrans Op Ar inchars Op Ar outchars
916Set or unset the filename character translation mechanism.
917If no arguments are specified, the filename character
918translation mechanism is unset.
919If arguments are specified, characters in
920remote filenames are translated during
921.Ic mput
922commands and

--- 71 unchanged lines hidden (view full) ---

994.Nm
995through a gateway router or host that controls the directionality of
996traffic.
997(Note that though
998.Tn FTP
999servers are required to support the
1000.Dv PASV
1001command by
955.Li RFC 1123 ,
1002.Li RFC1123 ,
956some do not.)
957.It Ic pdir Op Ar remote-path
958Perform
959.Ic dir
960.Op Ar remote-path ,
961and display the result with the program specified by the
962.Ic "set pager"
963option.

--- 131 unchanged lines hidden (view full) ---

1095machine.
1096.It Ic quit
1097A synonym for
1098.Ic bye .
1099.It Ic quote Ar arg1 arg2 ...
1100The arguments specified are sent, verbatim, to the remote
1101.Tn FTP
1102server.
1003some do not.)
1004.It Ic pdir Op Ar remote-path
1005Perform
1006.Ic dir
1007.Op Ar remote-path ,
1008and display the result with the program specified by the
1009.Ic "set pager"
1010option.

--- 131 unchanged lines hidden (view full) ---

1142machine.
1143.It Ic quit
1144A synonym for
1145.Ic bye .
1146.It Ic quote Ar arg1 arg2 ...
1147The arguments specified are sent, verbatim, to the remote
1148.Tn FTP
1149server.
1103.It Xo
1104.Ic rate Ar direction
1105.Op Ar maximum Op Ar increment
1106.Xc
1150.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc
1107Throttle the maximum transfer rate to
1108.Ar maximum
1109bytes/second.
1110If
1111.Ar maximum
1112is 0, disable the throttle.
1113.Pp
1114.Ar direction

--- 6 unchanged lines hidden (view full) ---

1121.It Cm put
1122Outgoing transfers.
1123.El
1124.Pp
1125.Ar maximum
1126can be modified on the fly by
1127.Ar increment
1128bytes (default: 1024) each time a given signal is received:
1151Throttle the maximum transfer rate to
1152.Ar maximum
1153bytes/second.
1154If
1155.Ar maximum
1156is 0, disable the throttle.
1157.Pp
1158.Ar direction

--- 6 unchanged lines hidden (view full) ---

1165.It Cm put
1166Outgoing transfers.
1167.El
1168.Pp
1169.Ar maximum
1170can be modified on the fly by
1171.Ar increment
1172bytes (default: 1024) each time a given signal is received:
1129.B
1130.Bl -tag -width "SIGUSR1" -offset indent
1131.It Dv SIGUSR1
1132Increment
1133.Ar maximum
1134by
1135.Ar increment
1136bytes.
1137.It Dv SIGUSR2

--- 245 unchanged lines hidden (view full) ---

1383Unset
1384.Ar option .
1385Refer to
1386.Ic set
1387for more information.
1388.It Ic usage Ar command
1389Print the usage message for
1390.Ar command .
1173.Bl -tag -width "SIGUSR1" -offset indent
1174.It Dv SIGUSR1
1175Increment
1176.Ar maximum
1177by
1178.Ar increment
1179bytes.
1180.It Dv SIGUSR2

--- 245 unchanged lines hidden (view full) ---

1426Unset
1427.Ar option .
1428Refer to
1429.Ic set
1430for more information.
1431.It Ic usage Ar command
1432Print the usage message for
1433.Ar command .
1391.It Xo
1392.Ic user Ar user-name
1393.Op Ar password Op Ar account
1394.Xc
1434.It Ic user Ar user-name Oo Ar password Oo Ar account Oc Oc
1395Identify yourself to the remote
1396.Tn FTP
1397server.
1398If the
1399.Ar password
1400is not specified and the server requires it,
1401.Nm
1402will prompt the user for it (after disabling local echo).

--- 31 unchanged lines hidden (view full) ---

1434Set the size of the socket send and receive buffers to
1435.Ar size .
1436.It Ic \&? Op Ar command
1437A synonym for
1438.Ic help .
1439.El
1440.Pp
1441Command arguments which have embedded spaces may be quoted with
1435Identify yourself to the remote
1436.Tn FTP
1437server.
1438If the
1439.Ar password
1440is not specified and the server requires it,
1441.Nm
1442will prompt the user for it (after disabling local echo).

--- 31 unchanged lines hidden (view full) ---

1474Set the size of the socket send and receive buffers to
1475.Ar size .
1476.It Ic \&? Op Ar command
1477A synonym for
1478.Ic help .
1479.El
1480.Pp
1481Command arguments which have embedded spaces may be quoted with
1442quote `"' marks.
1482quote
1483.Sq \&"
1484marks.
1443.Pp
1444Commands which toggle settings can take an explicit
1445.Ic on
1446or
1447.Ic off
1448argument to force the setting appropriately.
1449.Pp
1450Commands which take a byte count as an argument

--- 35 unchanged lines hidden (view full) ---

1486.Nm
1487supports an auto-fetch feature.
1488To enable auto-fetch, simply pass the list of hostnames/files
1489on the command line.
1490.Pp
1491The following formats are valid syntax for an auto-fetch element:
1492.Bl -tag -width "FOO "
1493.\" [user@]host:[path][/]
1485.Pp
1486Commands which toggle settings can take an explicit
1487.Ic on
1488or
1489.Ic off
1490argument to force the setting appropriately.
1491.Pp
1492Commands which take a byte count as an argument

--- 35 unchanged lines hidden (view full) ---

1528.Nm
1529supports an auto-fetch feature.
1530To enable auto-fetch, simply pass the list of hostnames/files
1531on the command line.
1532.Pp
1533The following formats are valid syntax for an auto-fetch element:
1534.Bl -tag -width "FOO "
1535.\" [user@]host:[path][/]
1494.It Xo
1495.Sm off
1496.Op Ar user Li \&@
1497.Ar host Li \&:
1498.Op Ar path
1499.Op Li /
1500.Sm on
1501.Xc
1536.It Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Li \&: Ns Oo Ar path Oc \
1537Ns Oo Li / Oc
1502.Dq Classic
1503.Tn FTP
1504format.
1505.Pp
1506If
1507.Ar path
1508contains a glob character and globbing is enabled,
1509(see

--- 8 unchanged lines hidden (view full) ---

1518it is stored locally with the name basename (see
1519.Xr basename 1 )
1520of
1521.Ic path ,
1522in the current directory.
1523Otherwise, the full remote name is used as the local name,
1524relative to the local root directory.
1525.\" ftp://[user[:password]@]host[:port]/path[/][;type=X]
1538.Dq Classic
1539.Tn FTP
1540format.
1541.Pp
1542If
1543.Ar path
1544contains a glob character and globbing is enabled,
1545(see

--- 8 unchanged lines hidden (view full) ---

1554it is stored locally with the name basename (see
1555.Xr basename 1 )
1556of
1557.Ic path ,
1558in the current directory.
1559Otherwise, the full remote name is used as the local name,
1560relative to the local root directory.
1561.\" ftp://[user[:password]@]host[:port]/path[/][;type=X]
1526.It Xo
1527.Sm off
1528.Li ftp://
1529.Oo Ar user
1530.Op Li \&: Ar password
1531.Li \&@ Oc
1532.Ar host Oo Li \&: Ar port Oc
1533.Li / Ar path
1534.Op Li /
1535.Op Li ;type= Ar X
1536.Sm on
1537.Xc
1562.It Li ftp:// Ns Oo Ar user Ns Oo Ns Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1563Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path Ns Oo Li / Oc \
1564Ns Oo Li ;type= Ns Ar X Oc
1538An
1539.Tn FTP
1540URL, retrieved using the
1541.Tn FTP
1542protocol if
1543.Ic "set ftp_proxy"
1544isn't defined.
1545Otherwise, transfer the URL using

--- 14 unchanged lines hidden (view full) ---

1560.Sq ;type=A
1561or
1562.Sq ;type=I
1563is supplied, then the transfer type will take place as
1564ascii or binary (respectively).
1565The default transfer type is binary.
1566.Pp
1567In order to be compliant with
1565An
1566.Tn FTP
1567URL, retrieved using the
1568.Tn FTP
1569protocol if
1570.Ic "set ftp_proxy"
1571isn't defined.
1572Otherwise, transfer the URL using

--- 14 unchanged lines hidden (view full) ---

1587.Sq ;type=A
1588or
1589.Sq ;type=I
1590is supplied, then the transfer type will take place as
1591ascii or binary (respectively).
1592The default transfer type is binary.
1593.Pp
1594In order to be compliant with
1568.Li RFC 1738 ,
1595.Li RFC3986 ,
1569.Nm
1570interprets the
1571.Ar path
1572part of an
1573.Dq ftp://
1574auto-fetch URL as follows:
1575.Bl -bullet
1576.It

--- 36 unchanged lines hidden (view full) ---

1613.Ic cd
1614command without a directory name.
1615This is unlikely to be useful.
1616.It
1617Any
1618.Sq Li \&% Ns Ar XX
1619codes
1620(per
1596.Nm
1597interprets the
1598.Ar path
1599part of an
1600.Dq ftp://
1601auto-fetch URL as follows:
1602.Bl -bullet
1603.It

--- 36 unchanged lines hidden (view full) ---

1640.Ic cd
1641command without a directory name.
1642This is unlikely to be useful.
1643.It
1644Any
1645.Sq Li \&% Ns Ar XX
1646codes
1647(per
1621.Li RFC 1738 )
1648.Li RFC3986 )
1622within the path components are decoded, with
1623.Ar XX
1624representing a character code in hexadecimal.
1625This decoding takes place after the
1626.Ar path
1627has been split into components,
1628but before each component is used in the equivalent of a
1629.Ic cd

--- 70 unchanged lines hidden (view full) ---

1700.El
1701.It
1702You must have appropriate access permission for each of the
1703intermediate directories that is used in the equivalent of a
1704.Ic cd
1705command.
1706.El
1707.\" http://[user[:password]@]host[:port]/path
1649within the path components are decoded, with
1650.Ar XX
1651representing a character code in hexadecimal.
1652This decoding takes place after the
1653.Ar path
1654has been split into components,
1655but before each component is used in the equivalent of a
1656.Ic cd

--- 70 unchanged lines hidden (view full) ---

1727.El
1728.It
1729You must have appropriate access permission for each of the
1730intermediate directories that is used in the equivalent of a
1731.Ic cd
1732command.
1733.El
1734.\" http://[user[:password]@]host[:port]/path
1708.It Xo
1709.Sm off
1710.Li http://
1711.Oo Ar user
1712.Op Li \&: Ar password
1713.Li \&@ Oc
1714.Ar host Oo Li \&: Ar port Oc
1715.Li / Ar path
1716.Sm on
1717.Xc
1735.It Li http:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1736Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
1718An
1719.Tn HTTP
1720URL, retrieved using the
1721.Tn HTTP
1722protocol.
1723If
1724.Ic "set http_proxy"
1725is defined, it is used as a URL to an

--- 4 unchanged lines hidden (view full) ---

1730authorization is required to retrieve
1731.Ar path ,
1732and
1733.Sq user
1734(and optionally
1735.Sq password )
1736is in the URL, use them for the first attempt to authenticate.
1737.\" file:///path
1737An
1738.Tn HTTP
1739URL, retrieved using the
1740.Tn HTTP
1741protocol.
1742If
1743.Ic "set http_proxy"
1744is defined, it is used as a URL to an

--- 4 unchanged lines hidden (view full) ---

1749authorization is required to retrieve
1750.Ar path ,
1751and
1752.Sq user
1753(and optionally
1754.Sq password )
1755is in the URL, use them for the first attempt to authenticate.
1756.\" file:///path
1738.It Xo
1739.Sm off
1740.Li file:/// Ar path
1741.Sm on
1742.Xc
1757.It Li file:/// Ns Ar path
1743A local URL, copied from
1744.Pa / Ns Ar path
1745on the local host.
1758A local URL, copied from
1759.Pa / Ns Ar path
1760on the local host.
1761.\" about:
1762.It Li about: Ns Ar topic
1763Display information regarding
1764.Ar topic ;
1765no file is retrieved for this auto-fetched element.
1766Supported values include:
1767.Bl -tag -width "about:version"
1768.It Li about:ftp
1769Information about
1770.Nm ftp .
1771.It Li about:version
1772The version of
1773.Nm ftp .
1774Useful to provide when reporting problems.
1746.El
1775.El
1776.El
1747.Pp
1748Unless noted otherwise above, and
1749.Fl o Ar output
1750is not given, the file is stored in the current directory as the
1751.Xr basename 1
1752of
1753.Ar path .
1754Note that if a

--- 108 unchanged lines hidden (view full) ---

1863(stdin).
1864If the shell command includes spaces, the argument
1865must be quoted; e.g.
1866.Dq Qq Li \&| ls\ \-lt .
1867A particularly
1868useful example of this mechanism is:
1869.Dq Li dir \&"\&" \&|more .
1870.It
1777.Pp
1778Unless noted otherwise above, and
1779.Fl o Ar output
1780is not given, the file is stored in the current directory as the
1781.Xr basename 1
1782of
1783.Ar path .
1784Note that if a

--- 108 unchanged lines hidden (view full) ---

1893(stdin).
1894If the shell command includes spaces, the argument
1895must be quoted; e.g.
1896.Dq Qq Li \&| ls\ \-lt .
1897A particularly
1898useful example of this mechanism is:
1899.Dq Li dir \&"\&" \&|more .
1900.It
1871Failing the above checks, if ``globbing'' is enabled,
1872local file names are expanded
1873according to the rules used in the
1901Failing the above checks, if
1902.Dq globbing
1903is enabled, local file names are expanded according to the rules
1904used in the
1874.Xr csh 1 ;
1905.Xr csh 1 ;
1875c.f. the
1906see the
1876.Ic glob
1877command.
1878If the
1879.Nm
1880command expects a single local file (e.g.
1881.Ic put ) ,
1882only the first filename generated by the "globbing" operation is used.
1883.It

--- 149 unchanged lines hidden (view full) ---

2033.Nm
2034.Ic macdef
2035command functions.
2036A macro is defined with the specified name; its contents begin with the
2037next
2038.Pa .netrc
2039line and continue until a blank line (consecutive new-line
2040characters) is encountered.
1907.Ic glob
1908command.
1909If the
1910.Nm
1911command expects a single local file (e.g.
1912.Ic put ) ,
1913only the first filename generated by the "globbing" operation is used.
1914.It

--- 149 unchanged lines hidden (view full) ---

2064.Nm
2065.Ic macdef
2066command functions.
2067A macro is defined with the specified name; its contents begin with the
2068next
2069.Pa .netrc
2070line and continue until a blank line (consecutive new-line
2071characters) is encountered.
2072Like the other tokens in the
2073.Pa .netrc
2074file, a
2075.Ic macdef
2076is applicable only to the
2077.Ic machine
2078definition preceding it.
2079A
2080.Ic macdef
2081entry cannot be used by multiple
2082.Ic machine
2083definitions; rather, it must be defined following each
2084.Ic machine
2085it is intended to be used with.
2041If a macro named
2042.Ic init
2043is defined, it is automatically executed as the last step in the
2044auto-login process.
2045For example,
2046.Bd -literal -offset indent
2047default
2048macdef init

--- 46 unchanged lines hidden (view full) ---

2095command.
2096.Pp
2097The following formatting sequences are replaced by the given
2098information:
2099.Bl -tag -width "%% " -offset indent
2100.It Li \&%/
2101The current remote working directory.
2102.\" %c[[0]n], %.[[0]n]
2086If a macro named
2087.Ic init
2088is defined, it is automatically executed as the last step in the
2089auto-login process.
2090For example,
2091.Bd -literal -offset indent
2092default
2093macdef init

--- 46 unchanged lines hidden (view full) ---

2140command.
2141.Pp
2142The following formatting sequences are replaced by the given
2143information:
2144.Bl -tag -width "%% " -offset indent
2145.It Li \&%/
2146The current remote working directory.
2147.\" %c[[0]n], %.[[0]n]
2103.It Xo
2104.Sm off
2105.Li \&%c
2106.Op Oo Li 0 Oc Ar n Ns ,
2107.Li \&%.
2108.Op Oo Li 0 Oc Ar n
2109.Sm on
2110.Xc
2148.It \&%c Ns Oo Oo Li 0 Oc Ns Ar n Oc , Ns Li \&%. Ns Oo Oo Li 0 Oc Ns Ar n Oc
2111The trailing component of the current remote working directory, or
2112.Em n
2113trailing components if a digit
2114.Em n
2115is given.
2116If
2117.Em n
2118begins with

--- 124 unchanged lines hidden (view full) ---

2243If
2244.Dq unsafe
2245URL characters are required in the username or password
2246(for example
2247.Sq @
2248or
2249.Sq / ) ,
2250encode them with
2149The trailing component of the current remote working directory, or
2150.Em n
2151trailing components if a digit
2152.Em n
2153is given.
2154If
2155.Em n
2156begins with

--- 124 unchanged lines hidden (view full) ---

2281If
2282.Dq unsafe
2283URL characters are required in the username or password
2284(for example
2285.Sq @
2286or
2287.Sq / ) ,
2288encode them with
2251.Li RFC 1738
2289.Li RFC3986
2252.Sq Li \&% Ns Ar XX
2253encoding.
2254.Pp
2255Note that the use of a username and password in
2256.Ev ftp_proxy
2257and
2258.Ev http_proxy
2259may be incompatible with other programs that use it

--- 26 unchanged lines hidden (view full) ---

2286for an example of how to make this automatic.
2287.Sh SEE ALSO
2288.Xr getservbyname 3 ,
2289.Xr editrc 5 ,
2290.Xr services 5 ,
2291.Xr ftpd 8
2292.Sh STANDARDS
2293.Nm
2290.Sq Li \&% Ns Ar XX
2291encoding.
2292.Pp
2293Note that the use of a username and password in
2294.Ev ftp_proxy
2295and
2296.Ev http_proxy
2297may be incompatible with other programs that use it

--- 26 unchanged lines hidden (view full) ---

2324for an example of how to make this automatic.
2325.Sh SEE ALSO
2326.Xr getservbyname 3 ,
2327.Xr editrc 5 ,
2328.Xr services 5 ,
2329.Xr ftpd 8
2330.Sh STANDARDS
2331.Nm
2294attempts to be compliant with
2295.Li RFC 959 ,
2296.Li RFC 1123 ,
2297.Li RFC 1738 ,
2298.Li RFC 2068 ,
2299.Li RFC 2389 ,
2300.Li RFC 2428 ,
2301.Li RFC 2732 ,
2302and
2303.Cm draft-ietf-ftpext-mlst-11 .
2332attempts to be compliant with:
2333.Bl -tag -offset indent -width 8n
2334.It Li RFC0959
2335.Em File Transfer Protocol
2336.It Li RFC1123
2337.Em Requirements for Internet Hosts - Application and Support
2338.It Li RFC1635
2339.Em How to Use Anonymous FTP
2340.It Li RFC2389
2341.Em Feature negotiation mechanism for the File Transfer Protocol
2342.It Li RFC2428
2343.Em FTP Extensions for IPv6 and NATs
2344.It Li RFC2616
2345.Em Hypertext Transfer Protocol -- HTTP/1.1
2346.It Li RFC2822
2347.Em Internet Message Format
2348.It Li RFC3659
2349.Em Extensions to FTP
2350.It Li RFC3986
2351.Em Uniform Resource Identifier (URI)
2352.El
2304.Sh HISTORY
2305The
2306.Nm
2307command appeared in
2308.Bx 4.2 .
2309.Pp
2310Various features such as command line editing, context sensitive
2311command and file completion, dynamic progress bar, automatic

--- 46 unchanged lines hidden ---
2353.Sh HISTORY
2354The
2355.Nm
2356command appeared in
2357.Bx 4.2 .
2358.Pp
2359Various features such as command line editing, context sensitive
2360command and file completion, dynamic progress bar, automatic

--- 46 unchanged lines hidden ---