Wed Jul 15 17:36:38 2020 UTC ()
Do not use "[...]", just "..." is enough.

Conventionally the ellipsis already expresses optional repetition,
e.g. .Ar without arguments produces "file ...".


(uwe)
diff -r1.139 -r1.140 src/usr.bin/ftp/ftp.1

cvs diff -r1.139 -r1.140 src/usr.bin/ftp/ftp.1 (switch to unified diff)

--- src/usr.bin/ftp/ftp.1 2020/07/15 16:41:16 1.139
+++ src/usr.bin/ftp/ftp.1 2020/07/15 17:36:38 1.140
@@ -1,1285 +1,1284 @@ @@ -1,1285 +1,1284 @@
1.\" $NetBSD: ftp.1,v 1.139 2020/07/15 16:41:16 pgoyette Exp $ 1.\" $NetBSD: ftp.1,v 1.140 2020/07/15 17:36:38 uwe Exp $
2.\" 2.\"
3.\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc. 3.\" Copyright (c) 1996-2020 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation 6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Luke Mewburn. 7.\" by Luke Mewburn.
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in the 15.\" notice, this list of conditions and the following disclaimer in the
16.\" documentation and/or other materials provided with the distribution. 16.\" documentation and/or other materials provided with the distribution.
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE. 28.\" POSSIBILITY OF SUCH DAMAGE.
29.\" 29.\"
30.\" 30.\"
31.\" Copyright (c) 1985, 1989, 1990, 1993 31.\" Copyright (c) 1985, 1989, 1990, 1993
32.\" The Regents of the University of California. All rights reserved. 32.\" The Regents of the University of California. All rights reserved.
33.\" 33.\"
34.\" Redistribution and use in source and binary forms, with or without 34.\" Redistribution and use in source and binary forms, with or without
35.\" modification, are permitted provided that the following conditions 35.\" modification, are permitted provided that the following conditions
36.\" are met: 36.\" are met:
37.\" 1. Redistributions of source code must retain the above copyright 37.\" 1. Redistributions of source code must retain the above copyright
38.\" notice, this list of conditions and the following disclaimer. 38.\" notice, this list of conditions and the following disclaimer.
39.\" 2. Redistributions in binary form must reproduce the above copyright 39.\" 2. Redistributions in binary form must reproduce the above copyright
40.\" notice, this list of conditions and the following disclaimer in the 40.\" notice, this list of conditions and the following disclaimer in the
41.\" documentation and/or other materials provided with the distribution. 41.\" documentation and/or other materials provided with the distribution.
42.\" 3. Neither the name of the University nor the names of its contributors 42.\" 3. Neither the name of the University nor the names of its contributors
43.\" may be used to endorse or promote products derived from this software 43.\" may be used to endorse or promote products derived from this software
44.\" without specific prior written permission. 44.\" without specific prior written permission.
45.\" 45.\"
46.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 46.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
47.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 47.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
48.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 48.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
49.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 49.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
50.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 50.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
51.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 51.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
52.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 52.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
53.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 53.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
54.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 54.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
55.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 55.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
56.\" SUCH DAMAGE. 56.\" SUCH DAMAGE.
57.\" 57.\"
58.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 58.\" @(#)ftp.1 8.3 (Berkeley) 10/9/94
59.\" 59.\"
60.Dd July 15, 2020 60.Dd July 15, 2020
61.Dt FTP 1 61.Dt FTP 1
62.Os 62.Os
63.Sh NAME 63.Sh NAME
64.Nm ftp 64.Nm ftp
65.Nd Internet file transfer program 65.Nd Internet file transfer program
66.Sh SYNOPSIS 66.Sh SYNOPSIS
67.Nm 67.Nm
68.Op Fl 46AadefginpRtVv 68.Op Fl 46AadefginpRtVv
69.Op Fl N Ar netrc 69.Op Fl N Ar netrc
70.Op Fl o Ar output 70.Op Fl o Ar output
71.Op Fl P Ar port 71.Op Fl P Ar port
72.Op Fl q Ar quittime 72.Op Fl q Ar quittime
73.Op Fl r Ar retry 73.Op Fl r Ar retry
74.Op Fl s Ar srcaddr 74.Op Fl s Ar srcaddr
75.Bk -words 75.Bk -words
76.\" [-T dir,max[,inc]] 76.\" [-T dir,max[,inc]]
77.Oo 77.Oo
78.Fl T Xo 78.Fl T Xo
79.Sm off 79.Sm off
80.Ar dir , 80.Ar dir ,
81.Ar max 81.Ar max
82.Op , Ar inc 82.Op , Ar inc
83.Sm on 83.Sm on
84.Xc 84.Xc
85.Oc 85.Oc
86.Ek 86.Ek
87.Op Fl x Ar xfersize 87.Op Fl x Ar xfersize
88.Bk -words 88.Bk -words
89.\" [[user@]host [port]] 89.\" [[user@]host [port]]
90.Oo 90.Oo
91.Oo Ar user Ns Li \&@ Oc Ns Ar host Oo Ar port Oc 91.Oo Ar user Ns Li \&@ Oc Ns Ar host Oo Ar port Oc
92.Oc 92.Oc
93.Ek 93.Ek
94.Bk -words 94.Bk -words
95.\" [[user@]host:[path][/]] 95.\" [[user@]host:[path][/]]
96.Sm off 96.Sm off
97.Oo 97.Oo
98.Op Ar user Li \&@ 98.Op Ar user Li \&@
99.Ar host Li \&: 99.Ar host Li \&:
100.Op Ar path 100.Op Ar path
101.Op Li / 101.Op Li /
102.Oc 102.Oc
103.Sm on 103.Sm on
104.Ek 104.Ek
105.Bk -words 105.Bk -words
106.\" [file:///path] 106.\" [file:///path]
107.Sm off 107.Sm off
108.Oo 108.Oo
109.Li file:/// Ar path 109.Li file:/// Ar path
110.Oc 110.Oc
111.Sm on 111.Sm on
112.Ek 112.Ek
113.Bk -words 113.Bk -words
114.\" [ftp://[user[:password]@]host[:port]/path[/]] 114.\" [ftp://[user[:password]@]host[:port]/path[/]]
115.Sm off 115.Sm off
116.Oo 116.Oo
117.Li ftp:// 117.Li ftp://
118.Oo Ar user 118.Oo Ar user
119.Op Li \&: Ar password 119.Op Li \&: Ar password
120.Li \&@ Oc 120.Li \&@ Oc
121.Ar host Oo Li \&: Ar port Oc 121.Ar host Oo Li \&: Ar port Oc
122.Li / Ar path 122.Li / Ar path
123.Op Li / 123.Op Li /
124.Op Li ;type= Ar X 124.Op Li ;type= Ar X
125.Oc 125.Oc
126.Sm on 126.Sm on
127.Ek 127.Ek
128.Bk -words 128.Bk -words
129.\" [http://[user[:password]@]host[:port]/path] 129.\" [http://[user[:password]@]host[:port]/path]
130.Sm off 130.Sm off
131.Oo 131.Oo
132.Li http:// 132.Li http://
133.Oo Ar user 133.Oo Ar user
134.Op Li \&: Ar password 134.Op Li \&: Ar password
135.Li \&@ Oc 135.Li \&@ Oc
136.Ar host Oo Li \&: Ar port Oc 136.Ar host Oo Li \&: Ar port Oc
137.Li / Ar path 137.Li / Ar path
138.Oc 138.Oc
139.Sm on 139.Sm on
140.Ek 140.Ek
141.Op Ar \&.\&.\&. 141.Ar \&...
142.Nm 142.Nm
143.Bk -words 143.Bk -words
144.Fl u Ar url Ar file 144.Fl u Ar url Ar
145.Ek 145.Ek
146.Op Ar \&.\&.\&. 
147.Sh DESCRIPTION 146.Sh DESCRIPTION
148.Nm 147.Nm
149is the user interface to the Internet standard File Transfer Protocol. 148is the user interface to the Internet standard File Transfer Protocol.
150The program allows a user to transfer files to and from a 149The program allows a user to transfer files to and from a
151remote network site. 150remote network site.
152.Pp 151.Pp
153The last five arguments will fetch a file using the 152The last five arguments will fetch a file using the
154.Tn FTP 153.Tn FTP
155or 154or
156.Tn HTTP 155.Tn HTTP
157protocols, or by direct copying, into the current directory. 156protocols, or by direct copying, into the current directory.
158This is ideal for scripts. 157This is ideal for scripts.
159Refer to 158Refer to
160.Sx AUTO-FETCHING FILES 159.Sx AUTO-FETCHING FILES
161below for more information. 160below for more information.
162.Pp 161.Pp
163Options may be specified at the command line, or to the 162Options may be specified at the command line, or to the
164command interpreter. 163command interpreter.
165.Bl -tag -width Fl 164.Bl -tag -width Fl
166.It Fl 4 165.It Fl 4
167Forces 166Forces
168.Nm 167.Nm
169to only use IPv4 addresses. 168to only use IPv4 addresses.
170.It Fl 6 169.It Fl 6
171Forces 170Forces
172.Nm 171.Nm
173to only use IPv6 addresses. 172to only use IPv6 addresses.
174.It Fl A 173.It Fl A
175Force active mode ftp. 174Force active mode ftp.
176By default, 175By default,
177.Nm 176.Nm
178will try to use passive mode ftp and fall back to active mode 177will try to use passive mode ftp and fall back to active mode
179if passive is not supported by the server. 178if passive is not supported by the server.
180This option causes 179This option causes
181.Nm 180.Nm
182to always use an active connection. 181to always use an active connection.
183It is only useful for connecting to very old servers that do not 182It is only useful for connecting to very old servers that do not
184implement passive mode properly. 183implement passive mode properly.
185.It Fl a 184.It Fl a
186Causes 185Causes
187.Nm 186.Nm
188to bypass normal login procedure, and use an anonymous login instead. 187to bypass normal login procedure, and use an anonymous login instead.
189.It Fl d 188.It Fl d
190Enables debugging. 189Enables debugging.
191.It Fl e 190.It Fl e
192Disables command line editing. 191Disables command line editing.
193This is useful for Emacs ange-ftp mode. 192This is useful for Emacs ange-ftp mode.
194.It Fl f 193.It Fl f
195Forces a cache reload for transfers that go through the 194Forces a cache reload for transfers that go through the
196.Tn FTP 195.Tn FTP
197or 196or
198.Tn HTTP 197.Tn HTTP
199proxies. 198proxies.
200.It Fl g 199.It Fl g
201Disables file name globbing. 200Disables file name globbing.
202.It Fl i 201.It Fl i
203Turns off interactive prompting during 202Turns off interactive prompting during
204multiple file transfers. 203multiple file transfers.
205.It Fl N Ar netrc 204.It Fl N Ar netrc
206Use 205Use
207.Ar netrc 206.Ar netrc
208instead of 207instead of
209.Pa ~/.netrc . 208.Pa ~/.netrc .
210Refer to 209Refer to
211.Sx THE .netrc FILE 210.Sx THE .netrc FILE
212for more information. 211for more information.
213.It Fl n 212.It Fl n
214Restrains 213Restrains
215.Nm 214.Nm
216from attempting 215from attempting
217.Dq auto-login 216.Dq auto-login
218upon initial connection for non auto-fetch transfers. 217upon initial connection for non auto-fetch transfers.
219If auto-login is enabled, 218If auto-login is enabled,
220.Nm 219.Nm
221will check the 220will check the
222.Pa .netrc 221.Pa .netrc
223(see below) file in the user's home directory for an entry describing 222(see below) file in the user's home directory for an entry describing
224an account on the remote machine. 223an account on the remote machine.
225If no entry exists, 224If no entry exists,
226.Nm 225.Nm
227will prompt for the remote machine login name (default is the user 226will prompt for the remote machine login name (default is the user
228identity on the local machine), and, if necessary, prompt for a password 227identity on the local machine), and, if necessary, prompt for a password
229and an account with which to login. 228and an account with which to login.
230To override the auto-login for auto-fetch transfers, specify the 229To override the auto-login for auto-fetch transfers, specify the
231username (and optionally, password) as appropriate. 230username (and optionally, password) as appropriate.
232.It Fl o Ar output 231.It Fl o Ar output
233When auto-fetching files, save the contents in 232When auto-fetching files, save the contents in
234.Ar output . 233.Ar output .
235.Ar output 234.Ar output
236is parsed according to the 235is parsed according to the
237.Sx FILE NAMING CONVENTIONS 236.Sx FILE NAMING CONVENTIONS
238below. 237below.
239If 238If
240.Ar output 239.Ar output
241is not 240is not
242.Sq - 241.Sq -
243or doesn't start with 242or doesn't start with
244.Sq \&| , 243.Sq \&| ,
245then only the first file specified will be retrieved into 244then only the first file specified will be retrieved into
246.Ar output ; 245.Ar output ;
247all other files will be retrieved into the basename of their 246all other files will be retrieved into the basename of their
248remote name. 247remote name.
249.It Fl P Ar port 248.It Fl P Ar port
250Sets the port number to 249Sets the port number to
251.Ar port . 250.Ar port .
252.It Fl p 251.It Fl p
253Enable passive mode operation for use behind connection filtering firewalls. 252Enable passive mode operation for use behind connection filtering firewalls.
254This option has been deprecated as 253This option has been deprecated as
255.Nm 254.Nm
256now tries to use passive mode by default, falling back to active mode 255now tries to use passive mode by default, falling back to active mode
257if the server does not support passive connections. 256if the server does not support passive connections.
258.It Fl q Ar quittime 257.It Fl q Ar quittime
259Quit if the connection has stalled for 258Quit if the connection has stalled for
260.Ar quittime 259.Ar quittime
261seconds. 260seconds.
262.It Fl R 261.It Fl R
263Restart all non-proxied auto-fetches. 262Restart all non-proxied auto-fetches.
264.It Fl r Ar wait 263.It Fl r Ar wait
265Retry the connection attempt if it failed, pausing for 264Retry the connection attempt if it failed, pausing for
266.Ar wait 265.Ar wait
267seconds. 266seconds.
268.It Fl s Ar srcaddr 267.It Fl s Ar srcaddr
269Uses 268Uses
270.Ar srcaddr 269.Ar srcaddr
271as the local IP address for all connections. 270as the local IP address for all connections.
272.It Fl t 271.It Fl t
273Enables packet tracing. 272Enables packet tracing.
274.It Fl T Ar direction Ns , Ns Ar maximum Ns Oo , Ns Ar increment Oc 273.It Fl T Ar direction Ns , Ns Ar maximum Ns Oo , Ns Ar increment Oc
275Set the maximum transfer rate for 274Set the maximum transfer rate for
276.Ar direction 275.Ar direction
277to 276to
278.Ar maximum 277.Ar maximum
279bytes/second, 278bytes/second,
280and if specified, the increment to 279and if specified, the increment to
281.Ar increment 280.Ar increment
282bytes/second. 281bytes/second.
283Refer to 282Refer to
284.Ic rate 283.Ic rate
285for more information. 284for more information.
286.It Fl u Ar url file Op \&.\&.\&. 285.It Fl u Ar url Ar
287Upload files on the command line to 286Upload files on the command line to
288.Ar url 287.Ar url
289where 288where
290.Ar url 289.Ar url
291is one of the ftp URL types as supported by auto-fetch 290is one of the ftp URL types as supported by auto-fetch
292(with an optional target filename for single file uploads), and 291(with an optional target filename for single file uploads), and
293.Ar file 292.Ar file
294is one or more local files to be uploaded. 293is one or more local files to be uploaded.
295.It Fl V 294.It Fl V
296Disable 295Disable
297.Ic verbose 296.Ic verbose
298and 297and
299.Ic progress , 298.Ic progress ,
300overriding the default of enabled when output is to a terminal. 299overriding the default of enabled when output is to a terminal.
301.It Fl v 300.It Fl v
302Enable 301Enable
303.Ic verbose 302.Ic verbose
304and 303and
305.Ic progress . 304.Ic progress .
306This is the default if output is to a terminal (and in the case of 305This is the default if output is to a terminal (and in the case of
307.Ic progress , 306.Ic progress ,
308.Nm 307.Nm
309is the foreground process). 308is the foreground process).
310Forces 309Forces
311.Nm 310.Nm
312to show all responses from the remote server, as well 311to show all responses from the remote server, as well
313as report on data transfer statistics. 312as report on data transfer statistics.
314.It Fl x Ar xfersize 313.It Fl x Ar xfersize
315Set the size of the socket send and receive buffers to 314Set the size of the socket send and receive buffers to
316.Ar xfersize . 315.Ar xfersize .
317Refer to 316Refer to
318.Ic xferbuf 317.Ic xferbuf
319for more information. 318for more information.
320.El 319.El
321.Pp 320.Pp
322The client host with which 321The client host with which
323.Nm 322.Nm
324is to communicate may be specified on the command line. 323is to communicate may be specified on the command line.
325If this is done, 324If this is done,
326.Nm 325.Nm
327will immediately attempt to establish a connection to an 326will immediately attempt to establish a connection to an
328.Tn FTP 327.Tn FTP
329server on that host; otherwise, 328server on that host; otherwise,
330.Nm 329.Nm
331will enter its command interpreter and await instructions 330will enter its command interpreter and await instructions
332from the user. 331from the user.
333When 332When
334.Nm 333.Nm
335is awaiting commands from the user the prompt 334is awaiting commands from the user the prompt
336.Ql ftp> 335.Ql ftp>
337is provided to the user. 336is provided to the user.
338The following commands are recognized 337The following commands are recognized
339by 338by
340.Nm ftp : 339.Nm ftp :
341.Bl -tag -width Ic 340.Bl -tag -width Ic
342.It Ic \&! Op Ar command Op Ar args 341.It Ic \&! Op Ar command Op Ar args
343Invoke an interactive shell on the local machine. 342Invoke an interactive shell on the local machine.
344If there are arguments, the first is taken to be a command to execute 343If there are arguments, the first is taken to be a command to execute
345directly, with the rest of the arguments as its arguments. 344directly, with the rest of the arguments as its arguments.
346.It Ic \&$ Ar macro-name Op Ar args 345.It Ic \&$ Ar macro-name Op Ar args
347Execute the macro 346Execute the macro
348.Ar macro-name 347.Ar macro-name
349that was defined with the 348that was defined with the
350.Ic macdef 349.Ic macdef
351command. 350command.
352Arguments are passed to the macro unglobbed. 351Arguments are passed to the macro unglobbed.
353.It Ic account Op Ar passwd 352.It Ic account Op Ar passwd
354Supply a supplemental password required by a remote system for access 353Supply a supplemental password required by a remote system for access
355to resources once a login has been successfully completed. 354to resources once a login has been successfully completed.
356If no argument is included, the user will be prompted for an account 355If no argument is included, the user will be prompted for an account
357password in a non-echoing input mode. 356password in a non-echoing input mode.
358.It Ic append Ar local-file Op Ar remote-file 357.It Ic append Ar local-file Op Ar remote-file
359Append a local file to a file on the remote machine. 358Append a local file to a file on the remote machine.
360If 359If
361.Ar remote-file 360.Ar remote-file
362is left unspecified, the local file name is used in naming the 361is left unspecified, the local file name is used in naming the
363remote file after being altered by any 362remote file after being altered by any
364.Ic ntrans 363.Ic ntrans
365or 364or
366.Ic nmap 365.Ic nmap
367setting. 366setting.
368File transfer uses the current settings for 367File transfer uses the current settings for
369.Ic type , 368.Ic type ,
370.Ic format , 369.Ic format ,
371.Ic mode , 370.Ic mode ,
372and 371and
373.Ic structure . 372.Ic structure .
374.It Ic ascii 373.It Ic ascii
375Set the file transfer 374Set the file transfer
376.Ic type 375.Ic type
377to network 376to network
378.Tn ASCII . 377.Tn ASCII .
379This is the default type. 378This is the default type.
380.It Ic bell 379.It Ic bell
381Arrange that a bell be sounded after each file transfer 380Arrange that a bell be sounded after each file transfer
382command is completed. 381command is completed.
383.It Ic binary 382.It Ic binary
384Set the file transfer 383Set the file transfer
385.Ic type 384.Ic type
386to support binary image transfer. 385to support binary image transfer.
387.It Ic bye 386.It Ic bye
388Terminate the 387Terminate the
389.Tn FTP 388.Tn FTP
390session with the remote server 389session with the remote server
391and exit 390and exit
392.Nm ftp . 391.Nm ftp .
393An end of file will also terminate the session and exit. 392An end of file will also terminate the session and exit.
394.It Ic case 393.It Ic case
395Toggle remote computer file name case mapping during 394Toggle remote computer file name case mapping during
396.Ic get , 395.Ic get ,
397.Ic mget 396.Ic mget
398and 397and
399.Ic mput 398.Ic mput
400commands. 399commands.
401When 400When
402.Ic case 401.Ic case
403is on (default is off), remote computer file names with all letters in 402is on (default is off), remote computer file names with all letters in
404upper case are written in the local directory with the letters mapped 403upper case are written in the local directory with the letters mapped
405to lower case. 404to lower case.
406.It Ic \&cd Ar remote-directory 405.It Ic \&cd Ar remote-directory
407Change the working directory on the remote machine 406Change the working directory on the remote machine
408to 407to
409.Ar remote-directory . 408.Ar remote-directory .
410.It Ic cdup 409.It Ic cdup
411Change the remote machine working directory to the parent of the 410Change the remote machine working directory to the parent of the
412current remote machine working directory. 411current remote machine working directory.
413.It Ic chmod Ar mode remote-file 412.It Ic chmod Ar mode remote-file
414Change the permission modes of the file 413Change the permission modes of the file
415.Ar remote-file 414.Ar remote-file
416on the remote 415on the remote
417system to 416system to
418.Ar mode . 417.Ar mode .
419.It Ic close 418.It Ic close
420Terminate the 419Terminate the
421.Tn FTP 420.Tn FTP
422session with the remote server, and 421session with the remote server, and
423return to the command interpreter. 422return to the command interpreter.
424Any defined macros are erased. 423Any defined macros are erased.
425.It Ic \&cr 424.It Ic \&cr
426Toggle carriage return stripping during 425Toggle carriage return stripping during
427ascii type file retrieval. 426ascii type file retrieval.
428Records are denoted by a carriage return/linefeed sequence 427Records are denoted by a carriage return/linefeed sequence
429during ascii type file transfer. 428during ascii type file transfer.
430When 429When
431.Ic \&cr 430.Ic \&cr
432is on (the default), carriage returns are stripped from this 431is on (the default), carriage returns are stripped from this
433sequence to conform with the 432sequence to conform with the
434.Ux 433.Ux
435single linefeed record 434single linefeed record
436delimiter. 435delimiter.
437Records on 436Records on
438.Pf non\- Ns Ux 437.Pf non\- Ns Ux
439remote systems may contain single linefeeds; 438remote systems may contain single linefeeds;
440when an ascii type transfer is made, these linefeeds may be 439when an ascii type transfer is made, these linefeeds may be
441distinguished from a record delimiter only when 440distinguished from a record delimiter only when
442.Ic \&cr 441.Ic \&cr
443is off. 442is off.
444.It Ic delete Ar remote-file 443.It Ic delete Ar remote-file
445Delete the file 444Delete the file
446.Ar remote-file 445.Ar remote-file
447on the remote machine. 446on the remote machine.
448.It Ic dir Op Ar remote-path Op Ar local-file 447.It Ic dir Op Ar remote-path Op Ar local-file
449Print a listing of the contents of a 448Print a listing of the contents of a
450directory on the remote machine. 449directory on the remote machine.
451The listing includes any system-dependent information that the server 450The listing includes any system-dependent information that the server
452chooses to include; for example, most 451chooses to include; for example, most
453.Ux 452.Ux
454systems will produce 453systems will produce
455output from the command 454output from the command
456.Ql ls \-l . 455.Ql ls \-l .
457If 456If
458.Ar remote-path 457.Ar remote-path
459is left unspecified, the current working directory is used. 458is left unspecified, the current working directory is used.
460If interactive prompting is on, 459If interactive prompting is on,
461.Nm 460.Nm
462will prompt the user to verify that the last argument is indeed the 461will prompt the user to verify that the last argument is indeed the
463target local file for receiving 462target local file for receiving
464.Ic dir 463.Ic dir
465output. 464output.
466If no local file is specified, or if 465If no local file is specified, or if
467.Ar local-file 466.Ar local-file
468is 467is
469.Sq Fl , 468.Sq Fl ,
470the output is sent to the terminal. 469the output is sent to the terminal.
471.It Ic disconnect 470.It Ic disconnect
472A synonym for 471A synonym for
473.Ic close . 472.Ic close .
474.It Ic edit 473.It Ic edit
475Toggle command line editing, and context sensitive command and file 474Toggle command line editing, and context sensitive command and file
476completion. 475completion.
477This is automatically enabled if input is from a terminal, and 476This is automatically enabled if input is from a terminal, and
478disabled otherwise. 477disabled otherwise.
479.It Ic epsv epsv4 epsv6 478.It Ic epsv epsv4 epsv6
480Toggle the use of the extended 479Toggle the use of the extended
481.Dv EPSV 480.Dv EPSV
482and 481and
483.Dv EPRT 482.Dv EPRT
484commands on all IP, IPv4, and IPv6 connections respectively. 483commands on all IP, IPv4, and IPv6 connections respectively.
485First try 484First try
486.Dv EPSV / 485.Dv EPSV /
487.Dv EPRT , 486.Dv EPRT ,
488and then 487and then
489.Dv PASV / 488.Dv PASV /
490.Dv PORT . 489.Dv PORT .
491This is enabled by default. 490This is enabled by default.
492If an extended command fails then this option will be temporarily 491If an extended command fails then this option will be temporarily
493disabled for the duration of the current connection, or until 492disabled for the duration of the current connection, or until
494.Ic epsv , 493.Ic epsv ,
495.Ic epsv4 , 494.Ic epsv4 ,
496or 495or
497.Ic epsv6 496.Ic epsv6
498is executed again. 497is executed again.
499.It Ic exit 498.It Ic exit
500A synonym for 499A synonym for
501.Ic bye . 500.Ic bye .
502.It Ic features 501.It Ic features
503Display what features the remote server supports (using the 502Display what features the remote server supports (using the
504.Dv FEAT 503.Dv FEAT
505command). 504command).
506.It Ic fget Ar localfile 505.It Ic fget Ar localfile
507Retrieve the files listed in 506Retrieve the files listed in
508.Ar localfile , 507.Ar localfile ,
509which has one line per filename. 508which has one line per filename.
510.It Ic form Ar format 509.It Ic form Ar format
511Set the file transfer 510Set the file transfer
512.Ic form 511.Ic form
513to 512to
514.Ar format . 513.Ar format .
515The default (and only supported) 514The default (and only supported)
516format is 515format is
517.Dq non-print . 516.Dq non-print .
518.It Ic ftp Ar host Op Ar port 517.It Ic ftp Ar host Op Ar port
519A synonym for 518A synonym for
520.Ic open . 519.Ic open .
521.It Ic ftp_debug Op Ar ftp_debug-value 520.It Ic ftp_debug Op Ar ftp_debug-value
522Toggle debugging mode. 521Toggle debugging mode.
523If an optional 522If an optional
524.Ar ftp_debug-value 523.Ar ftp_debug-value
525is specified it is used to set the debugging level. 524is specified it is used to set the debugging level.
526When debugging is on, 525When debugging is on,
527.Nm 526.Nm
528prints each command sent to the remote machine, preceded 527prints each command sent to the remote machine, preceded
529by the string 528by the string
530.Ql \-\-> . 529.Ql \-\-> .
531.It Ic gate Op Ar host Op Ar port 530.It Ic gate Op Ar host Op Ar port
532Toggle gate-ftp mode, which used to connect through the 531Toggle gate-ftp mode, which used to connect through the
533TIS FWTK and Gauntlet ftp proxies. 532TIS FWTK and Gauntlet ftp proxies.
534This will not be permitted if the gate-ftp server hasn't been set 533This will not be permitted if the gate-ftp server hasn't been set
535(either explicitly by the user, or from the 534(either explicitly by the user, or from the
536.Ev FTPSERVER 535.Ev FTPSERVER
537environment variable). 536environment variable).
538If 537If
539.Ar host 538.Ar host
540is given, 539is given,
541then gate-ftp mode will be enabled, and the gate-ftp server will be set to 540then gate-ftp mode will be enabled, and the gate-ftp server will be set to
542.Ar host . 541.Ar host .
543If 542If
544.Ar port 543.Ar port
545is also given, that will be used as the port to connect to on the 544is also given, that will be used as the port to connect to on the
546gate-ftp server. 545gate-ftp server.
547.It Ic get Ar remote-file Op Ar local-file 546.It Ic get Ar remote-file Op Ar local-file
548Retrieve the 547Retrieve the
549.Ar remote-file 548.Ar remote-file
550and store it on the local machine. 549and store it on the local machine.
551If the local 550If the local
552file name is not specified, it is given the same 551file name is not specified, it is given the same
553name it has on the remote machine, subject to 552name it has on the remote machine, subject to
554alteration by the current 553alteration by the current
555.Ic case , 554.Ic case ,
556.Ic ntrans , 555.Ic ntrans ,
557and 556and
558.Ic nmap 557.Ic nmap
559settings. 558settings.
560The current settings for 559The current settings for
561.Ic type , 560.Ic type ,
562.Ic form , 561.Ic form ,
563.Ic mode , 562.Ic mode ,
564and 563and
565.Ic structure 564.Ic structure
566are used while transferring the file. 565are used while transferring the file.
567.It Ic glob 566.It Ic glob
568Toggle filename expansion for 567Toggle filename expansion for
569.Ic mdelete , 568.Ic mdelete ,
570.Ic mget , 569.Ic mget ,
571.Ic mput , 570.Ic mput ,
572and 571and
573.Ic mreget . 572.Ic mreget .
574If globbing is turned off with 573If globbing is turned off with
575.Ic glob , 574.Ic glob ,
576the file name arguments 575the file name arguments
577are taken literally and not expanded. 576are taken literally and not expanded.
578Globbing for 577Globbing for
579.Ic mput 578.Ic mput
580is done as in 579is done as in
581.Xr csh 1 . 580.Xr csh 1 .
582For 581For
583.Ic mdelete , 582.Ic mdelete ,
584.Ic mget , 583.Ic mget ,
585and 584and
586.Ic mreget , 585.Ic mreget ,
587each remote file name is expanded 586each remote file name is expanded
588separately on the remote machine and the lists are not merged. 587separately on the remote machine and the lists are not merged.
589Expansion of a directory name is likely to be 588Expansion of a directory name is likely to be
590different from expansion of the name of an ordinary file: 589different from expansion of the name of an ordinary file:
591the exact result depends on the foreign operating system and ftp server, 590the exact result depends on the foreign operating system and ftp server,
592and can be previewed by doing 591and can be previewed by doing
593.Ql mls remote-files \- 592.Ql mls remote-files \-
594Note: 593Note:
595.Ic mget , 594.Ic mget ,
596.Ic mput 595.Ic mput
597and 596and
598.Ic mreget 597.Ic mreget
599are not meant to transfer 598are not meant to transfer
600entire directory subtrees of files. 599entire directory subtrees of files.
601That can be done by 600That can be done by
602transferring a 601transferring a
603.Xr tar 1 602.Xr tar 1
604archive of the subtree (in binary mode). 603archive of the subtree (in binary mode).
605.It Ic hash Op Ar size 604.It Ic hash Op Ar size
606Toggle hash-sign 605Toggle hash-sign
607.Pq Sq # 606.Pq Sq #
608printing for each data block transferred. 607printing for each data block transferred.
609The size of a data block defaults to 1024 bytes. 608The size of a data block defaults to 1024 bytes.
610This can be changed by specifying 609This can be changed by specifying
611.Ar size 610.Ar size
612in bytes. 611in bytes.
613Enabling 612Enabling
614.Ic hash 613.Ic hash
615disables 614disables
616.Ic progress . 615.Ic progress .
617.It Ic help Op Ar command 616.It Ic help Op Ar command
618Print an informative message about the meaning of 617Print an informative message about the meaning of
619.Ar command . 618.Ar command .
620If no argument is given, 619If no argument is given,
621.Nm 620.Nm
622prints a list of the known commands. 621prints a list of the known commands.
623.It Ic idle Op Ar seconds 622.It Ic idle Op Ar seconds
624Set the inactivity timer on the remote server to 623Set the inactivity timer on the remote server to
625.Ar seconds 624.Ar seconds
626seconds. 625seconds.
627If 626If
628.Ar seconds 627.Ar seconds
629is omitted, the current inactivity timer is printed. 628is omitted, the current inactivity timer is printed.
630.It Ic image 629.It Ic image
631A synonym for 630A synonym for
632.Ic binary . 631.Ic binary .
633.It Ic lcd Op Ar directory 632.It Ic lcd Op Ar directory
634Change the working directory on the local machine. 633Change the working directory on the local machine.
635If 634If
636no 635no
637.Ar directory 636.Ar directory
638is specified, the user's home directory is used. 637is specified, the user's home directory is used.
639.It Ic less Ar file 638.It Ic less Ar file
640A synonym for 639A synonym for
641.Ic page . 640.Ic page .
642.It Ic lpage Ar local-file 641.It Ic lpage Ar local-file
643Display 642Display
644.Ar local-file 643.Ar local-file
645with the program specified by the 644with the program specified by the
646.Ic "set pager" 645.Ic "set pager"
647option. 646option.
648.It Ic lpwd 647.It Ic lpwd
649Print the working directory on the local machine. 648Print the working directory on the local machine.
650.It Ic \&ls Op Ar remote-path Op Ar local-file 649.It Ic \&ls Op Ar remote-path Op Ar local-file
651A synonym for 650A synonym for
652.Ic dir . 651.Ic dir .
653.It Ic macdef Ar macro-name 652.It Ic macdef Ar macro-name
654Define a macro. 653Define a macro.
655Subsequent lines are stored as the macro 654Subsequent lines are stored as the macro
656.Ar macro-name ; 655.Ar macro-name ;
657a null line (consecutive newline characters in a file or carriage 656a null line (consecutive newline characters in a file or carriage
658returns from the terminal) terminates macro input mode. 657returns from the terminal) terminates macro input mode.
659There is a limit of 16 macros and 4096 total characters in all 658There is a limit of 16 macros and 4096 total characters in all
660defined macros. 659defined macros.
661Macro names can be a maximum of 8 characters. 660Macro names can be a maximum of 8 characters.
662Macros are only applicable to the current session they are 661Macros are only applicable to the current session they are
663defined within (or if defined outside a session, to the session 662defined within (or if defined outside a session, to the session
664invoked with the next 663invoked with the next
665.Ic open 664.Ic open
666command), and remain defined until a 665command), and remain defined until a
667.Ic close 666.Ic close
668command is executed. 667command is executed.
669To invoke a macro, use the 668To invoke a macro, use the
670.Ic $ 669.Ic $
671command (see above). 670command (see above).
672.Pp 671.Pp
673The macro processor interprets 672The macro processor interprets
674.Sq $ 673.Sq $
675and 674and
676.Sq \e 675.Sq \e
677as special characters. 676as special characters.
678A 677A
679.Sq $ 678.Sq $
680followed by a number (or numbers) is replaced by the 679followed by a number (or numbers) is replaced by the
681corresponding argument on the macro invocation command line. 680corresponding argument on the macro invocation command line.
682A 681A
683.Sq $ 682.Sq $
684followed by an 683followed by an
685.Sq i 684.Sq i
686signals the macro processor that the executing macro is to be 685signals the macro processor that the executing macro is to be
687looped. 686looped.
688On the first pass 687On the first pass
689.Dq $i 688.Dq $i
690is replaced by the first argument on the macro invocation command 689is replaced by the first argument on the macro invocation command
691line, on the second pass it is replaced by the second argument, 690line, on the second pass it is replaced by the second argument,
692and so on. 691and so on.
693A 692A
694.Sq \e 693.Sq \e
695followed by any character is replaced by that character. 694followed by any character is replaced by that character.
696Use the 695Use the
697.Sq \e 696.Sq \e
698to prevent special treatment of the 697to prevent special treatment of the
699.Sq $ . 698.Sq $ .
700.It Ic mdelete Op Ar remote-files 699.It Ic mdelete Op Ar remote-files
701Delete the 700Delete the
702.Ar remote-files 701.Ar remote-files
703on the remote machine. 702on the remote machine.
704.It Ic mdir Ar remote-files local-file 703.It Ic mdir Ar remote-files local-file
705Like 704Like
706.Ic dir , 705.Ic dir ,
707except multiple remote files may be specified. 706except multiple remote files may be specified.
708If interactive prompting is on, 707If interactive prompting is on,
709.Nm 708.Nm
710will prompt the user to verify that the last argument is indeed the 709will prompt the user to verify that the last argument is indeed the
711target local file for receiving 710target local file for receiving
712.Ic mdir 711.Ic mdir
713output. 712output.
714.It Ic mget Ar remote-files 713.It Ic mget Ar remote-files
715Expand the 714Expand the
716.Ar remote-files 715.Ar remote-files
717on the remote machine 716on the remote machine
718and do a 717and do a
719.Ic get 718.Ic get
720for each file name thus produced. 719for each file name thus produced.
721See 720See
722.Ic glob 721.Ic glob
723for details on the filename expansion. 722for details on the filename expansion.
724Resulting file names will then be processed according to 723Resulting file names will then be processed according to
725.Ic case , 724.Ic case ,
726.Ic ntrans , 725.Ic ntrans ,
727and 726and
728.Ic nmap 727.Ic nmap
729settings. 728settings.
730Files are transferred into the local working directory, 729Files are transferred into the local working directory,
731which can be changed with 730which can be changed with
732.Ql lcd directory ; 731.Ql lcd directory ;
733new local directories can be created with 732new local directories can be created with
734.Ql "\&! mkdir directory" . 733.Ql "\&! mkdir directory" .
735.It Ic mkdir Ar directory-name 734.It Ic mkdir Ar directory-name
736Make a directory on the remote machine. 735Make a directory on the remote machine.
737.It Ic mls Ar remote-files local-file 736.It Ic mls Ar remote-files local-file
738Like 737Like
739.Ic ls , 738.Ic ls ,
740except multiple remote files may be specified, 739except multiple remote files may be specified,
741and the 740and the
742.Ar local-file 741.Ar local-file
743must be specified. 742must be specified.
744If interactive prompting is on, 743If interactive prompting is on,
745.Nm 744.Nm
746will prompt the user to verify that the last argument is indeed the 745will prompt the user to verify that the last argument is indeed the
747target local file for receiving 746target local file for receiving
748.Ic mls 747.Ic mls
749output. 748output.
750.It Ic mlsd Op Ar remote-path 749.It Ic mlsd Op Ar remote-path
751Display the contents of 750Display the contents of
752.Ar remote-path 751.Ar remote-path
753(which should default to the current directory if not given) 752(which should default to the current directory if not given)
754in a machine-parsable form, using 753in a machine-parsable form, using
755.Dv MLSD . 754.Dv MLSD .
756The format of display can be changed with 755The format of display can be changed with
757.Sq "remopts mlst ..." . 756.Sq "remopts mlst ..." .
758.It Ic mlst Op Ar remote-path 757.It Ic mlst Op Ar remote-path
759Display the details about 758Display the details about
760.Ar remote-path 759.Ar remote-path
761(which should default to the current directory if not given) 760(which should default to the current directory if not given)
762in a machine-parsable form, using 761in a machine-parsable form, using
763.Dv MLST . 762.Dv MLST .
764The format of display can be changed with 763The format of display can be changed with
765.Sq "remopts mlst ..." . 764.Sq "remopts mlst ..." .
766.It Ic mode Ar mode-name 765.It Ic mode Ar mode-name
767Set the file transfer 766Set the file transfer
768.Ic mode 767.Ic mode
769to 768to
770.Ar mode-name . 769.Ar mode-name .
771The default (and only supported) 770The default (and only supported)
772mode is 771mode is
773.Dq stream . 772.Dq stream .
774.It Ic modtime Ar remote-file 773.It Ic modtime Ar remote-file
775Show the last modification time of the file on the remote machine, in 774Show the last modification time of the file on the remote machine, in
776.Li RFC 2822 775.Li RFC 2822
777format. 776format.
778.It Ic more Ar file 777.It Ic more Ar file
779A synonym for 778A synonym for
780.Ic page . 779.Ic page .
781.It Ic mput Ar local-files 780.It Ic mput Ar local-files
782Expand wild cards in the list of local files given as arguments 781Expand wild cards in the list of local files given as arguments
783and do a 782and do a
784.Ic put 783.Ic put
785for each file in the resulting list. 784for each file in the resulting list.
786See 785See
787.Ic glob 786.Ic glob
788for details of filename expansion. 787for details of filename expansion.
789Resulting file names will then be processed according to 788Resulting file names will then be processed according to
790.Ic ntrans 789.Ic ntrans
791and 790and
792.Ic nmap 791.Ic nmap
793settings. 792settings.
794.It Ic mreget Ar remote-files 793.It Ic mreget Ar remote-files
795As per 794As per
796.Ic mget , 795.Ic mget ,
797but performs a 796but performs a
798.Ic reget 797.Ic reget
799instead of 798instead of
800.Ic get . 799.Ic get .
801.It Ic msend Ar local-files 800.It Ic msend Ar local-files
802A synonym for 801A synonym for
803.Ic mput . 802.Ic mput .
804.It Ic newer Ar remote-file Op Ar local-file 803.It Ic newer Ar remote-file Op Ar local-file
805Get the file only if the modification time of the remote file is more 804Get the file only if the modification time of the remote file is more
806recent that the file on the current system. 805recent that the file on the current system.
807If the file does not 806If the file does not
808exist on the current system, the remote file is considered 807exist on the current system, the remote file is considered
809.Ic newer . 808.Ic newer .
810Otherwise, this command is identical to 809Otherwise, this command is identical to
811.Ar get . 810.Ar get .
812.It Ic nlist Op Ar remote-path Op Ar local-file 811.It Ic nlist Op Ar remote-path Op Ar local-file
813A synonym for 812A synonym for
814.Ic ls . 813.Ic ls .
815.It Ic nmap Op Ar inpattern outpattern 814.It Ic nmap Op Ar inpattern outpattern
816Set or unset the filename mapping mechanism. 815Set or unset the filename mapping mechanism.
817If no arguments are specified, the filename mapping mechanism is unset. 816If no arguments are specified, the filename mapping mechanism is unset.
818If arguments are specified, remote filenames are mapped during 817If arguments are specified, remote filenames are mapped during
819.Ic mput 818.Ic mput
820commands and 819commands and
821.Ic put 820.Ic put
822commands issued without a specified remote target filename. 821commands issued without a specified remote target filename.
823If arguments are specified, local filenames are mapped during 822If arguments are specified, local filenames are mapped during
824.Ic mget 823.Ic mget
825commands and 824commands and
826.Ic get 825.Ic get
827commands issued without a specified local target filename. 826commands issued without a specified local target filename.
828This command is useful when connecting to a 827This command is useful when connecting to a
829.No non\- Ns Ux 828.No non\- Ns Ux
830remote computer 829remote computer
831with different file naming conventions or practices. 830with different file naming conventions or practices.
832The mapping follows the pattern set by 831The mapping follows the pattern set by
833.Ar inpattern 832.Ar inpattern
834and 833and
835.Ar outpattern . 834.Ar outpattern .
836.Op Ar Inpattern 835.Op Ar Inpattern
837is a template for incoming filenames (which may have already been 836is a template for incoming filenames (which may have already been
838processed according to the 837processed according to the
839.Ic ntrans 838.Ic ntrans
840and 839and
841.Ic case 840.Ic case
842settings). 841settings).
843Variable templating is accomplished by including the 842Variable templating is accomplished by including the
844sequences 843sequences
845.Dq $1 , 844.Dq $1 ,
846.Dq $2 , 845.Dq $2 ,
847\&... 846\&...
848.Dq $9 847.Dq $9
849in 848in
850.Ar inpattern . 849.Ar inpattern .
851Use 850Use
852.Sq \e 851.Sq \e
853to prevent this special treatment of the 852to prevent this special treatment of the
854.Sq $ 853.Sq $
855character. 854character.
856All other characters are treated literally, and are used to determine the 855All other characters are treated literally, and are used to determine the
857.Ic nmap 856.Ic nmap
858.Op Ar inpattern 857.Op Ar inpattern
859variable values. 858variable values.
860For example, given 859For example, given
861.Ar inpattern 860.Ar inpattern
862$1.$2 and the remote file name "mydata.data", $1 would have the value 861$1.$2 and the remote file name "mydata.data", $1 would have the value
863"mydata", and $2 would have the value "data". 862"mydata", and $2 would have the value "data".
864The 863The
865.Ar outpattern 864.Ar outpattern
866determines the resulting mapped filename. 865determines the resulting mapped filename.
867The sequences 866The sequences
868.Dq $1 , 867.Dq $1 ,
869.Dq $2 , 868.Dq $2 ,
870\&... 869\&...
871.Dq $9 870.Dq $9
872are replaced by any value resulting from the 871are replaced by any value resulting from the
873.Ar inpattern 872.Ar inpattern
874template. 873template.
875The sequence 874The sequence
876.Dq $0 875.Dq $0
877is replaced by the original filename. 876is replaced by the original filename.
878Additionally, the sequence 877Additionally, the sequence
879.Dq Op Ar seq1 , Ar seq2 878.Dq Op Ar seq1 , Ar seq2
880is replaced by 879is replaced by
881.Op Ar seq1 880.Op Ar seq1
882if 881if
883.Ar seq1 882.Ar seq1
884is not a null string; otherwise it is replaced by 883is not a null string; otherwise it is replaced by
885.Ar seq2 . 884.Ar seq2 .
886For example, the command 885For example, the command
887.Pp 886.Pp
888.Bd -literal -offset indent -compact 887.Bd -literal -offset indent -compact
889nmap $1.$2.$3 [$1,$2].[$2,file] 888nmap $1.$2.$3 [$1,$2].[$2,file]
890.Ed 889.Ed
891.Pp 890.Pp
892would yield 891would yield
893the output filename "myfile.data" for input filenames "myfile.data" and 892the output filename "myfile.data" for input filenames "myfile.data" and
894"myfile.data.old", "myfile.file" for the input filename "myfile", and 893"myfile.data.old", "myfile.file" for the input filename "myfile", and
895"myfile.myfile" for the input filename ".myfile". 894"myfile.myfile" for the input filename ".myfile".
896Spaces may be included in 895Spaces may be included in
897.Ar outpattern , 896.Ar outpattern ,
898as in the example: 897as in the example:
899.Dl nmap $1 sed "s/ *$//" > $1 898.Dl nmap $1 sed "s/ *$//" > $1
900Use the 899Use the
901.Sq \e 900.Sq \e
902character to prevent special treatment 901character to prevent special treatment
903of the 902of the
904.Sq $ , 903.Sq $ ,
905.Sq \&[ , 904.Sq \&[ ,
906.Sq \&] , 905.Sq \&] ,
907and 906and
908.Sq \&, 907.Sq \&,
909characters. 908characters.
910.It Ic ntrans Op Ar inchars Op Ar outchars 909.It Ic ntrans Op Ar inchars Op Ar outchars
911Set or unset the filename character translation mechanism. 910Set or unset the filename character translation mechanism.
912If no arguments are specified, the filename character 911If no arguments are specified, the filename character
913translation mechanism is unset. 912translation mechanism is unset.
914If arguments are specified, characters in 913If arguments are specified, characters in
915remote filenames are translated during 914remote filenames are translated during
916.Ic mput 915.Ic mput
917commands and 916commands and
918.Ic put 917.Ic put
919commands issued without a specified remote target filename. 918commands issued without a specified remote target filename.
920If arguments are specified, characters in 919If arguments are specified, characters in
921local filenames are translated during 920local filenames are translated during
922.Ic mget 921.Ic mget
923commands and 922commands and
924.Ic get 923.Ic get
925commands issued without a specified local target filename. 924commands issued without a specified local target filename.
926This command is useful when connecting to a 925This command is useful when connecting to a
927.No non\- Ns Ux 926.No non\- Ns Ux
928remote computer 927remote computer
929with different file naming conventions or practices. 928with different file naming conventions or practices.
930Characters in a filename matching a character in 929Characters in a filename matching a character in
931.Ar inchars 930.Ar inchars
932are replaced with the corresponding character in 931are replaced with the corresponding character in
933.Ar outchars . 932.Ar outchars .
934If the character's position in 933If the character's position in
935.Ar inchars 934.Ar inchars
936is longer than the length of 935is longer than the length of
937.Ar outchars , 936.Ar outchars ,
938the character is deleted from the file name. 937the character is deleted from the file name.
939.It Ic open Ar host Op Ar port 938.It Ic open Ar host Op Ar port
940Establish a connection to the specified 939Establish a connection to the specified
941.Ar host 940.Ar host
942.Tn FTP 941.Tn FTP
943server. 942server.
944An optional port number may be supplied, 943An optional port number may be supplied,
945in which case, 944in which case,
946.Nm 945.Nm
947will attempt to contact an 946will attempt to contact an
948.Tn FTP 947.Tn FTP
949server at that port. 948server at that port.
950If the 949If the
951.Ic "set auto-login" 950.Ic "set auto-login"
952option is on (default), 951option is on (default),
953.Nm 952.Nm
954will also attempt to automatically log the user in to 953will also attempt to automatically log the user in to
955the 954the
956.Tn FTP 955.Tn FTP
957server (see below). 956server (see below).
958.It Ic page Ar file 957.It Ic page Ar file
959Retrieve 958Retrieve
960.Ic file 959.Ic file
961and display with the program specified by the 960and display with the program specified by the
962.Ic "set pager" 961.Ic "set pager"
963option. 962option.
964.It Ic passive Op Cm auto 963.It Ic passive Op Cm auto
965Toggle passive mode (if no arguments are given). 964Toggle passive mode (if no arguments are given).
966If 965If
967.Cm auto 966.Cm auto
968is given, act as if 967is given, act as if
969.Ev FTPMODE 968.Ev FTPMODE
970is set to 969is set to
971.Sq auto . 970.Sq auto .
972If passive mode is turned on (default), 971If passive mode is turned on (default),
973.Nm 972.Nm
974will send a 973will send a
975.Dv PASV 974.Dv PASV
976command for all data connections instead of a 975command for all data connections instead of a
977.Dv PORT 976.Dv PORT
978command. 977command.
979The 978The
980.Dv PASV 979.Dv PASV
981command requests that the remote server open a port for the data connection 980command requests that the remote server open a port for the data connection
982and return the address of that port. 981and return the address of that port.
983The remote server listens on that port and the client connects to it. 982The remote server listens on that port and the client connects to it.
984When using the more traditional 983When using the more traditional
985.Dv PORT 984.Dv PORT
986command, the client listens on a port and sends that address to the remote 985command, the client listens on a port and sends that address to the remote
987server, who connects back to it. 986server, who connects back to it.
988Passive mode is useful when using 987Passive mode is useful when using
989.Nm 988.Nm
990through a gateway router or host that controls the directionality of 989through a gateway router or host that controls the directionality of
991traffic. 990traffic.
992(Note that though 991(Note that though
993.Tn FTP 992.Tn FTP
994servers are required to support the 993servers are required to support the
995.Dv PASV 994.Dv PASV
996command by 995command by
997.Li RFC 1123 , 996.Li RFC 1123 ,
998some do not.) 997some do not.)
999.It Ic pdir Op Ar remote-path 998.It Ic pdir Op Ar remote-path
1000Perform 999Perform
1001.Ic dir 1000.Ic dir
1002.Op Ar remote-path , 1001.Op Ar remote-path ,
1003and display the result with the program specified by the 1002and display the result with the program specified by the
1004.Ic "set pager" 1003.Ic "set pager"
1005option. 1004option.
1006.It Ic pls Op Ar remote-path 1005.It Ic pls Op Ar remote-path
1007Perform 1006Perform
1008.Ic ls 1007.Ic ls
1009.Op Ar remote-path , 1008.Op Ar remote-path ,
1010and display the result with the program specified by the 1009and display the result with the program specified by the
1011.Ic "set pager" 1010.Ic "set pager"
1012option. 1011option.
1013.It Ic pmlsd Op Ar remote-path 1012.It Ic pmlsd Op Ar remote-path
1014Perform 1013Perform
1015.Ic mlsd 1014.Ic mlsd
1016.Op Ar remote-path , 1015.Op Ar remote-path ,
1017and display the result with the program specified by the 1016and display the result with the program specified by the
1018.Ic "set pager" 1017.Ic "set pager"
1019option. 1018option.
1020.It Ic preserve 1019.It Ic preserve
1021Toggle preservation of modification times on retrieved files. 1020Toggle preservation of modification times on retrieved files.
1022.It Ic progress 1021.It Ic progress
1023Toggle display of transfer progress bar. 1022Toggle display of transfer progress bar.
1024The progress bar will be disabled for a transfer that has 1023The progress bar will be disabled for a transfer that has
1025.Ar local-file 1024.Ar local-file
1026as 1025as
1027.Sq Fl 1026.Sq Fl
1028or a command that starts with 1027or a command that starts with
1029.Sq \&| . 1028.Sq \&| .
1030Refer to 1029Refer to
1031.Sx FILE NAMING CONVENTIONS 1030.Sx FILE NAMING CONVENTIONS
1032for more information. 1031for more information.
1033Enabling 1032Enabling
1034.Ic progress 1033.Ic progress
1035disables 1034disables
1036.Ic hash . 1035.Ic hash .
1037.It Ic prompt 1036.It Ic prompt
1038Toggle interactive prompting. 1037Toggle interactive prompting.
1039Interactive prompting 1038Interactive prompting
1040occurs during multiple file transfers to allow the 1039occurs during multiple file transfers to allow the
1041user to selectively retrieve or store files. 1040user to selectively retrieve or store files.
1042If prompting is turned off (default is on), any 1041If prompting is turned off (default is on), any
1043.Ic mget 1042.Ic mget
1044or 1043or
1045.Ic mput 1044.Ic mput
1046will transfer all files, and any 1045will transfer all files, and any
1047.Ic mdelete 1046.Ic mdelete
1048will delete all files. 1047will delete all files.
1049.Pp 1048.Pp
1050When prompting is on, the following commands are available at a prompt: 1049When prompting is on, the following commands are available at a prompt:
1051.Bl -tag -width 2n -offset indent 1050.Bl -tag -width 2n -offset indent
1052.It Cm a 1051.It Cm a
1053Answer 1052Answer
1054.Sq yes 1053.Sq yes
1055to the current file, and automatically answer 1054to the current file, and automatically answer
1056.Sq yes 1055.Sq yes
1057to any remaining files for the current command. 1056to any remaining files for the current command.
1058.It Cm n 1057.It Cm n
1059Answer 1058Answer
1060.Sq no , 1059.Sq no ,
1061and do not transfer the file. 1060and do not transfer the file.
1062.It Cm p 1061.It Cm p
1063Answer 1062Answer
1064.Sq yes 1063.Sq yes
1065to the current file, and turn off prompt mode 1064to the current file, and turn off prompt mode
1066(as is 1065(as is
1067.Dq prompt off 1066.Dq prompt off
1068had been given). 1067had been given).
1069.It Cm q 1068.It Cm q
1070Terminate the current operation. 1069Terminate the current operation.
1071.It Cm y 1070.It Cm y
1072Answer 1071Answer
1073.Sq yes , 1072.Sq yes ,
1074and transfer the file. 1073and transfer the file.
1075.It Cm \&? 1074.It Cm \&?
1076Display a help message. 1075Display a help message.
1077.El 1076.El
1078.Pp 1077.Pp
1079Any other response will answer 1078Any other response will answer
1080.Sq yes 1079.Sq yes
1081to the current file. 1080to the current file.
1082.It Ic proxy Ar ftp-command 1081.It Ic proxy Ar ftp-command
1083Execute an ftp command on a secondary control connection. 1082Execute an ftp command on a secondary control connection.
1084This command allows simultaneous connection to two remote 1083This command allows simultaneous connection to two remote
1085.Tn FTP 1084.Tn FTP
1086servers for transferring files between the two servers. 1085servers for transferring files between the two servers.
1087The first 1086The first
1088.Ic proxy 1087.Ic proxy
1089command should be an 1088command should be an
1090.Ic open , 1089.Ic open ,
1091to establish the secondary control connection. 1090to establish the secondary control connection.
1092Enter the command "proxy ?" to see other 1091Enter the command "proxy ?" to see other
1093.Tn FTP 1092.Tn FTP
1094commands executable on the secondary connection. 1093commands executable on the secondary connection.
1095The following commands behave differently when prefaced by 1094The following commands behave differently when prefaced by
1096.Ic proxy : 1095.Ic proxy :
1097.Ic open 1096.Ic open
1098will not define new macros during the auto-login process, 1097will not define new macros during the auto-login process,
1099.Ic close 1098.Ic close
1100will not erase existing macro definitions, 1099will not erase existing macro definitions,
1101.Ic get 1100.Ic get
1102and 1101and
1103.Ic mget 1102.Ic mget
1104transfer files from the host on the primary control connection 1103transfer files from the host on the primary control connection
1105to the host on the secondary control connection, and 1104to the host on the secondary control connection, and
1106.Ic put , 1105.Ic put ,
1107.Ic mput , 1106.Ic mput ,
1108and 1107and
1109.Ic append 1108.Ic append
1110transfer files from the host on the secondary control connection 1109transfer files from the host on the secondary control connection
1111to the host on the primary control connection. 1110to the host on the primary control connection.
1112Third party file transfers depend upon support of the 1111Third party file transfers depend upon support of the
1113.Tn FTP 1112.Tn FTP
1114protocol 1113protocol
1115.Dv PASV 1114.Dv PASV
1116command by the server on the secondary control connection. 1115command by the server on the secondary control connection.
1117.It Ic put Ar local-file Op Ar remote-file 1116.It Ic put Ar local-file Op Ar remote-file
1118Store a local file on the remote machine. 1117Store a local file on the remote machine.
1119If 1118If
1120.Ar remote-file 1119.Ar remote-file
1121is left unspecified, the local file name is used 1120is left unspecified, the local file name is used
1122after processing according to any 1121after processing according to any
1123.Ic ntrans 1122.Ic ntrans
1124or 1123or
1125.Ic nmap 1124.Ic nmap
1126settings 1125settings
1127in naming the remote file. 1126in naming the remote file.
1128File transfer uses the 1127File transfer uses the
1129current settings for 1128current settings for
1130.Ic type , 1129.Ic type ,
1131.Ic format , 1130.Ic format ,
1132.Ic mode , 1131.Ic mode ,
1133and 1132and
1134.Ic structure . 1133.Ic structure .
1135.It Ic pwd 1134.It Ic pwd
1136Print the name of the current working directory on the remote 1135Print the name of the current working directory on the remote
1137machine. 1136machine.
1138.It Ic quit 1137.It Ic quit
1139A synonym for 1138A synonym for
1140.Ic bye . 1139.Ic bye .
1141.It Ic quote Ar arg1 arg2 ... 1140.It Ic quote Ar arg1 arg2 ...
1142The arguments specified are sent, verbatim, to the remote 1141The arguments specified are sent, verbatim, to the remote
1143.Tn FTP 1142.Tn FTP
1144server. 1143server.
1145.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc 1144.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc
1146Throttle the maximum transfer rate to 1145Throttle the maximum transfer rate to
1147.Ar maximum 1146.Ar maximum
1148bytes/second. 1147bytes/second.
1149If 1148If
1150.Ar maximum 1149.Ar maximum
1151is 0, disable the throttle. 1150is 0, disable the throttle.
1152.Pp 1151.Pp
1153.Ar direction 1152.Ar direction
1154may be one of: 1153may be one of:
1155.Bl -tag -width "all" -offset indent -compact 1154.Bl -tag -width "all" -offset indent -compact
1156.It Cm all 1155.It Cm all
1157Both directions. 1156Both directions.
1158.It Cm get 1157.It Cm get
1159Incoming transfers. 1158Incoming transfers.
1160.It Cm put 1159.It Cm put
1161Outgoing transfers. 1160Outgoing transfers.
1162.El 1161.El
1163.Pp 1162.Pp
1164.Ar maximum 1163.Ar maximum
1165can be modified on the fly by 1164can be modified on the fly by
1166.Ar increment 1165.Ar increment
1167bytes (default: 1024) each time a given signal is received: 1166bytes (default: 1024) each time a given signal is received:
1168.Bl -tag -width "SIGUSR1" -offset indent 1167.Bl -tag -width "SIGUSR1" -offset indent
1169.It Dv SIGUSR1 1168.It Dv SIGUSR1
1170Increment 1169Increment
1171.Ar maximum 1170.Ar maximum
1172by 1171by
1173.Ar increment 1172.Ar increment
1174bytes. 1173bytes.
1175.It Dv SIGUSR2 1174.It Dv SIGUSR2
1176Decrement 1175Decrement
1177.Ar maximum 1176.Ar maximum
1178by 1177by
1179.Ar increment 1178.Ar increment
1180bytes. 1179bytes.
1181The result must be a positive number. 1180The result must be a positive number.
1182.El 1181.El
1183.Pp 1182.Pp
1184If 1183If
1185.Ar maximum 1184.Ar maximum
1186is not supplied, the current throttle rates are displayed. 1185is not supplied, the current throttle rates are displayed.
1187.Pp 1186.Pp
1188Note: 1187Note:
1189.Ic rate 1188.Ic rate
1190is not yet implemented for ascii mode transfers. 1189is not yet implemented for ascii mode transfers.
1191.It Ic rcvbuf Ar size 1190.It Ic rcvbuf Ar size
1192Set the size of the socket receive buffer to 1191Set the size of the socket receive buffer to
1193.Ar size . 1192.Ar size .
1194.It Ic recv Ar remote-file Op Ar local-file 1193.It Ic recv Ar remote-file Op Ar local-file
1195A synonym for 1194A synonym for
1196.Ic get . 1195.Ic get .
1197.It Ic reget Ar remote-file Op Ar local-file 1196.It Ic reget Ar remote-file Op Ar local-file
1198.Ic reget 1197.Ic reget
1199acts like 1198acts like
1200.Ic get , 1199.Ic get ,
1201except that if 1200except that if
1202.Ar local-file 1201.Ar local-file
1203exists and is 1202exists and is
1204smaller than 1203smaller than
1205.Ar remote-file , 1204.Ar remote-file ,
1206.Ar local-file 1205.Ar local-file
1207is presumed to be 1206is presumed to be
1208a partially transferred copy of 1207a partially transferred copy of
1209.Ar remote-file 1208.Ar remote-file
1210and the transfer 1209and the transfer
1211is continued from the apparent point of failure. 1210is continued from the apparent point of failure.
1212This command 1211This command
1213is useful when transferring very large files over networks that 1212is useful when transferring very large files over networks that
1214are prone to dropping connections. 1213are prone to dropping connections.
1215.It Ic remopts Ar command Op Ar command-options 1214.It Ic remopts Ar command Op Ar command-options
1216Set options on the remote 1215Set options on the remote
1217.Tn FTP 1216.Tn FTP
1218server for 1217server for
1219.Ar command 1218.Ar command
1220to 1219to
1221.Ar command-options 1220.Ar command-options
1222(whose absence is handled on a command-specific basis). 1221(whose absence is handled on a command-specific basis).
1223Remote 1222Remote
1224.Tn FTP 1223.Tn FTP
1225commands known to support options include: 1224commands known to support options include:
1226.Sq MLST 1225.Sq MLST
1227(used for 1226(used for
1228.Dv MLSD 1227.Dv MLSD
1229and 1228and
1230.Dv MLST ) . 1229.Dv MLST ) .
1231.It Ic rename Op Ar from Op Ar to 1230.It Ic rename Op Ar from Op Ar to
1232Rename the file 1231Rename the file
1233.Ar from 1232.Ar from
1234on the remote machine, to the file 1233on the remote machine, to the file
1235.Ar to . 1234.Ar to .
1236.It Ic reset 1235.It Ic reset
1237Clear reply queue. 1236Clear reply queue.
1238This command re-synchronizes command/reply sequencing with the remote 1237This command re-synchronizes command/reply sequencing with the remote
1239.Tn FTP 1238.Tn FTP
1240server. 1239server.
1241Resynchronization may be necessary following a violation of the 1240Resynchronization may be necessary following a violation of the
1242.Tn FTP 1241.Tn FTP
1243protocol by the remote server. 1242protocol by the remote server.
1244.It Ic restart Ar marker 1243.It Ic restart Ar marker
1245Restart the immediately following 1244Restart the immediately following
1246.Ic get 1245.Ic get
1247or 1246or
1248.Ic put 1247.Ic put
1249at the 1248at the
1250indicated 1249indicated
1251.Ar marker . 1250.Ar marker .
1252On 1251On
1253.Ux 1252.Ux
1254systems, marker is usually a byte 1253systems, marker is usually a byte
1255offset into the file. 1254offset into the file.
1256.It Ic rhelp Op Ar command-name 1255.It Ic rhelp Op Ar command-name
1257Request help from the remote 1256Request help from the remote
1258.Tn FTP 1257.Tn FTP
1259server. 1258server.
1260If a 1259If a
1261.Ar command-name 1260.Ar command-name
1262is specified it is supplied to the server as well. 1261is specified it is supplied to the server as well.
1263.It Ic rmdir Ar directory-name 1262.It Ic rmdir Ar directory-name
1264Delete a directory on the remote machine. 1263Delete a directory on the remote machine.
1265.It Ic rstatus Op Ar remote-file 1264.It Ic rstatus Op Ar remote-file
1266With no arguments, show status of remote machine. 1265With no arguments, show status of remote machine.
1267If 1266If
1268.Ar remote-file 1267.Ar remote-file
1269is specified, show status of 1268is specified, show status of
1270.Ar remote-file 1269.Ar remote-file
1271on remote machine. 1270on remote machine.
1272.It Ic runique 1271.It Ic runique
1273Toggle storing of files on the local system with unique filenames. 1272Toggle storing of files on the local system with unique filenames.
1274If a file already exists with a name equal to the target 1273If a file already exists with a name equal to the target
1275local filename for a 1274local filename for a
1276.Ic get 1275.Ic get
1277or 1276or
1278.Ic mget 1277.Ic mget
1279command, a ".1" is appended to the name. 1278command, a ".1" is appended to the name.
1280If the resulting name matches another existing file, 1279If the resulting name matches another existing file,
1281a ".2" is appended to the original name. 1280a ".2" is appended to the original name.
1282If this process continues up to ".99", an error 1281If this process continues up to ".99", an error
1283message is printed, and the transfer does not take place. 1282message is printed, and the transfer does not take place.
1284The generated unique filename will be reported. 1283The generated unique filename will be reported.
1285Note that 1284Note that