xref: /freebsd/contrib/tnftp/src/ftp.1 (revision 935205e2307611615ed5a7fe0a32b225ffd8c19c)
1*cc361f65SGavin Atkinson.\" 	$NetBSD: ftp.1,v 1.13 2009/11/15 10:12:37 lukem Exp $
2*cc361f65SGavin Atkinson.\" 	from	NetBSD: ftp.1,v 1.130 2009/07/11 18:35:48 joerg Exp
3f982db4aSGavin Atkinson.\"
4*cc361f65SGavin Atkinson.\" Copyright (c) 1996-2008 The NetBSD Foundation, Inc.
5f982db4aSGavin Atkinson.\" All rights reserved.
6f982db4aSGavin Atkinson.\"
7f982db4aSGavin Atkinson.\" This code is derived from software contributed to The NetBSD Foundation
8f982db4aSGavin Atkinson.\" by Luke Mewburn.
9f982db4aSGavin Atkinson.\"
10f982db4aSGavin Atkinson.\" Redistribution and use in source and binary forms, with or without
11f982db4aSGavin Atkinson.\" modification, are permitted provided that the following conditions
12f982db4aSGavin Atkinson.\" are met:
13f982db4aSGavin Atkinson.\" 1. Redistributions of source code must retain the above copyright
14f982db4aSGavin Atkinson.\"    notice, this list of conditions and the following disclaimer.
15f982db4aSGavin Atkinson.\" 2. Redistributions in binary form must reproduce the above copyright
16f982db4aSGavin Atkinson.\"    notice, this list of conditions and the following disclaimer in the
17f982db4aSGavin Atkinson.\"    documentation and/or other materials provided with the distribution.
18f982db4aSGavin Atkinson.\"
19f982db4aSGavin Atkinson.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20f982db4aSGavin Atkinson.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21f982db4aSGavin Atkinson.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22f982db4aSGavin Atkinson.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23f982db4aSGavin Atkinson.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24f982db4aSGavin Atkinson.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25f982db4aSGavin Atkinson.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26f982db4aSGavin Atkinson.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27f982db4aSGavin Atkinson.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28f982db4aSGavin Atkinson.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29f982db4aSGavin Atkinson.\" POSSIBILITY OF SUCH DAMAGE.
30f982db4aSGavin Atkinson.\"
31f982db4aSGavin Atkinson.\"
32f982db4aSGavin Atkinson.\" Copyright (c) 1985, 1989, 1990, 1993
33f982db4aSGavin Atkinson.\"	The Regents of the University of California.  All rights reserved.
34f982db4aSGavin Atkinson.\"
35f982db4aSGavin Atkinson.\" Redistribution and use in source and binary forms, with or without
36f982db4aSGavin Atkinson.\" modification, are permitted provided that the following conditions
37f982db4aSGavin Atkinson.\" are met:
38f982db4aSGavin Atkinson.\" 1. Redistributions of source code must retain the above copyright
39f982db4aSGavin Atkinson.\"    notice, this list of conditions and the following disclaimer.
40f982db4aSGavin Atkinson.\" 2. Redistributions in binary form must reproduce the above copyright
41f982db4aSGavin Atkinson.\"    notice, this list of conditions and the following disclaimer in the
42f982db4aSGavin Atkinson.\"    documentation and/or other materials provided with the distribution.
43f982db4aSGavin Atkinson.\" 3. Neither the name of the University nor the names of its contributors
44f982db4aSGavin Atkinson.\"    may be used to endorse or promote products derived from this software
45f982db4aSGavin Atkinson.\"    without specific prior written permission.
46f982db4aSGavin Atkinson.\"
47f982db4aSGavin Atkinson.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
48f982db4aSGavin Atkinson.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
49f982db4aSGavin Atkinson.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
50f982db4aSGavin Atkinson.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
51f982db4aSGavin Atkinson.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
52f982db4aSGavin Atkinson.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
53f982db4aSGavin Atkinson.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
54f982db4aSGavin Atkinson.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
55f982db4aSGavin Atkinson.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
56f982db4aSGavin Atkinson.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57f982db4aSGavin Atkinson.\" SUCH DAMAGE.
58f982db4aSGavin Atkinson.\"
59f982db4aSGavin Atkinson.\"	@(#)ftp.1	8.3 (Berkeley) 10/9/94
60f982db4aSGavin Atkinson.\"
61*cc361f65SGavin Atkinson.Dd May 10, 2008
62f982db4aSGavin Atkinson.Dt FTP 1
63f982db4aSGavin Atkinson.Os
64f982db4aSGavin Atkinson.Sh NAME
65f982db4aSGavin Atkinson.Nm ftp
66*cc361f65SGavin Atkinson.Nd Internet file transfer program
67f982db4aSGavin Atkinson.Sh SYNOPSIS
68f982db4aSGavin Atkinson.Nm
69*cc361f65SGavin Atkinson.Op Fl 46AadefginpRtVv
70f982db4aSGavin Atkinson.Bk -words
71f982db4aSGavin Atkinson.Op Fl N Ar netrc
72f982db4aSGavin Atkinson.Ek
73f982db4aSGavin Atkinson.Bk -words
74f982db4aSGavin Atkinson.Op Fl o Ar output
75f982db4aSGavin Atkinson.Ek
76f982db4aSGavin Atkinson.Bk -words
77f982db4aSGavin Atkinson.Op Fl P Ar port
78f982db4aSGavin Atkinson.Ek
79f982db4aSGavin Atkinson.Bk -words
80f982db4aSGavin Atkinson.Op Fl q Ar quittime
81f982db4aSGavin Atkinson.Ek
82f982db4aSGavin Atkinson.Bk -words
83f982db4aSGavin Atkinson.Op Fl r Ar retry
84f982db4aSGavin Atkinson.Ek
85*cc361f65SGavin Atkinson.Op Fl s Ar srcaddr
86f982db4aSGavin Atkinson.Bk -words
87f982db4aSGavin Atkinson.\" [-T dir,max[,inc]]
88f982db4aSGavin Atkinson.Oo
89f982db4aSGavin Atkinson.Fl T Xo
90f982db4aSGavin Atkinson.Sm off
91f982db4aSGavin Atkinson.Ar dir ,
92f982db4aSGavin Atkinson.Ar max
93f982db4aSGavin Atkinson.Op , Ar inc
94f982db4aSGavin Atkinson.Sm on
95f982db4aSGavin Atkinson.Xc
96f982db4aSGavin Atkinson.Oc
97f982db4aSGavin Atkinson.Ek
98f982db4aSGavin Atkinson.Bk -words
99f982db4aSGavin Atkinson.\" [[user@]host [port]]
100f982db4aSGavin Atkinson.Oo
101f982db4aSGavin Atkinson.Oo Ar user Ns Li \&@ Oc Ns Ar host
102f982db4aSGavin Atkinson.Op Ar port
103f982db4aSGavin Atkinson.Oc
104f982db4aSGavin Atkinson.Ek
105f982db4aSGavin Atkinson.Bk -words
106f982db4aSGavin Atkinson.\" [[user@]host:[path][/]]
107f982db4aSGavin Atkinson.Sm off
108f982db4aSGavin Atkinson.Oo
109f982db4aSGavin Atkinson.Op Ar user Li \&@
110f982db4aSGavin Atkinson.Ar host Li \&:
111f982db4aSGavin Atkinson.Op Ar path
112f982db4aSGavin Atkinson.Op Li /
113f982db4aSGavin Atkinson.Oc
114f982db4aSGavin Atkinson.Sm on
115f982db4aSGavin Atkinson.Ek
116f982db4aSGavin Atkinson.Bk -words
117f982db4aSGavin Atkinson.\" [file:///path]
118f982db4aSGavin Atkinson.Sm off
119f982db4aSGavin Atkinson.Oo
120f982db4aSGavin Atkinson.Li file:/// Ar path
121f982db4aSGavin Atkinson.Oc
122f982db4aSGavin Atkinson.Sm on
123f982db4aSGavin Atkinson.Ek
124f982db4aSGavin Atkinson.Bk -words
125f982db4aSGavin Atkinson.\" [ftp://[user[:password]@]host[:port]/path[/]]
126f982db4aSGavin Atkinson.Sm off
127f982db4aSGavin Atkinson.Oo
128f982db4aSGavin Atkinson.Li ftp://
129f982db4aSGavin Atkinson.Oo Ar user
130f982db4aSGavin Atkinson.Op Li \&: Ar password
131f982db4aSGavin Atkinson.Li \&@ Oc
132f982db4aSGavin Atkinson.Ar host Oo Li \&: Ar port Oc
133f982db4aSGavin Atkinson.Li / Ar path
134f982db4aSGavin Atkinson.Op Li /
135f982db4aSGavin Atkinson.Op Li ;type= Ar X
136f982db4aSGavin Atkinson.Oc
137f982db4aSGavin Atkinson.Sm on
138f982db4aSGavin Atkinson.Ek
139f982db4aSGavin Atkinson.Bk -words
140f982db4aSGavin Atkinson.\" [http://[user[:password]@]host[:port]/path]
141f982db4aSGavin Atkinson.Sm off
142f982db4aSGavin Atkinson.Oo
143f982db4aSGavin Atkinson.Li http://
144f982db4aSGavin Atkinson.Oo Ar user
145f982db4aSGavin Atkinson.Op Li \&: Ar password
146f982db4aSGavin Atkinson.Li \&@ Oc
147f982db4aSGavin Atkinson.Ar host Oo Li \&: Ar port Oc
148f982db4aSGavin Atkinson.Li / Ar path
149f982db4aSGavin Atkinson.Oc
150f982db4aSGavin Atkinson.Sm on
151f982db4aSGavin Atkinson.Ek
152f982db4aSGavin Atkinson.Op Ar \&.\&.\&.
153f982db4aSGavin Atkinson.Nm
154f982db4aSGavin Atkinson.Bk -words
155f982db4aSGavin Atkinson.Fl u Ar URL Ar file
156f982db4aSGavin Atkinson.Ek
157f982db4aSGavin Atkinson.Op Ar \&.\&.\&.
158f982db4aSGavin Atkinson.Sh DESCRIPTION
159f982db4aSGavin Atkinson.Nm
160f982db4aSGavin Atkinsonis the user interface to the Internet standard File Transfer Protocol.
161f982db4aSGavin AtkinsonThe program allows a user to transfer files to and from a
162f982db4aSGavin Atkinsonremote network site.
163f982db4aSGavin Atkinson.Pp
164f982db4aSGavin AtkinsonThe last five arguments will fetch a file using the
165f982db4aSGavin Atkinson.Tn FTP
166f982db4aSGavin Atkinsonor
167f982db4aSGavin Atkinson.Tn HTTP
168f982db4aSGavin Atkinsonprotocols, or by direct copying, into the current directory.
169f982db4aSGavin AtkinsonThis is ideal for scripts.
170f982db4aSGavin AtkinsonRefer to
171f982db4aSGavin Atkinson.Sx AUTO-FETCHING FILES
172f982db4aSGavin Atkinsonbelow for more information.
173f982db4aSGavin Atkinson.Pp
174f982db4aSGavin AtkinsonOptions may be specified at the command line, or to the
175f982db4aSGavin Atkinsoncommand interpreter.
176*cc361f65SGavin Atkinson.Bl -tag -width Fl
177f982db4aSGavin Atkinson.It Fl 4
178f982db4aSGavin AtkinsonForces
179f982db4aSGavin Atkinson.Nm
180f982db4aSGavin Atkinsonto only use IPv4 addresses.
181f982db4aSGavin Atkinson.It Fl 6
182f982db4aSGavin AtkinsonForces
183f982db4aSGavin Atkinson.Nm
184f982db4aSGavin Atkinsonto only use IPv6 addresses.
185f982db4aSGavin Atkinson.It Fl A
186f982db4aSGavin AtkinsonForce active mode ftp.
187f982db4aSGavin AtkinsonBy default,
188f982db4aSGavin Atkinson.Nm
189f982db4aSGavin Atkinsonwill try to use passive mode ftp and fall back to active mode
190f982db4aSGavin Atkinsonif passive is not supported by the server.
191f982db4aSGavin AtkinsonThis option causes
192f982db4aSGavin Atkinson.Nm
193f982db4aSGavin Atkinsonto always use an active connection.
194f982db4aSGavin AtkinsonIt is only useful for connecting to very old servers that do not
195f982db4aSGavin Atkinsonimplement passive mode properly.
196f982db4aSGavin Atkinson.It Fl a
197f982db4aSGavin AtkinsonCauses
198f982db4aSGavin Atkinson.Nm
199f982db4aSGavin Atkinsonto bypass normal login procedure, and use an anonymous login instead.
200f982db4aSGavin Atkinson.It Fl d
201f982db4aSGavin AtkinsonEnables debugging.
202f982db4aSGavin Atkinson.It Fl e
203f982db4aSGavin AtkinsonDisables command line editing.
204f982db4aSGavin AtkinsonThis is useful for Emacs ange-ftp mode.
205f982db4aSGavin Atkinson.It Fl f
206f982db4aSGavin AtkinsonForces a cache reload for transfers that go through the
207f982db4aSGavin Atkinson.Tn FTP
208f982db4aSGavin Atkinsonor
209f982db4aSGavin Atkinson.Tn HTTP
210f982db4aSGavin Atkinsonproxies.
211f982db4aSGavin Atkinson.It Fl g
212f982db4aSGavin AtkinsonDisables file name globbing.
213f982db4aSGavin Atkinson.It Fl i
214f982db4aSGavin AtkinsonTurns off interactive prompting during
215f982db4aSGavin Atkinsonmultiple file transfers.
216*cc361f65SGavin Atkinson.It Fl N Ar netrc
217*cc361f65SGavin AtkinsonUse
218*cc361f65SGavin Atkinson.Ar netrc
219*cc361f65SGavin Atkinsoninstead of
220*cc361f65SGavin Atkinson.Pa ~/.netrc .
221*cc361f65SGavin AtkinsonRefer to
222*cc361f65SGavin Atkinson.Sx THE .netrc FILE
223*cc361f65SGavin Atkinsonfor more information.
224f982db4aSGavin Atkinson.It Fl n
225f982db4aSGavin AtkinsonRestrains
226f982db4aSGavin Atkinson.Nm
227f982db4aSGavin Atkinsonfrom attempting
228f982db4aSGavin Atkinson.Dq auto-login
229f982db4aSGavin Atkinsonupon initial connection for non auto-fetch transfers.
230f982db4aSGavin AtkinsonIf auto-login is enabled,
231f982db4aSGavin Atkinson.Nm
232f982db4aSGavin Atkinsonwill check the
233f982db4aSGavin Atkinson.Pa .netrc
234f982db4aSGavin Atkinson(see below) file in the user's home directory for an entry describing
235f982db4aSGavin Atkinsonan account on the remote machine.
236f982db4aSGavin AtkinsonIf no entry exists,
237f982db4aSGavin Atkinson.Nm
238f982db4aSGavin Atkinsonwill prompt for the remote machine login name (default is the user
239f982db4aSGavin Atkinsonidentity on the local machine), and, if necessary, prompt for a password
240f982db4aSGavin Atkinsonand an account with which to login.
241f982db4aSGavin AtkinsonTo override the auto-login for auto-fetch transfers, specify the
242f982db4aSGavin Atkinsonusername (and optionally, password) as appropriate.
243f982db4aSGavin Atkinson.It Fl o Ar output
244f982db4aSGavin AtkinsonWhen auto-fetching files, save the contents in
245f982db4aSGavin Atkinson.Ar output .
246f982db4aSGavin Atkinson.Ar output
247f982db4aSGavin Atkinsonis parsed according to the
248f982db4aSGavin Atkinson.Sx FILE NAMING CONVENTIONS
249f982db4aSGavin Atkinsonbelow.
250f982db4aSGavin AtkinsonIf
251f982db4aSGavin Atkinson.Ar output
252f982db4aSGavin Atkinsonis not
253f982db4aSGavin Atkinson.Sq -
254f982db4aSGavin Atkinsonor doesn't start with
255f982db4aSGavin Atkinson.Sq \&| ,
256f982db4aSGavin Atkinsonthen only the first file specified will be retrieved into
257f982db4aSGavin Atkinson.Ar output ;
258f982db4aSGavin Atkinsonall other files will be retrieved into the basename of their
259f982db4aSGavin Atkinsonremote name.
260*cc361f65SGavin Atkinson.It Fl P Ar port
261*cc361f65SGavin AtkinsonSets the port number to
262*cc361f65SGavin Atkinson.Ar port .
263f982db4aSGavin Atkinson.It Fl p
264f982db4aSGavin AtkinsonEnable passive mode operation for use behind connection filtering firewalls.
265f982db4aSGavin AtkinsonThis option has been deprecated as
266f982db4aSGavin Atkinson.Nm
267f982db4aSGavin Atkinsonnow tries to use passive mode by default, falling back to active mode
268f982db4aSGavin Atkinsonif the server does not support passive connections.
269f982db4aSGavin Atkinson.It Fl q Ar quittime
270f982db4aSGavin AtkinsonQuit if the connection has stalled for
271f982db4aSGavin Atkinson.Ar quittime
272f982db4aSGavin Atkinsonseconds.
273f982db4aSGavin Atkinson.It Fl R
274f982db4aSGavin AtkinsonRestart all non-proxied auto-fetches.
275*cc361f65SGavin Atkinson.It Fl r Ar wait
276*cc361f65SGavin AtkinsonRetry the connection attempt if it failed, pausing for
277*cc361f65SGavin Atkinson.Ar wait
278*cc361f65SGavin Atkinsonseconds.
279*cc361f65SGavin Atkinson.It Fl s Ar srcaddr
280*cc361f65SGavin AtkinsonUses
281*cc361f65SGavin Atkinson.Ar srcaddr
282*cc361f65SGavin Atkinsonas the local IP address for all connections.
283f982db4aSGavin Atkinson.It Fl t
284f982db4aSGavin AtkinsonEnables packet tracing.
285*cc361f65SGavin Atkinson.It Fl T Ar direction Ns , Ns Ar maximum Ns Oo , Ns Ar increment Oc
286f982db4aSGavin AtkinsonSet the maximum transfer rate for
287f982db4aSGavin Atkinson.Ar direction
288f982db4aSGavin Atkinsonto
289f982db4aSGavin Atkinson.Ar maximum
290f982db4aSGavin Atkinsonbytes/second,
291f982db4aSGavin Atkinsonand if specified, the increment to
292f982db4aSGavin Atkinson.Ar increment
293f982db4aSGavin Atkinsonbytes/second.
294f982db4aSGavin AtkinsonRefer to
295f982db4aSGavin Atkinson.Ic rate
296f982db4aSGavin Atkinsonfor more information.
297f982db4aSGavin Atkinson.It Fl u Ar URL file Op \&.\&.\&.
298f982db4aSGavin AtkinsonUpload files on the command line to
299f982db4aSGavin Atkinson.Ar URL
300f982db4aSGavin Atkinsonwhere
301f982db4aSGavin Atkinson.Ar URL
302f982db4aSGavin Atkinsonis one of the ftp URL types as supported by auto-fetch
303f982db4aSGavin Atkinson(with an optional target filename for single file uploads), and
304f982db4aSGavin Atkinson.Ar file
305f982db4aSGavin Atkinsonis one or more local files to be uploaded.
306*cc361f65SGavin Atkinson.It Fl V
307*cc361f65SGavin AtkinsonDisable
308*cc361f65SGavin Atkinson.Ic verbose
309*cc361f65SGavin Atkinsonand
310*cc361f65SGavin Atkinson.Ic progress ,
311*cc361f65SGavin Atkinsonoverriding the default of enabled when output is to a terminal.
312f982db4aSGavin Atkinson.It Fl v
313f982db4aSGavin AtkinsonEnable
314f982db4aSGavin Atkinson.Ic verbose
315f982db4aSGavin Atkinsonand
316f982db4aSGavin Atkinson.Ic progress .
317f982db4aSGavin AtkinsonThis is the default if output is to a terminal (and in the case of
318f982db4aSGavin Atkinson.Ic progress ,
319f982db4aSGavin Atkinson.Nm
320f982db4aSGavin Atkinsonis the foreground process).
321f982db4aSGavin AtkinsonForces
322f982db4aSGavin Atkinson.Nm
323f982db4aSGavin Atkinsonto show all responses from the remote server, as well
324f982db4aSGavin Atkinsonas report on data transfer statistics.
325f982db4aSGavin Atkinson.El
326f982db4aSGavin Atkinson.Pp
327f982db4aSGavin AtkinsonThe client host with which
328f982db4aSGavin Atkinson.Nm
329f982db4aSGavin Atkinsonis to communicate may be specified on the command line.
330f982db4aSGavin AtkinsonIf this is done,
331f982db4aSGavin Atkinson.Nm
332f982db4aSGavin Atkinsonwill immediately attempt to establish a connection to an
333f982db4aSGavin Atkinson.Tn FTP
334f982db4aSGavin Atkinsonserver on that host; otherwise,
335f982db4aSGavin Atkinson.Nm
336f982db4aSGavin Atkinsonwill enter its command interpreter and await instructions
337f982db4aSGavin Atkinsonfrom the user.
338f982db4aSGavin AtkinsonWhen
339f982db4aSGavin Atkinson.Nm
340f982db4aSGavin Atkinsonis awaiting commands from the user the prompt
341f982db4aSGavin Atkinson.Ql ftp\*[Gt]
342f982db4aSGavin Atkinsonis provided to the user.
343f982db4aSGavin AtkinsonThe following commands are recognized
344f982db4aSGavin Atkinsonby
345f982db4aSGavin Atkinson.Nm ftp :
346*cc361f65SGavin Atkinson.Bl -tag -width Ic
347f982db4aSGavin Atkinson.It Ic \&! Op Ar command Op Ar args
348f982db4aSGavin AtkinsonInvoke an interactive shell on the local machine.
349f982db4aSGavin AtkinsonIf there are arguments, the first is taken to be a command to execute
350f982db4aSGavin Atkinsondirectly, with the rest of the arguments as its arguments.
351f982db4aSGavin Atkinson.It Ic \&$ Ar macro-name Op Ar args
352f982db4aSGavin AtkinsonExecute the macro
353f982db4aSGavin Atkinson.Ar macro-name
354f982db4aSGavin Atkinsonthat was defined with the
355f982db4aSGavin Atkinson.Ic macdef
356f982db4aSGavin Atkinsoncommand.
357f982db4aSGavin AtkinsonArguments are passed to the macro unglobbed.
358f982db4aSGavin Atkinson.It Ic account Op Ar passwd
359f982db4aSGavin AtkinsonSupply a supplemental password required by a remote system for access
360f982db4aSGavin Atkinsonto resources once a login has been successfully completed.
361f982db4aSGavin AtkinsonIf no argument is included, the user will be prompted for an account
362f982db4aSGavin Atkinsonpassword in a non-echoing input mode.
363f982db4aSGavin Atkinson.It Ic append Ar local-file Op Ar remote-file
364f982db4aSGavin AtkinsonAppend a local file to a file on the remote machine.
365f982db4aSGavin AtkinsonIf
366f982db4aSGavin Atkinson.Ar remote-file
367f982db4aSGavin Atkinsonis left unspecified, the local file name is used in naming the
368f982db4aSGavin Atkinsonremote file after being altered by any
369f982db4aSGavin Atkinson.Ic ntrans
370f982db4aSGavin Atkinsonor
371f982db4aSGavin Atkinson.Ic nmap
372f982db4aSGavin Atkinsonsetting.
373f982db4aSGavin AtkinsonFile transfer uses the current settings for
374f982db4aSGavin Atkinson.Ic type  ,
375f982db4aSGavin Atkinson.Ic format ,
376f982db4aSGavin Atkinson.Ic mode  ,
377f982db4aSGavin Atkinsonand
378f982db4aSGavin Atkinson.Ic structure .
379f982db4aSGavin Atkinson.It Ic ascii
380f982db4aSGavin AtkinsonSet the file transfer
381f982db4aSGavin Atkinson.Ic type
382f982db4aSGavin Atkinsonto network
383f982db4aSGavin Atkinson.Tn ASCII .
384f982db4aSGavin AtkinsonThis is the default type.
385f982db4aSGavin Atkinson.It Ic bell
386f982db4aSGavin AtkinsonArrange that a bell be sounded after each file transfer
387f982db4aSGavin Atkinsoncommand is completed.
388f982db4aSGavin Atkinson.It Ic binary
389f982db4aSGavin AtkinsonSet the file transfer
390f982db4aSGavin Atkinson.Ic type
391f982db4aSGavin Atkinsonto support binary image transfer.
392f982db4aSGavin Atkinson.It Ic bye
393f982db4aSGavin AtkinsonTerminate the
394f982db4aSGavin Atkinson.Tn FTP
395f982db4aSGavin Atkinsonsession with the remote server
396f982db4aSGavin Atkinsonand exit
397f982db4aSGavin Atkinson.Nm ftp .
398f982db4aSGavin AtkinsonAn end of file will also terminate the session and exit.
399f982db4aSGavin Atkinson.It Ic case
400f982db4aSGavin AtkinsonToggle remote computer file name case mapping during
401f982db4aSGavin Atkinson.Ic get ,
402f982db4aSGavin Atkinson.Ic mget
403f982db4aSGavin Atkinsonand
404f982db4aSGavin Atkinson.Ic mput
405f982db4aSGavin Atkinsoncommands.
406f982db4aSGavin AtkinsonWhen
407f982db4aSGavin Atkinson.Ic case
408f982db4aSGavin Atkinsonis on (default is off), remote computer file names with all letters in
409f982db4aSGavin Atkinsonupper case are written in the local directory with the letters mapped
410f982db4aSGavin Atkinsonto lower case.
411f982db4aSGavin Atkinson.It Ic \&cd Ar remote-directory
412f982db4aSGavin AtkinsonChange the working directory on the remote machine
413f982db4aSGavin Atkinsonto
414f982db4aSGavin Atkinson.Ar remote-directory .
415f982db4aSGavin Atkinson.It Ic cdup
416f982db4aSGavin AtkinsonChange the remote machine working directory to the parent of the
417f982db4aSGavin Atkinsoncurrent remote machine working directory.
418f982db4aSGavin Atkinson.It Ic chmod Ar mode remote-file
419f982db4aSGavin AtkinsonChange the permission modes of the file
420f982db4aSGavin Atkinson.Ar remote-file
421f982db4aSGavin Atkinsonon the remote
422f982db4aSGavin Atkinsonsystem to
423f982db4aSGavin Atkinson.Ar mode .
424f982db4aSGavin Atkinson.It Ic close
425f982db4aSGavin AtkinsonTerminate the
426f982db4aSGavin Atkinson.Tn FTP
427f982db4aSGavin Atkinsonsession with the remote server, and
428f982db4aSGavin Atkinsonreturn to the command interpreter.
429f982db4aSGavin AtkinsonAny defined macros are erased.
430f982db4aSGavin Atkinson.It Ic \&cr
431f982db4aSGavin AtkinsonToggle carriage return stripping during
432f982db4aSGavin Atkinsonascii type file retrieval.
433f982db4aSGavin AtkinsonRecords are denoted by a carriage return/linefeed sequence
434f982db4aSGavin Atkinsonduring ascii type file transfer.
435f982db4aSGavin AtkinsonWhen
436f982db4aSGavin Atkinson.Ic \&cr
437f982db4aSGavin Atkinsonis on (the default), carriage returns are stripped from this
438f982db4aSGavin Atkinsonsequence to conform with the
439f982db4aSGavin Atkinson.Ux
440f982db4aSGavin Atkinsonsingle linefeed record
441f982db4aSGavin Atkinsondelimiter.
442f982db4aSGavin AtkinsonRecords on
443f982db4aSGavin Atkinson.Pf non\- Ns Ux
444f982db4aSGavin Atkinsonremote systems may contain single linefeeds;
445f982db4aSGavin Atkinsonwhen an ascii type transfer is made, these linefeeds may be
446f982db4aSGavin Atkinsondistinguished from a record delimiter only when
447f982db4aSGavin Atkinson.Ic \&cr
448f982db4aSGavin Atkinsonis off.
449f982db4aSGavin Atkinson.It Ic delete Ar remote-file
450f982db4aSGavin AtkinsonDelete the file
451f982db4aSGavin Atkinson.Ar remote-file
452f982db4aSGavin Atkinsonon the remote machine.
453f982db4aSGavin Atkinson.It Ic dir Op Ar remote-path Op Ar local-file
454f982db4aSGavin AtkinsonPrint a listing of the contents of a
455f982db4aSGavin Atkinsondirectory on the remote machine.
456f982db4aSGavin AtkinsonThe listing includes any system-dependent information that the server
457f982db4aSGavin Atkinsonchooses to include; for example, most
458f982db4aSGavin Atkinson.Ux
459f982db4aSGavin Atkinsonsystems will produce
460f982db4aSGavin Atkinsonoutput from the command
461f982db4aSGavin Atkinson.Ql ls \-l .
462f982db4aSGavin AtkinsonIf
463f982db4aSGavin Atkinson.Ar remote-path
464f982db4aSGavin Atkinsonis left unspecified, the current working directory is used.
465f982db4aSGavin AtkinsonIf interactive prompting is on,
466f982db4aSGavin Atkinson.Nm
467f982db4aSGavin Atkinsonwill prompt the user to verify that the last argument is indeed the
468f982db4aSGavin Atkinsontarget local file for receiving
469f982db4aSGavin Atkinson.Ic dir
470f982db4aSGavin Atkinsonoutput.
471f982db4aSGavin AtkinsonIf no local file is specified, or if
472f982db4aSGavin Atkinson.Ar local-file
473f982db4aSGavin Atkinsonis
474f982db4aSGavin Atkinson.Sq Fl ,
475f982db4aSGavin Atkinsonthe output is sent to the terminal.
476f982db4aSGavin Atkinson.It Ic disconnect
477f982db4aSGavin AtkinsonA synonym for
478f982db4aSGavin Atkinson.Ic close .
479f982db4aSGavin Atkinson.It Ic edit
480f982db4aSGavin AtkinsonToggle command line editing, and context sensitive command and file
481f982db4aSGavin Atkinsoncompletion.
482f982db4aSGavin AtkinsonThis is automatically enabled if input is from a terminal, and
483f982db4aSGavin Atkinsondisabled otherwise.
484*cc361f65SGavin Atkinson.It Ic epsv epsv4 epsv6
485f982db4aSGavin AtkinsonToggle the use of the extended
486f982db4aSGavin Atkinson.Dv EPSV
487f982db4aSGavin Atkinsonand
488f982db4aSGavin Atkinson.Dv EPRT
489*cc361f65SGavin Atkinsoncommands on all IP, IPv4, and IPv6 connections respectively.
490*cc361f65SGavin AtkinsonFirst try
491f982db4aSGavin Atkinson.Dv EPSV /
492f982db4aSGavin Atkinson.Dv EPRT ,
493f982db4aSGavin Atkinsonand then
494f982db4aSGavin Atkinson.Dv PASV /
495f982db4aSGavin Atkinson.Dv PORT .
496f982db4aSGavin AtkinsonThis is enabled by default.
497f982db4aSGavin AtkinsonIf an extended command fails then this option will be temporarily
498f982db4aSGavin Atkinsondisabled for the duration of the current connection, or until
499*cc361f65SGavin Atkinson.Ic epsv ,
500*cc361f65SGavin Atkinson.Ic epsv4 ,
501*cc361f65SGavin Atkinsonor
502*cc361f65SGavin Atkinson.Ic epsv6
503f982db4aSGavin Atkinsonis executed again.
504f982db4aSGavin Atkinson.It Ic exit
505f982db4aSGavin AtkinsonA synonym for
506f982db4aSGavin Atkinson.Ic bye .
507f982db4aSGavin Atkinson.It Ic features
508f982db4aSGavin AtkinsonDisplay what features the remote server supports (using the
509f982db4aSGavin Atkinson.Dv FEAT
510f982db4aSGavin Atkinsoncommand).
511f982db4aSGavin Atkinson.It Ic fget Ar localfile
512f982db4aSGavin AtkinsonRetrieve the files listed in
513f982db4aSGavin Atkinson.Ar localfile ,
514f982db4aSGavin Atkinsonwhich has one line per filename.
515f982db4aSGavin Atkinson.It Ic form Ar format
516f982db4aSGavin AtkinsonSet the file transfer
517f982db4aSGavin Atkinson.Ic form
518f982db4aSGavin Atkinsonto
519f982db4aSGavin Atkinson.Ar format .
520f982db4aSGavin AtkinsonThe default (and only supported)
521f982db4aSGavin Atkinsonformat is
522f982db4aSGavin Atkinson.Dq non-print .
523f982db4aSGavin Atkinson.It Ic ftp Ar host Op Ar port
524f982db4aSGavin AtkinsonA synonym for
525f982db4aSGavin Atkinson.Ic open .
526*cc361f65SGavin Atkinson.It Ic ftp_debug Op Ar ftp_debug-value
527*cc361f65SGavin AtkinsonToggle debugging mode.
528*cc361f65SGavin AtkinsonIf an optional
529*cc361f65SGavin Atkinson.Ar ftp_debug-value
530*cc361f65SGavin Atkinsonis specified it is used to set the debugging level.
531*cc361f65SGavin AtkinsonWhen debugging is on,
532*cc361f65SGavin Atkinson.Nm
533*cc361f65SGavin Atkinsonprints each command sent to the remote machine, preceded
534*cc361f65SGavin Atkinsonby the string
535*cc361f65SGavin Atkinson.Ql \-\-\*[Gt] .
536f982db4aSGavin Atkinson.It Ic gate Op Ar host Op Ar port
537f982db4aSGavin AtkinsonToggle gate-ftp mode, which used to connect through the
538f982db4aSGavin AtkinsonTIS FWTK and Gauntlet ftp proxies.
539f982db4aSGavin AtkinsonThis will not be permitted if the gate-ftp server hasn't been set
540f982db4aSGavin Atkinson(either explicitly by the user, or from the
541f982db4aSGavin Atkinson.Ev FTPSERVER
542f982db4aSGavin Atkinsonenvironment variable).
543f982db4aSGavin AtkinsonIf
544f982db4aSGavin Atkinson.Ar host
545f982db4aSGavin Atkinsonis given,
546f982db4aSGavin Atkinsonthen gate-ftp mode will be enabled, and the gate-ftp server will be set to
547f982db4aSGavin Atkinson.Ar host .
548f982db4aSGavin AtkinsonIf
549f982db4aSGavin Atkinson.Ar port
550f982db4aSGavin Atkinsonis also given, that will be used as the port to connect to on the
551f982db4aSGavin Atkinsongate-ftp server.
552f982db4aSGavin Atkinson.It Ic get Ar remote-file Op Ar local-file
553f982db4aSGavin AtkinsonRetrieve the
554f982db4aSGavin Atkinson.Ar remote-file
555f982db4aSGavin Atkinsonand store it on the local machine.
556f982db4aSGavin AtkinsonIf the local
557f982db4aSGavin Atkinsonfile name is not specified, it is given the same
558f982db4aSGavin Atkinsonname it has on the remote machine, subject to
559f982db4aSGavin Atkinsonalteration by the current
560f982db4aSGavin Atkinson.Ic case  ,
561f982db4aSGavin Atkinson.Ic ntrans ,
562f982db4aSGavin Atkinsonand
563f982db4aSGavin Atkinson.Ic nmap
564f982db4aSGavin Atkinsonsettings.
565f982db4aSGavin AtkinsonThe current settings for
566f982db4aSGavin Atkinson.Ic type  ,
567f982db4aSGavin Atkinson.Ic form ,
568f982db4aSGavin Atkinson.Ic mode  ,
569f982db4aSGavin Atkinsonand
570f982db4aSGavin Atkinson.Ic structure
571f982db4aSGavin Atkinsonare used while transferring the file.
572f982db4aSGavin Atkinson.It Ic glob
573f982db4aSGavin AtkinsonToggle filename expansion for
574f982db4aSGavin Atkinson.Ic mdelete  ,
575f982db4aSGavin Atkinson.Ic mget ,
576f982db4aSGavin Atkinson.Ic mput ,
577f982db4aSGavin Atkinsonand
578f982db4aSGavin Atkinson.Ic mreget .
579f982db4aSGavin AtkinsonIf globbing is turned off with
580f982db4aSGavin Atkinson.Ic glob  ,
581f982db4aSGavin Atkinsonthe file name arguments
582f982db4aSGavin Atkinsonare taken literally and not expanded.
583f982db4aSGavin AtkinsonGlobbing for
584f982db4aSGavin Atkinson.Ic mput
585f982db4aSGavin Atkinsonis done as in
586f982db4aSGavin Atkinson.Xr csh 1 .
587f982db4aSGavin AtkinsonFor
588f982db4aSGavin Atkinson.Ic mdelete ,
589f982db4aSGavin Atkinson.Ic mget ,
590f982db4aSGavin Atkinsonand
591f982db4aSGavin Atkinson.Ic mreget ,
592f982db4aSGavin Atkinsoneach remote file name is expanded
593f982db4aSGavin Atkinsonseparately on the remote machine and the lists are not merged.
594f982db4aSGavin AtkinsonExpansion of a directory name is likely to be
595f982db4aSGavin Atkinsondifferent from expansion of the name of an ordinary file:
596f982db4aSGavin Atkinsonthe exact result depends on the foreign operating system and ftp server,
597f982db4aSGavin Atkinsonand can be previewed by doing
598f982db4aSGavin Atkinson.Ql mls remote-files \-
599f982db4aSGavin AtkinsonNote:
600f982db4aSGavin Atkinson.Ic mget ,
601f982db4aSGavin Atkinson.Ic mput
602f982db4aSGavin Atkinsonand
603f982db4aSGavin Atkinson.Ic mreget
604f982db4aSGavin Atkinsonare not meant to transfer
605f982db4aSGavin Atkinsonentire directory subtrees of files.
606f982db4aSGavin AtkinsonThat can be done by
607f982db4aSGavin Atkinsontransferring a
608f982db4aSGavin Atkinson.Xr tar 1
609f982db4aSGavin Atkinsonarchive of the subtree (in binary mode).
610f982db4aSGavin Atkinson.It Ic hash Op Ar size
611*cc361f65SGavin AtkinsonToggle hash-sign
612*cc361f65SGavin Atkinson.Pq Sq #
613*cc361f65SGavin Atkinsonprinting for each data block transferred.
614f982db4aSGavin AtkinsonThe size of a data block defaults to 1024 bytes.
615f982db4aSGavin AtkinsonThis can be changed by specifying
616f982db4aSGavin Atkinson.Ar size
617f982db4aSGavin Atkinsonin bytes.
618f982db4aSGavin AtkinsonEnabling
619f982db4aSGavin Atkinson.Ic hash
620f982db4aSGavin Atkinsondisables
621f982db4aSGavin Atkinson.Ic progress .
622f982db4aSGavin Atkinson.It Ic help Op Ar command
623f982db4aSGavin AtkinsonPrint an informative message about the meaning of
624f982db4aSGavin Atkinson.Ar command .
625f982db4aSGavin AtkinsonIf no argument is given,
626f982db4aSGavin Atkinson.Nm
627f982db4aSGavin Atkinsonprints a list of the known commands.
628f982db4aSGavin Atkinson.It Ic idle Op Ar seconds
629f982db4aSGavin AtkinsonSet the inactivity timer on the remote server to
630f982db4aSGavin Atkinson.Ar seconds
631f982db4aSGavin Atkinsonseconds.
632f982db4aSGavin AtkinsonIf
633f982db4aSGavin Atkinson.Ar seconds
634f982db4aSGavin Atkinsonis omitted, the current inactivity timer is printed.
635f982db4aSGavin Atkinson.It Ic image
636f982db4aSGavin AtkinsonA synonym for
637f982db4aSGavin Atkinson.Ic binary .
638f982db4aSGavin Atkinson.It Ic lcd Op Ar directory
639f982db4aSGavin AtkinsonChange the working directory on the local machine.
640f982db4aSGavin AtkinsonIf
641f982db4aSGavin Atkinsonno
642f982db4aSGavin Atkinson.Ar directory
643f982db4aSGavin Atkinsonis specified, the user's home directory is used.
644f982db4aSGavin Atkinson.It Ic less Ar file
645f982db4aSGavin AtkinsonA synonym for
646f982db4aSGavin Atkinson.Ic page .
647f982db4aSGavin Atkinson.It Ic lpage Ar local-file
648f982db4aSGavin AtkinsonDisplay
649f982db4aSGavin Atkinson.Ar local-file
650f982db4aSGavin Atkinsonwith the program specified by the
651f982db4aSGavin Atkinson.Ic "set pager"
652f982db4aSGavin Atkinsonoption.
653f982db4aSGavin Atkinson.It Ic lpwd
654f982db4aSGavin AtkinsonPrint the working directory on the local machine.
655f982db4aSGavin Atkinson.It Ic \&ls Op Ar remote-path Op Ar local-file
656f982db4aSGavin AtkinsonA synonym for
657f982db4aSGavin Atkinson.Ic dir .
658f982db4aSGavin Atkinson.It Ic macdef Ar macro-name
659f982db4aSGavin AtkinsonDefine a macro.
660f982db4aSGavin AtkinsonSubsequent lines are stored as the macro
661f982db4aSGavin Atkinson.Ar macro-name  ;
662*cc361f65SGavin Atkinsona null line (consecutive newline characters in a file or carriage
663*cc361f65SGavin Atkinsonreturns from the terminal) terminates macro input mode.
664f982db4aSGavin AtkinsonThere is a limit of 16 macros and 4096 total characters in all
665f982db4aSGavin Atkinsondefined macros.
666*cc361f65SGavin AtkinsonMacro names can be a maximum of 8 characters.
667*cc361f65SGavin AtkinsonMacros are only applicable to the current session they are
668*cc361f65SGavin Atkinsondefined within (or if defined outside a session, to the session
669*cc361f65SGavin Atkinsoninvoked with the next
670*cc361f65SGavin Atkinson.Ic open
671*cc361f65SGavin Atkinsoncommand), and remain defined until a
672f982db4aSGavin Atkinson.Ic close
673f982db4aSGavin Atkinsoncommand is executed.
674*cc361f65SGavin AtkinsonTo invoke a macro, use the
675*cc361f65SGavin Atkinson.Ic $
676*cc361f65SGavin Atkinsoncommand (see above).
677*cc361f65SGavin Atkinson.Pp
678*cc361f65SGavin AtkinsonThe macro processor interprets
679*cc361f65SGavin Atkinson.Sq $
680*cc361f65SGavin Atkinsonand
681*cc361f65SGavin Atkinson.Sq \e
682*cc361f65SGavin Atkinsonas special characters.
683*cc361f65SGavin AtkinsonA
684*cc361f65SGavin Atkinson.Sq $
685*cc361f65SGavin Atkinsonfollowed by a number (or numbers) is replaced by the
686f982db4aSGavin Atkinsoncorresponding argument on the macro invocation command line.
687*cc361f65SGavin AtkinsonA
688*cc361f65SGavin Atkinson.Sq $
689*cc361f65SGavin Atkinsonfollowed by an
690*cc361f65SGavin Atkinson.Sq i
691*cc361f65SGavin Atkinsonsignals the macro processor that the executing macro is to be
692*cc361f65SGavin Atkinsonlooped.
693*cc361f65SGavin AtkinsonOn the first pass
694*cc361f65SGavin Atkinson.Dq $i
695*cc361f65SGavin Atkinsonis replaced by the first argument on the macro invocation command
696*cc361f65SGavin Atkinsonline, on the second pass it is replaced by the second argument,
697*cc361f65SGavin Atkinsonand so on.
698*cc361f65SGavin AtkinsonA
699*cc361f65SGavin Atkinson.Sq \e
700*cc361f65SGavin Atkinsonfollowed by any character is replaced by that character.
701*cc361f65SGavin AtkinsonUse the
702*cc361f65SGavin Atkinson.Sq \e
703*cc361f65SGavin Atkinsonto prevent special treatment of the
704*cc361f65SGavin Atkinson.Sq $ .
705f982db4aSGavin Atkinson.It Ic mdelete Op Ar remote-files
706f982db4aSGavin AtkinsonDelete the
707f982db4aSGavin Atkinson.Ar remote-files
708f982db4aSGavin Atkinsonon the remote machine.
709f982db4aSGavin Atkinson.It Ic mdir Ar remote-files local-file
710f982db4aSGavin AtkinsonLike
711f982db4aSGavin Atkinson.Ic dir  ,
712f982db4aSGavin Atkinsonexcept multiple remote files may be specified.
713f982db4aSGavin AtkinsonIf interactive prompting is on,
714f982db4aSGavin Atkinson.Nm
715f982db4aSGavin Atkinsonwill prompt the user to verify that the last argument is indeed the
716f982db4aSGavin Atkinsontarget local file for receiving
717f982db4aSGavin Atkinson.Ic mdir
718f982db4aSGavin Atkinsonoutput.
719f982db4aSGavin Atkinson.It Ic mget Ar remote-files
720f982db4aSGavin AtkinsonExpand the
721f982db4aSGavin Atkinson.Ar remote-files
722f982db4aSGavin Atkinsonon the remote machine
723f982db4aSGavin Atkinsonand do a
724f982db4aSGavin Atkinson.Ic get
725f982db4aSGavin Atkinsonfor each file name thus produced.
726f982db4aSGavin AtkinsonSee
727f982db4aSGavin Atkinson.Ic glob
728f982db4aSGavin Atkinsonfor details on the filename expansion.
729f982db4aSGavin AtkinsonResulting file names will then be processed according to
730f982db4aSGavin Atkinson.Ic case  ,
731f982db4aSGavin Atkinson.Ic ntrans ,
732f982db4aSGavin Atkinsonand
733f982db4aSGavin Atkinson.Ic nmap
734f982db4aSGavin Atkinsonsettings.
735f982db4aSGavin AtkinsonFiles are transferred into the local working directory,
736f982db4aSGavin Atkinsonwhich can be changed with
737f982db4aSGavin Atkinson.Ql lcd directory ;
738f982db4aSGavin Atkinsonnew local directories can be created with
739f982db4aSGavin Atkinson.Ql "\&! mkdir directory" .
740f982db4aSGavin Atkinson.It Ic mkdir Ar directory-name
741f982db4aSGavin AtkinsonMake a directory on the remote machine.
742f982db4aSGavin Atkinson.It Ic mls Ar remote-files local-file
743f982db4aSGavin AtkinsonLike
744f982db4aSGavin Atkinson.Ic ls  ,
745f982db4aSGavin Atkinsonexcept multiple remote files may be specified,
746f982db4aSGavin Atkinsonand the
747f982db4aSGavin Atkinson.Ar local-file
748f982db4aSGavin Atkinsonmust be specified.
749f982db4aSGavin AtkinsonIf interactive prompting is on,
750f982db4aSGavin Atkinson.Nm
751f982db4aSGavin Atkinsonwill prompt the user to verify that the last argument is indeed the
752f982db4aSGavin Atkinsontarget local file for receiving
753f982db4aSGavin Atkinson.Ic mls
754f982db4aSGavin Atkinsonoutput.
755f982db4aSGavin Atkinson.It Ic mlsd Op Ar remote-path
756f982db4aSGavin AtkinsonDisplay the contents of
757f982db4aSGavin Atkinson.Ar remote-path
758f982db4aSGavin Atkinson(which should default to the current directory if not given)
759f982db4aSGavin Atkinsonin a machine-parsable form, using
760f982db4aSGavin Atkinson.Dv MLSD .
761f982db4aSGavin AtkinsonThe format of display can be changed with
762f982db4aSGavin Atkinson.Sq "remopts mlst ..." .
763f982db4aSGavin Atkinson.It Ic mlst Op Ar remote-path
764f982db4aSGavin AtkinsonDisplay the details about
765f982db4aSGavin Atkinson.Ar remote-path
766f982db4aSGavin Atkinson(which should default to the current directory if not given)
767f982db4aSGavin Atkinsonin a machine-parsable form, using
768f982db4aSGavin Atkinson.Dv MLST .
769f982db4aSGavin AtkinsonThe format of display can be changed with
770f982db4aSGavin Atkinson.Sq "remopts mlst ..." .
771f982db4aSGavin Atkinson.It Ic mode Ar mode-name
772f982db4aSGavin AtkinsonSet the file transfer
773f982db4aSGavin Atkinson.Ic mode
774f982db4aSGavin Atkinsonto
775f982db4aSGavin Atkinson.Ar mode-name .
776f982db4aSGavin AtkinsonThe default (and only supported)
777f982db4aSGavin Atkinsonmode is
778f982db4aSGavin Atkinson.Dq stream .
779f982db4aSGavin Atkinson.It Ic modtime Ar remote-file
780*cc361f65SGavin AtkinsonShow the last modification time of the file on the remote machine, in
781*cc361f65SGavin Atkinson.Li RFC2822
782*cc361f65SGavin Atkinsonformat.
783f982db4aSGavin Atkinson.It Ic more Ar file
784f982db4aSGavin AtkinsonA synonym for
785f982db4aSGavin Atkinson.Ic page .
786f982db4aSGavin Atkinson.It Ic mput Ar local-files
787f982db4aSGavin AtkinsonExpand wild cards in the list of local files given as arguments
788f982db4aSGavin Atkinsonand do a
789f982db4aSGavin Atkinson.Ic put
790f982db4aSGavin Atkinsonfor each file in the resulting list.
791f982db4aSGavin AtkinsonSee
792f982db4aSGavin Atkinson.Ic glob
793f982db4aSGavin Atkinsonfor details of filename expansion.
794f982db4aSGavin AtkinsonResulting file names will then be processed according to
795f982db4aSGavin Atkinson.Ic ntrans
796f982db4aSGavin Atkinsonand
797f982db4aSGavin Atkinson.Ic nmap
798f982db4aSGavin Atkinsonsettings.
799f982db4aSGavin Atkinson.It Ic mreget Ar remote-files
800f982db4aSGavin AtkinsonAs per
801f982db4aSGavin Atkinson.Ic mget ,
802f982db4aSGavin Atkinsonbut performs a
803f982db4aSGavin Atkinson.Ic reget
804f982db4aSGavin Atkinsoninstead of
805f982db4aSGavin Atkinson.Ic get .
806f982db4aSGavin Atkinson.It Ic msend Ar local-files
807f982db4aSGavin AtkinsonA synonym for
808f982db4aSGavin Atkinson.Ic mput .
809f982db4aSGavin Atkinson.It Ic newer Ar remote-file Op Ar local-file
810f982db4aSGavin AtkinsonGet the file only if the modification time of the remote file is more
811f982db4aSGavin Atkinsonrecent that the file on the current system.
812f982db4aSGavin AtkinsonIf the file does not
813f982db4aSGavin Atkinsonexist on the current system, the remote file is considered
814f982db4aSGavin Atkinson.Ic newer .
815f982db4aSGavin AtkinsonOtherwise, this command is identical to
816f982db4aSGavin Atkinson.Ar get .
817f982db4aSGavin Atkinson.It Ic nlist Op Ar remote-path Op Ar local-file
818f982db4aSGavin AtkinsonA synonym for
819f982db4aSGavin Atkinson.Ic ls .
820f982db4aSGavin Atkinson.It Ic nmap Op Ar inpattern outpattern
821f982db4aSGavin AtkinsonSet or unset the filename mapping mechanism.
822f982db4aSGavin AtkinsonIf no arguments are specified, the filename mapping mechanism is unset.
823f982db4aSGavin AtkinsonIf arguments are specified, remote filenames are mapped during
824f982db4aSGavin Atkinson.Ic mput
825f982db4aSGavin Atkinsoncommands and
826f982db4aSGavin Atkinson.Ic put
827f982db4aSGavin Atkinsoncommands issued without a specified remote target filename.
828f982db4aSGavin AtkinsonIf arguments are specified, local filenames are mapped during
829f982db4aSGavin Atkinson.Ic mget
830f982db4aSGavin Atkinsoncommands and
831f982db4aSGavin Atkinson.Ic get
832f982db4aSGavin Atkinsoncommands issued without a specified local target filename.
833f982db4aSGavin AtkinsonThis command is useful when connecting to a
834f982db4aSGavin Atkinson.No non\- Ns Ux
835f982db4aSGavin Atkinsonremote computer
836f982db4aSGavin Atkinsonwith different file naming conventions or practices.
837f982db4aSGavin AtkinsonThe mapping follows the pattern set by
838f982db4aSGavin Atkinson.Ar inpattern
839f982db4aSGavin Atkinsonand
840f982db4aSGavin Atkinson.Ar outpattern .
841f982db4aSGavin Atkinson.Op Ar Inpattern
842f982db4aSGavin Atkinsonis a template for incoming filenames (which may have already been
843f982db4aSGavin Atkinsonprocessed according to the
844f982db4aSGavin Atkinson.Ic ntrans
845f982db4aSGavin Atkinsonand
846f982db4aSGavin Atkinson.Ic case
847f982db4aSGavin Atkinsonsettings).
848f982db4aSGavin AtkinsonVariable templating is accomplished by including the
849*cc361f65SGavin Atkinsonsequences
850*cc361f65SGavin Atkinson.Dq $1 ,
851*cc361f65SGavin Atkinson.Dq $2 ,
852*cc361f65SGavin Atkinson\&...
853*cc361f65SGavin Atkinson.Dq $9
854*cc361f65SGavin Atkinsonin
855f982db4aSGavin Atkinson.Ar inpattern .
856*cc361f65SGavin AtkinsonUse
857*cc361f65SGavin Atkinson.Sq \e
858*cc361f65SGavin Atkinsonto prevent this special treatment of the
859*cc361f65SGavin Atkinson.Sq $
860*cc361f65SGavin Atkinsoncharacter.
861f982db4aSGavin AtkinsonAll other characters are treated literally, and are used to determine the
862f982db4aSGavin Atkinson.Ic nmap
863f982db4aSGavin Atkinson.Op Ar inpattern
864f982db4aSGavin Atkinsonvariable values.
865f982db4aSGavin AtkinsonFor example, given
866f982db4aSGavin Atkinson.Ar inpattern
867f982db4aSGavin Atkinson$1.$2 and the remote file name "mydata.data", $1 would have the value
868f982db4aSGavin Atkinson"mydata", and $2 would have the value "data".
869f982db4aSGavin AtkinsonThe
870f982db4aSGavin Atkinson.Ar outpattern
871f982db4aSGavin Atkinsondetermines the resulting mapped filename.
872*cc361f65SGavin AtkinsonThe sequences
873*cc361f65SGavin Atkinson.Dq $1 ,
874*cc361f65SGavin Atkinson.Dq $2 ,
875*cc361f65SGavin Atkinson\&...
876*cc361f65SGavin Atkinson.Dq $9
877*cc361f65SGavin Atkinsonare replaced by any value resulting from the
878f982db4aSGavin Atkinson.Ar inpattern
879f982db4aSGavin Atkinsontemplate.
880*cc361f65SGavin AtkinsonThe sequence
881*cc361f65SGavin Atkinson.Dq $0
882*cc361f65SGavin Atkinsonis replaced by the original filename.
883f982db4aSGavin AtkinsonAdditionally, the sequence
884*cc361f65SGavin Atkinson.Dq Op Ar seq1 , Ar seq2
885f982db4aSGavin Atkinsonis replaced by
886f982db4aSGavin Atkinson.Op Ar seq1
887f982db4aSGavin Atkinsonif
888f982db4aSGavin Atkinson.Ar seq1
889f982db4aSGavin Atkinsonis not a null string; otherwise it is replaced by
890f982db4aSGavin Atkinson.Ar seq2 .
891f982db4aSGavin AtkinsonFor example, the command
892f982db4aSGavin Atkinson.Pp
893f982db4aSGavin Atkinson.Bd -literal -offset indent -compact
894f982db4aSGavin Atkinsonnmap $1.$2.$3 [$1,$2].[$2,file]
895f982db4aSGavin Atkinson.Ed
896f982db4aSGavin Atkinson.Pp
897f982db4aSGavin Atkinsonwould yield
898f982db4aSGavin Atkinsonthe output filename "myfile.data" for input filenames "myfile.data" and
899f982db4aSGavin Atkinson"myfile.data.old", "myfile.file" for the input filename "myfile", and
900f982db4aSGavin Atkinson"myfile.myfile" for the input filename ".myfile".
901f982db4aSGavin AtkinsonSpaces may be included in
902f982db4aSGavin Atkinson.Ar outpattern  ,
903*cc361f65SGavin Atkinsonas in the example:
904*cc361f65SGavin Atkinson.Dl nmap $1 sed "s/  *$//" \*[Gt] $1
905*cc361f65SGavin AtkinsonUse the
906*cc361f65SGavin Atkinson.Sq \e
907*cc361f65SGavin Atkinsoncharacter to prevent special treatment
908*cc361f65SGavin Atkinsonof the
909*cc361f65SGavin Atkinson.Sq $ ,
910*cc361f65SGavin Atkinson.Sq \&[ ,
911*cc361f65SGavin Atkinson.Sq \&] ,
912*cc361f65SGavin Atkinsonand
913*cc361f65SGavin Atkinson.Sq \&,
914*cc361f65SGavin Atkinsoncharacters.
915f982db4aSGavin Atkinson.It Ic ntrans Op Ar inchars Op Ar outchars
916f982db4aSGavin AtkinsonSet or unset the filename character translation mechanism.
917f982db4aSGavin AtkinsonIf no arguments are specified, the filename character
918f982db4aSGavin Atkinsontranslation mechanism is unset.
919f982db4aSGavin AtkinsonIf arguments are specified, characters in
920f982db4aSGavin Atkinsonremote filenames are translated during
921f982db4aSGavin Atkinson.Ic mput
922f982db4aSGavin Atkinsoncommands and
923f982db4aSGavin Atkinson.Ic put
924f982db4aSGavin Atkinsoncommands issued without a specified remote target filename.
925f982db4aSGavin AtkinsonIf arguments are specified, characters in
926f982db4aSGavin Atkinsonlocal filenames are translated during
927f982db4aSGavin Atkinson.Ic mget
928f982db4aSGavin Atkinsoncommands and
929f982db4aSGavin Atkinson.Ic get
930f982db4aSGavin Atkinsoncommands issued without a specified local target filename.
931f982db4aSGavin AtkinsonThis command is useful when connecting to a
932f982db4aSGavin Atkinson.No non\- Ns Ux
933f982db4aSGavin Atkinsonremote computer
934f982db4aSGavin Atkinsonwith different file naming conventions or practices.
935f982db4aSGavin AtkinsonCharacters in a filename matching a character in
936f982db4aSGavin Atkinson.Ar inchars
937f982db4aSGavin Atkinsonare replaced with the corresponding character in
938f982db4aSGavin Atkinson.Ar outchars .
939f982db4aSGavin AtkinsonIf the character's position in
940f982db4aSGavin Atkinson.Ar inchars
941f982db4aSGavin Atkinsonis longer than the length of
942f982db4aSGavin Atkinson.Ar outchars  ,
943f982db4aSGavin Atkinsonthe character is deleted from the file name.
944f982db4aSGavin Atkinson.It Ic open Ar host Op Ar port
945f982db4aSGavin AtkinsonEstablish a connection to the specified
946f982db4aSGavin Atkinson.Ar host
947f982db4aSGavin Atkinson.Tn FTP
948f982db4aSGavin Atkinsonserver.
949f982db4aSGavin AtkinsonAn optional port number may be supplied,
950f982db4aSGavin Atkinsonin which case,
951f982db4aSGavin Atkinson.Nm
952f982db4aSGavin Atkinsonwill attempt to contact an
953f982db4aSGavin Atkinson.Tn FTP
954f982db4aSGavin Atkinsonserver at that port.
955f982db4aSGavin AtkinsonIf the
956f982db4aSGavin Atkinson.Ic "set auto-login"
957f982db4aSGavin Atkinsonoption is on (default),
958f982db4aSGavin Atkinson.Nm
959f982db4aSGavin Atkinsonwill also attempt to automatically log the user in to
960f982db4aSGavin Atkinsonthe
961f982db4aSGavin Atkinson.Tn FTP
962f982db4aSGavin Atkinsonserver (see below).
963f982db4aSGavin Atkinson.It Ic page Ar file
964f982db4aSGavin AtkinsonRetrieve
965f982db4aSGavin Atkinson.Ic file
966f982db4aSGavin Atkinsonand display with the program specified by the
967f982db4aSGavin Atkinson.Ic "set pager"
968f982db4aSGavin Atkinsonoption.
969f982db4aSGavin Atkinson.It Ic passive Op Cm auto
970f982db4aSGavin AtkinsonToggle passive mode (if no arguments are given).
971f982db4aSGavin AtkinsonIf
972f982db4aSGavin Atkinson.Cm auto
973f982db4aSGavin Atkinsonis given, act as if
974f982db4aSGavin Atkinson.Ev FTPMODE
975f982db4aSGavin Atkinsonis set to
976f982db4aSGavin Atkinson.Sq auto .
977f982db4aSGavin AtkinsonIf passive mode is turned on (default),
978f982db4aSGavin Atkinson.Nm
979f982db4aSGavin Atkinsonwill send a
980f982db4aSGavin Atkinson.Dv PASV
981f982db4aSGavin Atkinsoncommand for all data connections instead of a
982f982db4aSGavin Atkinson.Dv PORT
983f982db4aSGavin Atkinsoncommand.
984f982db4aSGavin AtkinsonThe
985f982db4aSGavin Atkinson.Dv PASV
986f982db4aSGavin Atkinsoncommand requests that the remote server open a port for the data connection
987f982db4aSGavin Atkinsonand return the address of that port.
988f982db4aSGavin AtkinsonThe remote server listens on that port and the client connects to it.
989f982db4aSGavin AtkinsonWhen using the more traditional
990f982db4aSGavin Atkinson.Dv PORT
991f982db4aSGavin Atkinsoncommand, the client listens on a port and sends that address to the remote
992f982db4aSGavin Atkinsonserver, who connects back to it.
993f982db4aSGavin AtkinsonPassive mode is useful when using
994f982db4aSGavin Atkinson.Nm
995f982db4aSGavin Atkinsonthrough a gateway router or host that controls the directionality of
996f982db4aSGavin Atkinsontraffic.
997f982db4aSGavin Atkinson(Note that though
998f982db4aSGavin Atkinson.Tn FTP
999f982db4aSGavin Atkinsonservers are required to support the
1000f982db4aSGavin Atkinson.Dv PASV
1001f982db4aSGavin Atkinsoncommand by
1002f982db4aSGavin Atkinson.Li RFC1123 ,
1003f982db4aSGavin Atkinsonsome do not.)
1004f982db4aSGavin Atkinson.It Ic pdir Op Ar remote-path
1005f982db4aSGavin AtkinsonPerform
1006f982db4aSGavin Atkinson.Ic dir
1007f982db4aSGavin Atkinson.Op Ar remote-path ,
1008f982db4aSGavin Atkinsonand display the result with the program specified by the
1009f982db4aSGavin Atkinson.Ic "set pager"
1010f982db4aSGavin Atkinsonoption.
1011f982db4aSGavin Atkinson.It Ic pls Op Ar remote-path
1012f982db4aSGavin AtkinsonPerform
1013f982db4aSGavin Atkinson.Ic ls
1014f982db4aSGavin Atkinson.Op Ar remote-path ,
1015f982db4aSGavin Atkinsonand display the result with the program specified by the
1016f982db4aSGavin Atkinson.Ic "set pager"
1017f982db4aSGavin Atkinsonoption.
1018f982db4aSGavin Atkinson.It Ic pmlsd Op Ar remote-path
1019f982db4aSGavin AtkinsonPerform
1020f982db4aSGavin Atkinson.Ic mlsd
1021f982db4aSGavin Atkinson.Op Ar remote-path ,
1022f982db4aSGavin Atkinsonand display the result with the program specified by the
1023f982db4aSGavin Atkinson.Ic "set pager"
1024f982db4aSGavin Atkinsonoption.
1025f982db4aSGavin Atkinson.It Ic preserve
1026f982db4aSGavin AtkinsonToggle preservation of modification times on retrieved files.
1027f982db4aSGavin Atkinson.It Ic progress
1028f982db4aSGavin AtkinsonToggle display of transfer progress bar.
1029f982db4aSGavin AtkinsonThe progress bar will be disabled for a transfer that has
1030f982db4aSGavin Atkinson.Ar local-file
1031f982db4aSGavin Atkinsonas
1032f982db4aSGavin Atkinson.Sq Fl
1033f982db4aSGavin Atkinsonor a command that starts with
1034f982db4aSGavin Atkinson.Sq \&| .
1035f982db4aSGavin AtkinsonRefer to
1036f982db4aSGavin Atkinson.Sx FILE NAMING CONVENTIONS
1037f982db4aSGavin Atkinsonfor more information.
1038f982db4aSGavin AtkinsonEnabling
1039f982db4aSGavin Atkinson.Ic progress
1040f982db4aSGavin Atkinsondisables
1041f982db4aSGavin Atkinson.Ic hash .
1042f982db4aSGavin Atkinson.It Ic prompt
1043f982db4aSGavin AtkinsonToggle interactive prompting.
1044f982db4aSGavin AtkinsonInteractive prompting
1045f982db4aSGavin Atkinsonoccurs during multiple file transfers to allow the
1046f982db4aSGavin Atkinsonuser to selectively retrieve or store files.
1047f982db4aSGavin AtkinsonIf prompting is turned off (default is on), any
1048f982db4aSGavin Atkinson.Ic mget
1049f982db4aSGavin Atkinsonor
1050f982db4aSGavin Atkinson.Ic mput
1051f982db4aSGavin Atkinsonwill transfer all files, and any
1052f982db4aSGavin Atkinson.Ic mdelete
1053f982db4aSGavin Atkinsonwill delete all files.
1054f982db4aSGavin Atkinson.Pp
1055f982db4aSGavin AtkinsonWhen prompting is on, the following commands are available at a prompt:
1056f982db4aSGavin Atkinson.Bl -tag -width 2n -offset indent
1057f982db4aSGavin Atkinson.It Cm a
1058f982db4aSGavin AtkinsonAnswer
1059f982db4aSGavin Atkinson.Sq yes
1060f982db4aSGavin Atkinsonto the current file, and automatically answer
1061f982db4aSGavin Atkinson.Sq yes
1062f982db4aSGavin Atkinsonto any remaining files for the current command.
1063f982db4aSGavin Atkinson.It Cm n
1064f982db4aSGavin AtkinsonAnswer
1065f982db4aSGavin Atkinson.Sq no ,
1066f982db4aSGavin Atkinsonand do not transfer the file.
1067f982db4aSGavin Atkinson.It Cm p
1068f982db4aSGavin AtkinsonAnswer
1069f982db4aSGavin Atkinson.Sq yes
1070f982db4aSGavin Atkinsonto the current file, and turn off prompt mode
1071f982db4aSGavin Atkinson(as is
1072f982db4aSGavin Atkinson.Dq prompt off
1073f982db4aSGavin Atkinsonhad been given).
1074f982db4aSGavin Atkinson.It Cm q
1075f982db4aSGavin AtkinsonTerminate the current operation.
1076f982db4aSGavin Atkinson.It Cm y
1077f982db4aSGavin AtkinsonAnswer
1078f982db4aSGavin Atkinson.Sq yes ,
1079f982db4aSGavin Atkinsonand transfer the file.
1080f982db4aSGavin Atkinson.It Cm \&?
1081f982db4aSGavin AtkinsonDisplay a help message.
1082f982db4aSGavin Atkinson.El
1083f982db4aSGavin Atkinson.Pp
1084f982db4aSGavin AtkinsonAny other response will answer
1085f982db4aSGavin Atkinson.Sq yes
1086f982db4aSGavin Atkinsonto the current file.
1087f982db4aSGavin Atkinson.It Ic proxy Ar ftp-command
1088f982db4aSGavin AtkinsonExecute an ftp command on a secondary control connection.
1089f982db4aSGavin AtkinsonThis command allows simultaneous connection to two remote
1090f982db4aSGavin Atkinson.Tn FTP
1091f982db4aSGavin Atkinsonservers for transferring files between the two servers.
1092f982db4aSGavin AtkinsonThe first
1093f982db4aSGavin Atkinson.Ic proxy
1094f982db4aSGavin Atkinsoncommand should be an
1095f982db4aSGavin Atkinson.Ic open  ,
1096f982db4aSGavin Atkinsonto establish the secondary control connection.
1097f982db4aSGavin AtkinsonEnter the command "proxy ?" to see other
1098f982db4aSGavin Atkinson.Tn FTP
1099f982db4aSGavin Atkinsoncommands executable on the secondary connection.
1100f982db4aSGavin AtkinsonThe following commands behave differently when prefaced by
1101f982db4aSGavin Atkinson.Ic proxy  :
1102f982db4aSGavin Atkinson.Ic open
1103f982db4aSGavin Atkinsonwill not define new macros during the auto-login process,
1104f982db4aSGavin Atkinson.Ic close
1105f982db4aSGavin Atkinsonwill not erase existing macro definitions,
1106f982db4aSGavin Atkinson.Ic get
1107f982db4aSGavin Atkinsonand
1108f982db4aSGavin Atkinson.Ic mget
1109f982db4aSGavin Atkinsontransfer files from the host on the primary control connection
1110f982db4aSGavin Atkinsonto the host on the secondary control connection, and
1111f982db4aSGavin Atkinson.Ic put  ,
1112f982db4aSGavin Atkinson.Ic mput ,
1113f982db4aSGavin Atkinsonand
1114f982db4aSGavin Atkinson.Ic append
1115f982db4aSGavin Atkinsontransfer files from the host on the secondary control connection
1116f982db4aSGavin Atkinsonto the host on the primary control connection.
1117f982db4aSGavin AtkinsonThird party file transfers depend upon support of the
1118f982db4aSGavin Atkinson.Tn FTP
1119f982db4aSGavin Atkinsonprotocol
1120f982db4aSGavin Atkinson.Dv PASV
1121f982db4aSGavin Atkinsoncommand by the server on the secondary control connection.
1122f982db4aSGavin Atkinson.It Ic put Ar local-file Op Ar remote-file
1123f982db4aSGavin AtkinsonStore a local file on the remote machine.
1124f982db4aSGavin AtkinsonIf
1125f982db4aSGavin Atkinson.Ar remote-file
1126f982db4aSGavin Atkinsonis left unspecified, the local file name is used
1127f982db4aSGavin Atkinsonafter processing according to any
1128f982db4aSGavin Atkinson.Ic ntrans
1129f982db4aSGavin Atkinsonor
1130f982db4aSGavin Atkinson.Ic nmap
1131f982db4aSGavin Atkinsonsettings
1132f982db4aSGavin Atkinsonin naming the remote file.
1133f982db4aSGavin AtkinsonFile transfer uses the
1134f982db4aSGavin Atkinsoncurrent settings for
1135f982db4aSGavin Atkinson.Ic type  ,
1136f982db4aSGavin Atkinson.Ic format ,
1137f982db4aSGavin Atkinson.Ic mode  ,
1138f982db4aSGavin Atkinsonand
1139f982db4aSGavin Atkinson.Ic structure .
1140f982db4aSGavin Atkinson.It Ic pwd
1141f982db4aSGavin AtkinsonPrint the name of the current working directory on the remote
1142f982db4aSGavin Atkinsonmachine.
1143f982db4aSGavin Atkinson.It Ic quit
1144f982db4aSGavin AtkinsonA synonym for
1145f982db4aSGavin Atkinson.Ic bye .
1146f982db4aSGavin Atkinson.It Ic quote Ar arg1 arg2 ...
1147f982db4aSGavin AtkinsonThe arguments specified are sent, verbatim, to the remote
1148f982db4aSGavin Atkinson.Tn FTP
1149f982db4aSGavin Atkinsonserver.
1150*cc361f65SGavin Atkinson.It Ic rate Ar direction Oo Ar maximum Oo Ar increment Oc Oc
1151f982db4aSGavin AtkinsonThrottle the maximum transfer rate to
1152f982db4aSGavin Atkinson.Ar maximum
1153f982db4aSGavin Atkinsonbytes/second.
1154f982db4aSGavin AtkinsonIf
1155f982db4aSGavin Atkinson.Ar maximum
1156f982db4aSGavin Atkinsonis 0, disable the throttle.
1157f982db4aSGavin Atkinson.Pp
1158f982db4aSGavin Atkinson.Ar direction
1159f982db4aSGavin Atkinsonmay be one of:
1160f982db4aSGavin Atkinson.Bl -tag -width "all" -offset indent -compact
1161f982db4aSGavin Atkinson.It Cm all
1162f982db4aSGavin AtkinsonBoth directions.
1163f982db4aSGavin Atkinson.It Cm get
1164f982db4aSGavin AtkinsonIncoming transfers.
1165f982db4aSGavin Atkinson.It Cm put
1166f982db4aSGavin AtkinsonOutgoing transfers.
1167f982db4aSGavin Atkinson.El
1168f982db4aSGavin Atkinson.Pp
1169f982db4aSGavin Atkinson.Ar maximum
1170f982db4aSGavin Atkinsoncan be modified on the fly by
1171f982db4aSGavin Atkinson.Ar increment
1172f982db4aSGavin Atkinsonbytes (default: 1024) each time a given signal is received:
1173f982db4aSGavin Atkinson.Bl -tag -width "SIGUSR1" -offset indent
1174f982db4aSGavin Atkinson.It Dv SIGUSR1
1175f982db4aSGavin AtkinsonIncrement
1176f982db4aSGavin Atkinson.Ar maximum
1177f982db4aSGavin Atkinsonby
1178f982db4aSGavin Atkinson.Ar increment
1179f982db4aSGavin Atkinsonbytes.
1180f982db4aSGavin Atkinson.It Dv SIGUSR2
1181f982db4aSGavin AtkinsonDecrement
1182f982db4aSGavin Atkinson.Ar maximum
1183f982db4aSGavin Atkinsonby
1184f982db4aSGavin Atkinson.Ar increment
1185f982db4aSGavin Atkinsonbytes.
1186f982db4aSGavin AtkinsonThe result must be a positive number.
1187f982db4aSGavin Atkinson.El
1188f982db4aSGavin Atkinson.Pp
1189f982db4aSGavin AtkinsonIf
1190f982db4aSGavin Atkinson.Ar maximum
1191f982db4aSGavin Atkinsonis not supplied, the current throttle rates are displayed.
1192f982db4aSGavin Atkinson.Pp
1193f982db4aSGavin AtkinsonNote:
1194f982db4aSGavin Atkinson.Ic rate
1195f982db4aSGavin Atkinsonis not yet implemented for ascii mode transfers.
1196f982db4aSGavin Atkinson.It Ic rcvbuf Ar size
1197f982db4aSGavin AtkinsonSet the size of the socket receive buffer to
1198f982db4aSGavin Atkinson.Ar size .
1199f982db4aSGavin Atkinson.It Ic recv Ar remote-file Op Ar local-file
1200f982db4aSGavin AtkinsonA synonym for
1201f982db4aSGavin Atkinson.Ic get .
1202f982db4aSGavin Atkinson.It Ic reget Ar remote-file Op Ar local-file
1203f982db4aSGavin Atkinson.Ic reget
1204f982db4aSGavin Atkinsonacts like
1205f982db4aSGavin Atkinson.Ic get ,
1206f982db4aSGavin Atkinsonexcept that if
1207f982db4aSGavin Atkinson.Ar local-file
1208f982db4aSGavin Atkinsonexists and is
1209f982db4aSGavin Atkinsonsmaller than
1210f982db4aSGavin Atkinson.Ar remote-file  ,
1211f982db4aSGavin Atkinson.Ar local-file
1212f982db4aSGavin Atkinsonis presumed to be
1213f982db4aSGavin Atkinsona partially transferred copy of
1214f982db4aSGavin Atkinson.Ar remote-file
1215f982db4aSGavin Atkinsonand the transfer
1216f982db4aSGavin Atkinsonis continued from the apparent point of failure.
1217f982db4aSGavin AtkinsonThis command
1218f982db4aSGavin Atkinsonis useful when transferring very large files over networks that
1219f982db4aSGavin Atkinsonare prone to dropping connections.
1220f982db4aSGavin Atkinson.It Ic remopts Ar command Op Ar command-options
1221f982db4aSGavin AtkinsonSet options on the remote
1222f982db4aSGavin Atkinson.Tn FTP
1223f982db4aSGavin Atkinsonserver for
1224f982db4aSGavin Atkinson.Ar command
1225f982db4aSGavin Atkinsonto
1226f982db4aSGavin Atkinson.Ar command-options
1227f982db4aSGavin Atkinson(whose absence is handled on a command-specific basis).
1228f982db4aSGavin AtkinsonRemote
1229f982db4aSGavin Atkinson.Tn FTP
1230f982db4aSGavin Atkinsoncommands known to support options include:
1231f982db4aSGavin Atkinson.Sq MLST
1232f982db4aSGavin Atkinson(used for
1233f982db4aSGavin Atkinson.Dv MLSD
1234f982db4aSGavin Atkinsonand
1235f982db4aSGavin Atkinson.Dv MLST ) .
1236f982db4aSGavin Atkinson.It Ic rename Op Ar from Op Ar to
1237f982db4aSGavin AtkinsonRename the file
1238f982db4aSGavin Atkinson.Ar from
1239f982db4aSGavin Atkinsonon the remote machine, to the file
1240f982db4aSGavin Atkinson.Ar to .
1241f982db4aSGavin Atkinson.It Ic reset
1242f982db4aSGavin AtkinsonClear reply queue.
1243f982db4aSGavin AtkinsonThis command re-synchronizes command/reply sequencing with the remote
1244f982db4aSGavin Atkinson.Tn FTP
1245f982db4aSGavin Atkinsonserver.
1246f982db4aSGavin AtkinsonResynchronization may be necessary following a violation of the
1247f982db4aSGavin Atkinson.Tn FTP
1248f982db4aSGavin Atkinsonprotocol by the remote server.
1249f982db4aSGavin Atkinson.It Ic restart Ar marker
1250f982db4aSGavin AtkinsonRestart the immediately following
1251f982db4aSGavin Atkinson.Ic get
1252f982db4aSGavin Atkinsonor
1253f982db4aSGavin Atkinson.Ic put
1254f982db4aSGavin Atkinsonat the
1255f982db4aSGavin Atkinsonindicated
1256f982db4aSGavin Atkinson.Ar marker .
1257f982db4aSGavin AtkinsonOn
1258f982db4aSGavin Atkinson.Ux
1259f982db4aSGavin Atkinsonsystems, marker is usually a byte
1260f982db4aSGavin Atkinsonoffset into the file.
1261f982db4aSGavin Atkinson.It Ic rhelp Op Ar command-name
1262f982db4aSGavin AtkinsonRequest help from the remote
1263f982db4aSGavin Atkinson.Tn FTP
1264f982db4aSGavin Atkinsonserver.
1265f982db4aSGavin AtkinsonIf a
1266f982db4aSGavin Atkinson.Ar command-name
1267f982db4aSGavin Atkinsonis specified it is supplied to the server as well.
1268f982db4aSGavin Atkinson.It Ic rmdir Ar directory-name
1269f982db4aSGavin AtkinsonDelete a directory on the remote machine.
1270f982db4aSGavin Atkinson.It Ic rstatus Op Ar remote-file
1271f982db4aSGavin AtkinsonWith no arguments, show status of remote machine.
1272f982db4aSGavin AtkinsonIf
1273f982db4aSGavin Atkinson.Ar remote-file
1274f982db4aSGavin Atkinsonis specified, show status of
1275f982db4aSGavin Atkinson.Ar remote-file
1276f982db4aSGavin Atkinsonon remote machine.
1277f982db4aSGavin Atkinson.It Ic runique
1278f982db4aSGavin AtkinsonToggle storing of files on the local system with unique filenames.
1279f982db4aSGavin AtkinsonIf a file already exists with a name equal to the target
1280f982db4aSGavin Atkinsonlocal filename for a
1281f982db4aSGavin Atkinson.Ic get
1282f982db4aSGavin Atkinsonor
1283f982db4aSGavin Atkinson.Ic mget
1284f982db4aSGavin Atkinsoncommand, a ".1" is appended to the name.
1285f982db4aSGavin AtkinsonIf the resulting name matches another existing file,
1286f982db4aSGavin Atkinsona ".2" is appended to the original name.
1287f982db4aSGavin AtkinsonIf this process continues up to ".99", an error
1288f982db4aSGavin Atkinsonmessage is printed, and the transfer does not take place.
1289f982db4aSGavin AtkinsonThe generated unique filename will be reported.
1290f982db4aSGavin AtkinsonNote that
1291f982db4aSGavin Atkinson.Ic runique
1292f982db4aSGavin Atkinsonwill not affect local files generated from a shell command
1293f982db4aSGavin Atkinson(see below).
1294f982db4aSGavin AtkinsonThe default value is off.
1295f982db4aSGavin Atkinson.It Ic send Ar local-file Op Ar remote-file
1296f982db4aSGavin AtkinsonA synonym for
1297f982db4aSGavin Atkinson.Ic put .
1298f982db4aSGavin Atkinson.It Ic sendport
1299f982db4aSGavin AtkinsonToggle the use of
1300f982db4aSGavin Atkinson.Dv PORT
1301f982db4aSGavin Atkinsoncommands.
1302f982db4aSGavin AtkinsonBy default,
1303f982db4aSGavin Atkinson.Nm
1304f982db4aSGavin Atkinsonwill attempt to use a
1305f982db4aSGavin Atkinson.Dv PORT
1306f982db4aSGavin Atkinsoncommand when establishing
1307f982db4aSGavin Atkinsona connection for each data transfer.
1308f982db4aSGavin AtkinsonThe use of
1309f982db4aSGavin Atkinson.Dv PORT
1310f982db4aSGavin Atkinsoncommands can prevent delays
1311f982db4aSGavin Atkinsonwhen performing multiple file transfers.
1312f982db4aSGavin AtkinsonIf the
1313f982db4aSGavin Atkinson.Dv PORT
1314f982db4aSGavin Atkinsoncommand fails,
1315f982db4aSGavin Atkinson.Nm
1316f982db4aSGavin Atkinsonwill use the default data port.
1317f982db4aSGavin AtkinsonWhen the use of
1318f982db4aSGavin Atkinson.Dv PORT
1319f982db4aSGavin Atkinsoncommands is disabled, no attempt will be made to use
1320f982db4aSGavin Atkinson.Dv PORT
1321f982db4aSGavin Atkinsoncommands for each data transfer.
1322f982db4aSGavin AtkinsonThis is useful
1323f982db4aSGavin Atkinsonfor certain
1324f982db4aSGavin Atkinson.Tn FTP
1325f982db4aSGavin Atkinsonimplementations which do ignore
1326f982db4aSGavin Atkinson.Dv PORT
1327f982db4aSGavin Atkinsoncommands but, incorrectly, indicate they've been accepted.
1328f982db4aSGavin Atkinson.It Ic set Op Ar option Ar value
1329f982db4aSGavin AtkinsonSet
1330f982db4aSGavin Atkinson.Ar option
1331f982db4aSGavin Atkinsonto
1332f982db4aSGavin Atkinson.Ar value .
1333f982db4aSGavin AtkinsonIf
1334f982db4aSGavin Atkinson.Ar option
1335f982db4aSGavin Atkinsonand
1336f982db4aSGavin Atkinson.Ar value
1337f982db4aSGavin Atkinsonare not given, display all of the options and their values.
1338f982db4aSGavin AtkinsonThe currently supported options are:
1339f982db4aSGavin Atkinson.Bl -tag -width "http_proxy" -offset indent
1340f982db4aSGavin Atkinson.It Cm anonpass
1341f982db4aSGavin AtkinsonDefaults to
1342f982db4aSGavin Atkinson.Ev $FTPANONPASS
1343f982db4aSGavin Atkinson.It Cm ftp_proxy
1344f982db4aSGavin AtkinsonDefaults to
1345f982db4aSGavin Atkinson.Ev $ftp_proxy .
1346f982db4aSGavin Atkinson.It Cm http_proxy
1347f982db4aSGavin AtkinsonDefaults to
1348f982db4aSGavin Atkinson.Ev $http_proxy .
1349f982db4aSGavin Atkinson.It Cm no_proxy
1350f982db4aSGavin AtkinsonDefaults to
1351f982db4aSGavin Atkinson.Ev $no_proxy .
1352f982db4aSGavin Atkinson.It Cm pager
1353f982db4aSGavin AtkinsonDefaults to
1354f982db4aSGavin Atkinson.Ev $PAGER .
1355f982db4aSGavin Atkinson.It Cm prompt
1356f982db4aSGavin AtkinsonDefaults to
1357f982db4aSGavin Atkinson.Ev $FTPPROMPT .
1358f982db4aSGavin Atkinson.It Cm rprompt
1359f982db4aSGavin AtkinsonDefaults to
1360f982db4aSGavin Atkinson.Ev $FTPRPROMPT .
1361f982db4aSGavin Atkinson.El
1362f982db4aSGavin Atkinson.It Ic site Ar arg1 arg2 ...
1363f982db4aSGavin AtkinsonThe arguments specified are sent, verbatim, to the remote
1364f982db4aSGavin Atkinson.Tn FTP
1365f982db4aSGavin Atkinsonserver as a
1366f982db4aSGavin Atkinson.Dv SITE
1367f982db4aSGavin Atkinsoncommand.
1368f982db4aSGavin Atkinson.It Ic size Ar remote-file
1369f982db4aSGavin AtkinsonReturn size of
1370f982db4aSGavin Atkinson.Ar remote-file
1371f982db4aSGavin Atkinsonon remote machine.
1372f982db4aSGavin Atkinson.It Ic sndbuf Ar size
1373f982db4aSGavin AtkinsonSet the size of the socket send buffer to
1374f982db4aSGavin Atkinson.Ar size .
1375f982db4aSGavin Atkinson.It Ic status
1376f982db4aSGavin AtkinsonShow the current status of
1377f982db4aSGavin Atkinson.Nm ftp .
1378f982db4aSGavin Atkinson.It Ic struct Ar struct-name
1379f982db4aSGavin AtkinsonSet the file transfer
1380f982db4aSGavin Atkinson.Ar structure
1381f982db4aSGavin Atkinsonto
1382f982db4aSGavin Atkinson.Ar struct-name .
1383f982db4aSGavin AtkinsonThe default (and only supported)
1384f982db4aSGavin Atkinsonstructure is
1385f982db4aSGavin Atkinson.Dq file .
1386f982db4aSGavin Atkinson.It Ic sunique
1387f982db4aSGavin AtkinsonToggle storing of files on remote machine under unique file names.
1388f982db4aSGavin AtkinsonThe remote
1389f982db4aSGavin Atkinson.Tn FTP
1390f982db4aSGavin Atkinsonserver must support
1391f982db4aSGavin Atkinson.Tn FTP
1392f982db4aSGavin Atkinsonprotocol
1393f982db4aSGavin Atkinson.Dv STOU
1394f982db4aSGavin Atkinsoncommand for
1395f982db4aSGavin Atkinsonsuccessful completion.
1396f982db4aSGavin AtkinsonThe remote server will report unique name.
1397f982db4aSGavin AtkinsonDefault value is off.
1398f982db4aSGavin Atkinson.It Ic system
1399f982db4aSGavin AtkinsonShow the type of operating system running on the remote machine.
1400f982db4aSGavin Atkinson.It Ic tenex
1401f982db4aSGavin AtkinsonSet the file transfer type to that needed to
1402f982db4aSGavin Atkinsontalk to
1403f982db4aSGavin Atkinson.Tn TENEX
1404f982db4aSGavin Atkinsonmachines.
1405f982db4aSGavin Atkinson.It Ic throttle
1406f982db4aSGavin AtkinsonA synonym for
1407f982db4aSGavin Atkinson.Ic rate .
1408f982db4aSGavin Atkinson.It Ic trace
1409f982db4aSGavin AtkinsonToggle packet tracing.
1410f982db4aSGavin Atkinson.It Ic type Op Ar type-name
1411f982db4aSGavin AtkinsonSet the file transfer
1412f982db4aSGavin Atkinson.Ic type
1413f982db4aSGavin Atkinsonto
1414f982db4aSGavin Atkinson.Ar type-name .
1415f982db4aSGavin AtkinsonIf no type is specified, the current type
1416f982db4aSGavin Atkinsonis printed.
1417f982db4aSGavin AtkinsonThe default type is network
1418f982db4aSGavin Atkinson.Tn ASCII .
1419f982db4aSGavin Atkinson.It Ic umask Op Ar newmask
1420f982db4aSGavin AtkinsonSet the default umask on the remote server to
1421f982db4aSGavin Atkinson.Ar newmask .
1422f982db4aSGavin AtkinsonIf
1423f982db4aSGavin Atkinson.Ar newmask
1424f982db4aSGavin Atkinsonis omitted, the current umask is printed.
1425f982db4aSGavin Atkinson.It Ic unset Ar option
1426f982db4aSGavin AtkinsonUnset
1427f982db4aSGavin Atkinson.Ar option .
1428f982db4aSGavin AtkinsonRefer to
1429f982db4aSGavin Atkinson.Ic set
1430f982db4aSGavin Atkinsonfor more information.
1431f982db4aSGavin Atkinson.It Ic usage Ar command
1432f982db4aSGavin AtkinsonPrint the usage message for
1433f982db4aSGavin Atkinson.Ar command .
1434*cc361f65SGavin Atkinson.It Ic user Ar user-name Oo Ar password Oo Ar account Oc Oc
1435f982db4aSGavin AtkinsonIdentify yourself to the remote
1436f982db4aSGavin Atkinson.Tn FTP
1437f982db4aSGavin Atkinsonserver.
1438f982db4aSGavin AtkinsonIf the
1439f982db4aSGavin Atkinson.Ar password
1440f982db4aSGavin Atkinsonis not specified and the server requires it,
1441f982db4aSGavin Atkinson.Nm
1442f982db4aSGavin Atkinsonwill prompt the user for it (after disabling local echo).
1443f982db4aSGavin AtkinsonIf an
1444f982db4aSGavin Atkinson.Ar account
1445f982db4aSGavin Atkinsonfield is not specified, and the
1446f982db4aSGavin Atkinson.Tn FTP
1447f982db4aSGavin Atkinsonserver
1448f982db4aSGavin Atkinsonrequires it, the user will be prompted for it.
1449f982db4aSGavin AtkinsonIf an
1450f982db4aSGavin Atkinson.Ar account
1451f982db4aSGavin Atkinsonfield is specified, an account command will
1452f982db4aSGavin Atkinsonbe relayed to the remote server after the login sequence
1453f982db4aSGavin Atkinsonis completed if the remote server did not require it
1454f982db4aSGavin Atkinsonfor logging in.
1455f982db4aSGavin AtkinsonUnless
1456f982db4aSGavin Atkinson.Nm
1457f982db4aSGavin Atkinsonis invoked with
1458f982db4aSGavin Atkinson.Dq auto-login
1459f982db4aSGavin Atkinsondisabled, this process is done automatically on initial connection to the
1460f982db4aSGavin Atkinson.Tn FTP
1461f982db4aSGavin Atkinsonserver.
1462f982db4aSGavin Atkinson.It Ic verbose
1463f982db4aSGavin AtkinsonToggle verbose mode.
1464f982db4aSGavin AtkinsonIn verbose mode, all responses from
1465f982db4aSGavin Atkinsonthe
1466f982db4aSGavin Atkinson.Tn FTP
1467f982db4aSGavin Atkinsonserver are displayed to the user.
1468f982db4aSGavin AtkinsonIn addition,
1469f982db4aSGavin Atkinsonif verbose is on, when a file transfer completes, statistics
1470f982db4aSGavin Atkinsonregarding the efficiency of the transfer are reported.
1471f982db4aSGavin AtkinsonBy default,
1472f982db4aSGavin Atkinsonverbose is on.
1473f982db4aSGavin Atkinson.It Ic xferbuf Ar size
1474f982db4aSGavin AtkinsonSet the size of the socket send and receive buffers to
1475f982db4aSGavin Atkinson.Ar size .
1476f982db4aSGavin Atkinson.It Ic \&? Op Ar command
1477f982db4aSGavin AtkinsonA synonym for
1478f982db4aSGavin Atkinson.Ic help .
1479f982db4aSGavin Atkinson.El
1480f982db4aSGavin Atkinson.Pp
1481f982db4aSGavin AtkinsonCommand arguments which have embedded spaces may be quoted with
1482*cc361f65SGavin Atkinsonquote
1483*cc361f65SGavin Atkinson.Sq \&"
1484*cc361f65SGavin Atkinsonmarks.
1485f982db4aSGavin Atkinson.Pp
1486f982db4aSGavin AtkinsonCommands which toggle settings can take an explicit
1487f982db4aSGavin Atkinson.Ic on
1488f982db4aSGavin Atkinsonor
1489f982db4aSGavin Atkinson.Ic off
1490f982db4aSGavin Atkinsonargument to force the setting appropriately.
1491f982db4aSGavin Atkinson.Pp
1492f982db4aSGavin AtkinsonCommands which take a byte count as an argument
1493f982db4aSGavin Atkinson(e.g.,
1494f982db4aSGavin Atkinson.Ic hash ,
1495f982db4aSGavin Atkinson.Ic rate ,
1496f982db4aSGavin Atkinsonand
1497f982db4aSGavin Atkinson.Ic xferbuf )
1498f982db4aSGavin Atkinsonsupport an optional suffix on the argument which changes the
1499f982db4aSGavin Atkinsoninterpretation of the argument.
1500f982db4aSGavin AtkinsonSupported suffixes are:
1501f982db4aSGavin Atkinson.Bl -tag -width 3n -offset indent -compact
1502f982db4aSGavin Atkinson.It Li b
1503f982db4aSGavin AtkinsonCauses no modification.
1504f982db4aSGavin Atkinson(Optional)
1505f982db4aSGavin Atkinson.It Li k
1506f982db4aSGavin AtkinsonKilo; multiply the argument by 1024
1507f982db4aSGavin Atkinson.It Li m
1508f982db4aSGavin AtkinsonMega; multiply the argument by 1048576
1509f982db4aSGavin Atkinson.It Li g
1510f982db4aSGavin AtkinsonGiga; multiply the argument by 1073741824
1511f982db4aSGavin Atkinson.El
1512f982db4aSGavin Atkinson.Pp
1513f982db4aSGavin AtkinsonIf
1514f982db4aSGavin Atkinson.Nm
1515f982db4aSGavin Atkinsonreceives a
1516f982db4aSGavin Atkinson.Dv SIGINFO
1517f982db4aSGavin Atkinson(see the
1518f982db4aSGavin Atkinson.Dq status
1519f982db4aSGavin Atkinsonargument of
1520f982db4aSGavin Atkinson.Xr stty 1 )
1521f982db4aSGavin Atkinsonor
1522f982db4aSGavin Atkinson.Dv SIGQUIT
1523f982db4aSGavin Atkinsonsignal whilst a transfer is in progress, the current transfer rate
1524f982db4aSGavin Atkinsonstatistics will be written to the standard error output, in the
1525f982db4aSGavin Atkinsonsame format as the standard completion message.
1526f982db4aSGavin Atkinson.Sh AUTO-FETCHING FILES
1527f982db4aSGavin AtkinsonIn addition to standard commands, this version of
1528f982db4aSGavin Atkinson.Nm
1529f982db4aSGavin Atkinsonsupports an auto-fetch feature.
1530f982db4aSGavin AtkinsonTo enable auto-fetch, simply pass the list of hostnames/files
1531f982db4aSGavin Atkinsonon the command line.
1532f982db4aSGavin Atkinson.Pp
1533f982db4aSGavin AtkinsonThe following formats are valid syntax for an auto-fetch element:
1534f982db4aSGavin Atkinson.Bl -tag -width "FOO "
1535f982db4aSGavin Atkinson.\" [user@]host:[path][/]
1536*cc361f65SGavin Atkinson.It Oo Ar user Ns Li \&@ Oc Ns Ar host Ns Li \&: Ns Oo Ar path Oc \
1537*cc361f65SGavin AtkinsonNs Oo Li / Oc
1538f982db4aSGavin Atkinson.Dq Classic
1539f982db4aSGavin Atkinson.Tn FTP
1540f982db4aSGavin Atkinsonformat.
1541f982db4aSGavin Atkinson.Pp
1542f982db4aSGavin AtkinsonIf
1543f982db4aSGavin Atkinson.Ar path
1544f982db4aSGavin Atkinsoncontains a glob character and globbing is enabled,
1545f982db4aSGavin Atkinson(see
1546f982db4aSGavin Atkinson.Ic glob ) ,
1547f982db4aSGavin Atkinsonthen the equivalent of
1548f982db4aSGavin Atkinson.Ql mget path
1549f982db4aSGavin Atkinsonis performed.
1550f982db4aSGavin Atkinson.Pp
1551f982db4aSGavin AtkinsonIf the directory component of
1552f982db4aSGavin Atkinson.Ar path
1553f982db4aSGavin Atkinsoncontains no globbing characters,
1554f982db4aSGavin Atkinsonit is stored locally with the name basename (see
1555f982db4aSGavin Atkinson.Xr basename 1 )
1556f982db4aSGavin Atkinsonof
1557f982db4aSGavin Atkinson.Ic path ,
1558f982db4aSGavin Atkinsonin the current directory.
1559f982db4aSGavin AtkinsonOtherwise, the full remote name is used as the local name,
1560f982db4aSGavin Atkinsonrelative to the local root directory.
1561f982db4aSGavin Atkinson.\" ftp://[user[:password]@]host[:port]/path[/][;type=X]
1562*cc361f65SGavin Atkinson.It Li ftp:// Ns Oo Ar user Ns Oo Ns Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1563*cc361f65SGavin AtkinsonNs Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path Ns Oo Li / Oc \
1564*cc361f65SGavin AtkinsonNs Oo Li ;type= Ns Ar X Oc
1565f982db4aSGavin AtkinsonAn
1566f982db4aSGavin Atkinson.Tn FTP
1567f982db4aSGavin AtkinsonURL, retrieved using the
1568f982db4aSGavin Atkinson.Tn FTP
1569f982db4aSGavin Atkinsonprotocol if
1570f982db4aSGavin Atkinson.Ic "set ftp_proxy"
1571f982db4aSGavin Atkinsonisn't defined.
1572f982db4aSGavin AtkinsonOtherwise, transfer the URL using
1573f982db4aSGavin Atkinson.Tn HTTP
1574f982db4aSGavin Atkinsonvia the proxy defined in
1575f982db4aSGavin Atkinson.Ic "set ftp_proxy" .
1576f982db4aSGavin AtkinsonIf
1577f982db4aSGavin Atkinson.Ic "set ftp_proxy"
1578f982db4aSGavin Atkinsonisn't defined and
1579f982db4aSGavin Atkinson.Ar user
1580f982db4aSGavin Atkinsonis given, login as
1581f982db4aSGavin Atkinson.Ar user .
1582f982db4aSGavin AtkinsonIn this case, use
1583f982db4aSGavin Atkinson.Ar password
1584f982db4aSGavin Atkinsonif supplied, otherwise prompt the user for one.
1585f982db4aSGavin Atkinson.Pp
1586f982db4aSGavin AtkinsonIf a suffix of
1587f982db4aSGavin Atkinson.Sq ;type=A
1588f982db4aSGavin Atkinsonor
1589f982db4aSGavin Atkinson.Sq ;type=I
1590f982db4aSGavin Atkinsonis supplied, then the transfer type will take place as
1591f982db4aSGavin Atkinsonascii or binary (respectively).
1592f982db4aSGavin AtkinsonThe default transfer type is binary.
1593f982db4aSGavin Atkinson.Pp
1594f982db4aSGavin AtkinsonIn order to be compliant with
1595*cc361f65SGavin Atkinson.Li RFC3986 ,
1596f982db4aSGavin Atkinson.Nm
1597f982db4aSGavin Atkinsoninterprets the
1598f982db4aSGavin Atkinson.Ar path
1599f982db4aSGavin Atkinsonpart of an
1600f982db4aSGavin Atkinson.Dq ftp://
1601f982db4aSGavin Atkinsonauto-fetch URL as follows:
1602f982db4aSGavin Atkinson.Bl -bullet
1603f982db4aSGavin Atkinson.It
1604f982db4aSGavin AtkinsonThe
1605f982db4aSGavin Atkinson.Sq Li /
1606f982db4aSGavin Atkinsonimmediately after the
1607f982db4aSGavin Atkinson.Ar host Ns Oo Li \&: Ns Ar port Oc
1608f982db4aSGavin Atkinsonis interpreted as a separator before the
1609f982db4aSGavin Atkinson.Ar path ,
1610f982db4aSGavin Atkinsonand not as part of the
1611f982db4aSGavin Atkinson.Ar path
1612f982db4aSGavin Atkinsonitself.
1613f982db4aSGavin Atkinson.It
1614f982db4aSGavin AtkinsonThe
1615f982db4aSGavin Atkinson.Ar path
1616f982db4aSGavin Atkinsonis interpreted as a
1617f982db4aSGavin Atkinson.So Li / Sc Ns -separated
1618f982db4aSGavin Atkinsonlist of name components.
1619f982db4aSGavin AtkinsonFor all but the last such component,
1620f982db4aSGavin Atkinson.Nm
1621f982db4aSGavin Atkinsonperforms the equivalent of a
1622f982db4aSGavin Atkinson.Ic cd
1623f982db4aSGavin Atkinsoncommand.
1624f982db4aSGavin AtkinsonFor the last path component,
1625f982db4aSGavin Atkinson.Nm
1626f982db4aSGavin Atkinsonperforms the equivalent of a
1627f982db4aSGavin Atkinson.Ic get
1628f982db4aSGavin Atkinsoncommand.
1629f982db4aSGavin Atkinson.It
1630f982db4aSGavin AtkinsonEmpty name components,
1631f982db4aSGavin Atkinsonwhich result from
1632f982db4aSGavin Atkinson.Sq Li //
1633f982db4aSGavin Atkinsonwithin the
1634f982db4aSGavin Atkinson.Ar path ,
1635f982db4aSGavin Atkinsonor from an extra
1636f982db4aSGavin Atkinson.Sq Li /
1637f982db4aSGavin Atkinsonat the beginning of the
1638f982db4aSGavin Atkinson.Ar path ,
1639f982db4aSGavin Atkinsonwill cause the equivalent of a
1640f982db4aSGavin Atkinson.Ic cd
1641f982db4aSGavin Atkinsoncommand without a directory name.
1642f982db4aSGavin AtkinsonThis is unlikely to be useful.
1643f982db4aSGavin Atkinson.It
1644f982db4aSGavin AtkinsonAny
1645f982db4aSGavin Atkinson.Sq Li \&% Ns Ar XX
1646f982db4aSGavin Atkinsoncodes
1647f982db4aSGavin Atkinson(per
1648*cc361f65SGavin Atkinson.Li RFC3986 )
1649f982db4aSGavin Atkinsonwithin the path components are decoded, with
1650f982db4aSGavin Atkinson.Ar XX
1651f982db4aSGavin Atkinsonrepresenting a character code in hexadecimal.
1652f982db4aSGavin AtkinsonThis decoding takes place after the
1653f982db4aSGavin Atkinson.Ar path
1654f982db4aSGavin Atkinsonhas been split into components,
1655f982db4aSGavin Atkinsonbut before each component is used in the equivalent of a
1656f982db4aSGavin Atkinson.Ic cd
1657f982db4aSGavin Atkinsonor
1658f982db4aSGavin Atkinson.Ic get
1659f982db4aSGavin Atkinsoncommand.
1660f982db4aSGavin AtkinsonSome often-used codes are
1661f982db4aSGavin Atkinson.Sq Li \&%2F
1662f982db4aSGavin Atkinson(which represents
1663f982db4aSGavin Atkinson.Sq Li / )
1664f982db4aSGavin Atkinsonand
1665f982db4aSGavin Atkinson.Sq Li \&%7E
1666f982db4aSGavin Atkinson(which represents
1667f982db4aSGavin Atkinson.Sq Li ~ ) .
1668f982db4aSGavin Atkinson.El
1669f982db4aSGavin Atkinson.Pp
1670f982db4aSGavin AtkinsonThe above interpretation has the following consequences:
1671f982db4aSGavin Atkinson.Bl -bullet
1672f982db4aSGavin Atkinson.It
1673f982db4aSGavin AtkinsonThe path is interpreted relative to the
1674f982db4aSGavin Atkinsondefault login directory of the specified user or of the
1675f982db4aSGavin Atkinson.Sq anonymous
1676f982db4aSGavin Atkinsonuser.
1677f982db4aSGavin AtkinsonIf the
1678f982db4aSGavin Atkinson.Pa /
1679f982db4aSGavin Atkinsondirectory is required, use a leading path of
1680f982db4aSGavin Atkinson.Dq %2F .
1681f982db4aSGavin AtkinsonIf a user's home directory is required (and the remote server supports
1682f982db4aSGavin Atkinsonthe syntax), use a leading path of
1683f982db4aSGavin Atkinson.Dq %7Euser/ .
1684f982db4aSGavin AtkinsonFor example, to retrieve
1685f982db4aSGavin Atkinson.Pa /etc/motd
1686f982db4aSGavin Atkinsonfrom
1687f982db4aSGavin Atkinson.Sq localhost
1688f982db4aSGavin Atkinsonas the user
1689f982db4aSGavin Atkinson.Sq myname
1690f982db4aSGavin Atkinsonwith the password
1691f982db4aSGavin Atkinson.Sq mypass ,
1692f982db4aSGavin Atkinsonuse
1693f982db4aSGavin Atkinson.Dq ftp://myname:mypass@localhost/%2fetc/motd
1694f982db4aSGavin Atkinson.It
1695f982db4aSGavin AtkinsonThe exact
1696f982db4aSGavin Atkinson.Ic cd
1697f982db4aSGavin Atkinsonand
1698f982db4aSGavin Atkinson.Ic get
1699f982db4aSGavin Atkinsoncommands can be controlled by careful choice of
1700f982db4aSGavin Atkinsonwhere to use
1701f982db4aSGavin Atkinson.Sq /
1702f982db4aSGavin Atkinsonand where to use
1703f982db4aSGavin Atkinson.Sq %2F
1704f982db4aSGavin Atkinson(or
1705f982db4aSGavin Atkinson.Sq %2f ) .
1706f982db4aSGavin AtkinsonFor example, the following URLs correspond to the
1707f982db4aSGavin Atkinsonequivalents of the indicated commands:
1708f982db4aSGavin Atkinson.Bl -tag -width "ftp://host/%2Fdir1%2Fdir2%2Ffile"
1709f982db4aSGavin Atkinson.It ftp://host/dir1/dir2/file
1710f982db4aSGavin Atkinson.Dq "cd dir1" ,
1711f982db4aSGavin Atkinson.Dq "cd dir2" ,
1712f982db4aSGavin Atkinson.Dq "get file" .
1713f982db4aSGavin Atkinson.It ftp://host/%2Fdir1/dir2/file
1714f982db4aSGavin Atkinson.Dq "cd /dir1" ,
1715f982db4aSGavin Atkinson.Dq "cd dir2" ,
1716f982db4aSGavin Atkinson.Dq "get file" .
1717f982db4aSGavin Atkinson.It ftp://host/dir1%2Fdir2/file
1718f982db4aSGavin Atkinson.Dq "cd dir1/dir2" ,
1719f982db4aSGavin Atkinson.Dq "get file" .
1720f982db4aSGavin Atkinson.It ftp://host/%2Fdir1%2Fdir2/file
1721f982db4aSGavin Atkinson.Dq "cd /dir1/dir2" ,
1722f982db4aSGavin Atkinson.Dq "get file" .
1723f982db4aSGavin Atkinson.It ftp://host/dir1%2Fdir2%2Ffile
1724f982db4aSGavin Atkinson.Dq "get dir1/dir2/file" .
1725f982db4aSGavin Atkinson.It ftp://host/%2Fdir1%2Fdir2%2Ffile
1726f982db4aSGavin Atkinson.Dq "get /dir1/dir2/file" .
1727f982db4aSGavin Atkinson.El
1728f982db4aSGavin Atkinson.It
1729f982db4aSGavin AtkinsonYou must have appropriate access permission for each of the
1730f982db4aSGavin Atkinsonintermediate directories that is used in the equivalent of a
1731f982db4aSGavin Atkinson.Ic cd
1732f982db4aSGavin Atkinsoncommand.
1733f982db4aSGavin Atkinson.El
1734f982db4aSGavin Atkinson.\" http://[user[:password]@]host[:port]/path
1735*cc361f65SGavin Atkinson.It Li http:// Ns Oo Ar user Ns Oo Li \&: Ns Ar password Oc Ns Li \&@ Oc \
1736*cc361f65SGavin AtkinsonNs Ar host Ns Oo Li \&: Ns Ar port Oc Ns Li / Ns Ar path
1737f982db4aSGavin AtkinsonAn
1738f982db4aSGavin Atkinson.Tn HTTP
1739f982db4aSGavin AtkinsonURL, retrieved using the
1740f982db4aSGavin Atkinson.Tn HTTP
1741f982db4aSGavin Atkinsonprotocol.
1742f982db4aSGavin AtkinsonIf
1743f982db4aSGavin Atkinson.Ic "set http_proxy"
1744f982db4aSGavin Atkinsonis defined, it is used as a URL to an
1745f982db4aSGavin Atkinson.Tn HTTP
1746f982db4aSGavin Atkinsonproxy server.
1747f982db4aSGavin AtkinsonIf
1748f982db4aSGavin Atkinson.Tn HTTP
1749f982db4aSGavin Atkinsonauthorization is required to retrieve
1750f982db4aSGavin Atkinson.Ar path ,
1751f982db4aSGavin Atkinsonand
1752f982db4aSGavin Atkinson.Sq user
1753f982db4aSGavin Atkinson(and optionally
1754f982db4aSGavin Atkinson.Sq password )
1755f982db4aSGavin Atkinsonis in the URL, use them for the first attempt to authenticate.
1756f982db4aSGavin Atkinson.\" file:///path
1757*cc361f65SGavin Atkinson.It Li file:/// Ns Ar path
1758f982db4aSGavin AtkinsonA local URL, copied from
1759f982db4aSGavin Atkinson.Pa / Ns Ar path
1760f982db4aSGavin Atkinsonon the local host.
1761*cc361f65SGavin Atkinson.\" about:
1762*cc361f65SGavin Atkinson.It Li about: Ns Ar topic
1763*cc361f65SGavin AtkinsonDisplay information regarding
1764*cc361f65SGavin Atkinson.Ar topic ;
1765*cc361f65SGavin Atkinsonno file is retrieved for this auto-fetched element.
1766*cc361f65SGavin AtkinsonSupported values include:
1767*cc361f65SGavin Atkinson.Bl -tag -width "about:version"
1768*cc361f65SGavin Atkinson.It Li about:ftp
1769*cc361f65SGavin AtkinsonInformation about
1770*cc361f65SGavin Atkinson.Nm ftp .
1771*cc361f65SGavin Atkinson.It Li about:version
1772*cc361f65SGavin AtkinsonThe version of
1773*cc361f65SGavin Atkinson.Nm ftp .
1774*cc361f65SGavin AtkinsonUseful to provide when reporting problems.
1775*cc361f65SGavin Atkinson.El
1776f982db4aSGavin Atkinson.El
1777f982db4aSGavin Atkinson.Pp
1778f982db4aSGavin AtkinsonUnless noted otherwise above, and
1779f982db4aSGavin Atkinson.Fl o Ar output
1780f982db4aSGavin Atkinsonis not given, the file is stored in the current directory as the
1781f982db4aSGavin Atkinson.Xr basename 1
1782f982db4aSGavin Atkinsonof
1783f982db4aSGavin Atkinson.Ar path .
1784f982db4aSGavin AtkinsonNote that if a
1785f982db4aSGavin Atkinson.Tn HTTP
1786f982db4aSGavin Atkinsonredirect is received, the fetch is retried using the new target URL
1787f982db4aSGavin Atkinsonsupplied by the server, with a corresponding new
1788f982db4aSGavin Atkinson.Ar path .
1789f982db4aSGavin AtkinsonUsing an explicit
1790f982db4aSGavin Atkinson.Fl o Ar output
1791f982db4aSGavin Atkinsonis recommended, to avoid writing to unexpected file names.
1792f982db4aSGavin Atkinson.Pp
1793f982db4aSGavin AtkinsonIf a classic format or an
1794f982db4aSGavin Atkinson.Tn FTP
1795f982db4aSGavin AtkinsonURL format has a trailing
1796f982db4aSGavin Atkinson.Sq /
1797f982db4aSGavin Atkinsonor an empty
1798f982db4aSGavin Atkinson.Ar path
1799f982db4aSGavin Atkinsoncomponent, then
1800f982db4aSGavin Atkinson.Nm
1801f982db4aSGavin Atkinsonwill connect to the site and
1802f982db4aSGavin Atkinson.Ic cd
1803f982db4aSGavin Atkinsonto the directory given as the path, and leave the user in interactive
1804f982db4aSGavin Atkinsonmode ready for further input.
1805f982db4aSGavin AtkinsonThis will not work if
1806f982db4aSGavin Atkinson.Ic "set ftp_proxy"
1807f982db4aSGavin Atkinsonis being used.
1808f982db4aSGavin Atkinson.Pp
1809f982db4aSGavin AtkinsonDirect
1810f982db4aSGavin Atkinson.Tn HTTP
1811f982db4aSGavin Atkinsontransfers use HTTP 1.1.
1812f982db4aSGavin AtkinsonProxied
1813f982db4aSGavin Atkinson.Tn FTP
1814f982db4aSGavin Atkinsonand
1815f982db4aSGavin Atkinson.Tn HTTP
1816f982db4aSGavin Atkinsontransfers use HTTP 1.0.
1817f982db4aSGavin Atkinson.Pp
1818f982db4aSGavin AtkinsonIf
1819f982db4aSGavin Atkinson.Fl R
1820f982db4aSGavin Atkinsonis given, all auto-fetches that don't go via the
1821f982db4aSGavin Atkinson.Tn FTP
1822f982db4aSGavin Atkinsonor
1823f982db4aSGavin Atkinson.Tn HTTP
1824f982db4aSGavin Atkinsonproxies will be restarted.
1825f982db4aSGavin AtkinsonFor
1826f982db4aSGavin Atkinson.Tn FTP ,
1827f982db4aSGavin Atkinsonthis is implemented by using
1828f982db4aSGavin Atkinson.Nm reget
1829f982db4aSGavin Atkinsoninstead of
1830f982db4aSGavin Atkinson.Nm get .
1831f982db4aSGavin AtkinsonFor
1832f982db4aSGavin Atkinson.Tn HTTP ,
1833f982db4aSGavin Atkinsonthis is implemented by using the
1834f982db4aSGavin Atkinson.Sq "Range: bytes="
1835f982db4aSGavin Atkinson.Tn "HTTP/1.1"
1836f982db4aSGavin Atkinsondirective.
1837f982db4aSGavin Atkinson.Pp
1838f982db4aSGavin AtkinsonIf WWW or proxy WWW authentication is required, you will be prompted
1839f982db4aSGavin Atkinsonto enter a username and password to authenticate with.
1840f982db4aSGavin Atkinson.Pp
1841f982db4aSGavin AtkinsonWhen specifying IPv6 numeric addresses in a URL, you need to
1842f982db4aSGavin Atkinsonsurround the address in square brackets.
1843f982db4aSGavin AtkinsonE.g.:
1844f982db4aSGavin Atkinson.Dq ftp://[::1]:21/ .
1845f982db4aSGavin AtkinsonThis is because colons are used in IPv6 numeric address as well as
1846f982db4aSGavin Atkinsonbeing the separator for the port number.
1847f982db4aSGavin Atkinson.Sh ABORTING A FILE TRANSFER
1848f982db4aSGavin AtkinsonTo abort a file transfer, use the terminal interrupt key
1849f982db4aSGavin Atkinson(usually Ctrl-C).
1850f982db4aSGavin AtkinsonSending transfers will be immediately halted.
1851f982db4aSGavin AtkinsonReceiving transfers will be halted by sending an
1852f982db4aSGavin Atkinson.Tn FTP
1853f982db4aSGavin Atkinsonprotocol
1854f982db4aSGavin Atkinson.Dv ABOR
1855f982db4aSGavin Atkinsoncommand to the remote server, and discarding any further data received.
1856f982db4aSGavin AtkinsonThe speed at which this is accomplished depends upon the remote
1857f982db4aSGavin Atkinsonserver's support for
1858f982db4aSGavin Atkinson.Dv ABOR
1859f982db4aSGavin Atkinsonprocessing.
1860f982db4aSGavin AtkinsonIf the remote server does not support the
1861f982db4aSGavin Atkinson.Dv ABOR
1862f982db4aSGavin Atkinsoncommand, the prompt will not appear until the remote server has completed
1863f982db4aSGavin Atkinsonsending the requested file.
1864f982db4aSGavin Atkinson.Pp
1865f982db4aSGavin AtkinsonIf the terminal interrupt key sequence is used whilst
1866f982db4aSGavin Atkinson.Nm
1867f982db4aSGavin Atkinsonis awaiting a reply from the remote server for the ABOR processing,
1868f982db4aSGavin Atkinsonthen the connection will be closed.
1869f982db4aSGavin AtkinsonThis is different from the traditional behaviour (which ignores the
1870f982db4aSGavin Atkinsonterminal interrupt during this phase), but is considered more useful.
1871f982db4aSGavin Atkinson.Sh FILE NAMING CONVENTIONS
1872f982db4aSGavin AtkinsonFiles specified as arguments to
1873f982db4aSGavin Atkinson.Nm
1874f982db4aSGavin Atkinsoncommands are processed according to the following rules.
1875f982db4aSGavin Atkinson.Bl -enum
1876f982db4aSGavin Atkinson.It
1877f982db4aSGavin AtkinsonIf the file name
1878f982db4aSGavin Atkinson.Sq Fl
1879f982db4aSGavin Atkinsonis specified, the
1880f982db4aSGavin Atkinson.Ar stdin
1881f982db4aSGavin Atkinson(for reading) or
1882f982db4aSGavin Atkinson.Ar stdout
1883f982db4aSGavin Atkinson(for writing) is used.
1884f982db4aSGavin Atkinson.It
1885f982db4aSGavin AtkinsonIf the first character of the file name is
1886f982db4aSGavin Atkinson.Sq \&| ,
1887f982db4aSGavin Atkinsonthe
1888f982db4aSGavin Atkinsonremainder of the argument is interpreted as a shell command.
1889f982db4aSGavin Atkinson.Nm
1890f982db4aSGavin Atkinsonthen forks a shell, using
1891f982db4aSGavin Atkinson.Xr popen 3
1892f982db4aSGavin Atkinsonwith the argument supplied, and reads (writes) from the stdout
1893f982db4aSGavin Atkinson(stdin).
1894f982db4aSGavin AtkinsonIf the shell command includes spaces, the argument
1895f982db4aSGavin Atkinsonmust be quoted; e.g.
1896f982db4aSGavin Atkinson.Dq Qq Li \&| ls\ \-lt .
1897f982db4aSGavin AtkinsonA particularly
1898f982db4aSGavin Atkinsonuseful example of this mechanism is:
1899f982db4aSGavin Atkinson.Dq Li dir \&"\&" \&|more .
1900f982db4aSGavin Atkinson.It
1901*cc361f65SGavin AtkinsonFailing the above checks, if
1902*cc361f65SGavin Atkinson.Dq globbing
1903*cc361f65SGavin Atkinsonis enabled, local file names are expanded according to the rules
1904*cc361f65SGavin Atkinsonused in the
1905f982db4aSGavin Atkinson.Xr csh  1  ;
1906*cc361f65SGavin Atkinsonsee the
1907f982db4aSGavin Atkinson.Ic glob
1908f982db4aSGavin Atkinsoncommand.
1909f982db4aSGavin AtkinsonIf the
1910f982db4aSGavin Atkinson.Nm
1911f982db4aSGavin Atkinsoncommand expects a single local file (e.g.
1912f982db4aSGavin Atkinson.Ic put  ) ,
1913f982db4aSGavin Atkinsononly the first filename generated by the "globbing" operation is used.
1914f982db4aSGavin Atkinson.It
1915f982db4aSGavin AtkinsonFor
1916f982db4aSGavin Atkinson.Ic mget
1917f982db4aSGavin Atkinsoncommands and
1918f982db4aSGavin Atkinson.Ic get
1919f982db4aSGavin Atkinsoncommands with unspecified local file names, the local filename is
1920f982db4aSGavin Atkinsonthe remote filename, which may be altered by a
1921f982db4aSGavin Atkinson.Ic case  ,
1922f982db4aSGavin Atkinson.Ic ntrans ,
1923f982db4aSGavin Atkinsonor
1924f982db4aSGavin Atkinson.Ic nmap
1925f982db4aSGavin Atkinsonsetting.
1926f982db4aSGavin AtkinsonThe resulting filename may then be altered if
1927f982db4aSGavin Atkinson.Ic runique
1928f982db4aSGavin Atkinsonis on.
1929f982db4aSGavin Atkinson.It
1930f982db4aSGavin AtkinsonFor
1931f982db4aSGavin Atkinson.Ic mput
1932f982db4aSGavin Atkinsoncommands and
1933f982db4aSGavin Atkinson.Ic put
1934f982db4aSGavin Atkinsoncommands with unspecified remote file names, the remote filename is
1935f982db4aSGavin Atkinsonthe local filename, which may be altered by a
1936f982db4aSGavin Atkinson.Ic ntrans
1937f982db4aSGavin Atkinsonor
1938f982db4aSGavin Atkinson.Ic nmap
1939f982db4aSGavin Atkinsonsetting.
1940f982db4aSGavin AtkinsonThe resulting filename may then be altered by the remote server if
1941f982db4aSGavin Atkinson.Ic sunique
1942f982db4aSGavin Atkinsonis on.
1943f982db4aSGavin Atkinson.El
1944f982db4aSGavin Atkinson.Sh FILE TRANSFER PARAMETERS
1945f982db4aSGavin AtkinsonThe
1946f982db4aSGavin Atkinson.Tn FTP
1947f982db4aSGavin Atkinsonspecification specifies many parameters which may affect a file transfer.
1948f982db4aSGavin AtkinsonThe
1949f982db4aSGavin Atkinson.Ic type
1950f982db4aSGavin Atkinsonmay be one of
1951f982db4aSGavin Atkinson.Dq ascii ,
1952f982db4aSGavin Atkinson.Dq image
1953f982db4aSGavin Atkinson(binary),
1954f982db4aSGavin Atkinson.Dq ebcdic ,
1955f982db4aSGavin Atkinsonand
1956f982db4aSGavin Atkinson.Dq local byte size
1957f982db4aSGavin Atkinson(for
1958f982db4aSGavin Atkinson.Tn PDP Ns -10's
1959f982db4aSGavin Atkinsonand
1960f982db4aSGavin Atkinson.Tn PDP Ns -20's
1961f982db4aSGavin Atkinsonmostly).
1962f982db4aSGavin Atkinson.Nm
1963f982db4aSGavin Atkinsonsupports the ascii and image types of file transfer,
1964f982db4aSGavin Atkinsonplus local byte size 8 for
1965f982db4aSGavin Atkinson.Ic tenex
1966f982db4aSGavin Atkinsonmode transfers.
1967f982db4aSGavin Atkinson.Pp
1968f982db4aSGavin Atkinson.Nm
1969f982db4aSGavin Atkinsonsupports only the default values for the remaining
1970f982db4aSGavin Atkinsonfile transfer parameters:
1971f982db4aSGavin Atkinson.Ic mode ,
1972f982db4aSGavin Atkinson.Ic form ,
1973f982db4aSGavin Atkinsonand
1974f982db4aSGavin Atkinson.Ic struct .
1975f982db4aSGavin Atkinson.Sh THE .netrc FILE
1976f982db4aSGavin AtkinsonThe
1977f982db4aSGavin Atkinson.Pa .netrc
1978f982db4aSGavin Atkinsonfile contains login and initialization information
1979f982db4aSGavin Atkinsonused by the auto-login process.
1980f982db4aSGavin AtkinsonIt resides in the user's home directory,
1981f982db4aSGavin Atkinsonunless overridden with the
1982f982db4aSGavin Atkinson.Fl N Ar netrc
1983f982db4aSGavin Atkinsonoption, or specified in the
1984f982db4aSGavin Atkinson.Ev NETRC
1985f982db4aSGavin Atkinsonenvironment variable.
1986f982db4aSGavin AtkinsonThe following tokens are recognized; they may be separated by spaces,
1987f982db4aSGavin Atkinsontabs, or new-lines:
1988f982db4aSGavin Atkinson.Bl -tag -width password
1989f982db4aSGavin Atkinson.It Ic machine Ar name
1990f982db4aSGavin AtkinsonIdentify a remote machine
1991f982db4aSGavin Atkinson.Ar name .
1992f982db4aSGavin AtkinsonThe auto-login process searches the
1993f982db4aSGavin Atkinson.Pa .netrc
1994f982db4aSGavin Atkinsonfile for a
1995f982db4aSGavin Atkinson.Ic machine
1996f982db4aSGavin Atkinsontoken that matches the remote machine specified on the
1997f982db4aSGavin Atkinson.Nm
1998f982db4aSGavin Atkinsoncommand line or as an
1999f982db4aSGavin Atkinson.Ic open
2000f982db4aSGavin Atkinsoncommand argument.
2001f982db4aSGavin AtkinsonOnce a match is made, the subsequent
2002f982db4aSGavin Atkinson.Pa .netrc
2003f982db4aSGavin Atkinsontokens are processed,
2004f982db4aSGavin Atkinsonstopping when the end of file is reached or another
2005f982db4aSGavin Atkinson.Ic machine
2006f982db4aSGavin Atkinsonor a
2007f982db4aSGavin Atkinson.Ic default
2008f982db4aSGavin Atkinsontoken is encountered.
2009f982db4aSGavin Atkinson.It Ic default
2010f982db4aSGavin AtkinsonThis is the same as
2011f982db4aSGavin Atkinson.Ic machine
2012f982db4aSGavin Atkinson.Ar name
2013f982db4aSGavin Atkinsonexcept that
2014f982db4aSGavin Atkinson.Ic default
2015f982db4aSGavin Atkinsonmatches any name.
2016f982db4aSGavin AtkinsonThere can be only one
2017f982db4aSGavin Atkinson.Ic default
2018f982db4aSGavin Atkinsontoken, and it must be after all
2019f982db4aSGavin Atkinson.Ic machine
2020f982db4aSGavin Atkinsontokens.
2021f982db4aSGavin AtkinsonThis is normally used as:
2022f982db4aSGavin Atkinson.Pp
2023f982db4aSGavin Atkinson.Dl default login anonymous password user@site
2024f982db4aSGavin Atkinson.Pp
2025f982db4aSGavin Atkinsonthereby giving the user an automatic anonymous
2026f982db4aSGavin Atkinson.Tn FTP
2027f982db4aSGavin Atkinsonlogin to
2028f982db4aSGavin Atkinsonmachines not specified in
2029f982db4aSGavin Atkinson.Pa .netrc .
2030f982db4aSGavin AtkinsonThis can be overridden
2031f982db4aSGavin Atkinsonby using the
2032f982db4aSGavin Atkinson.Fl n
2033f982db4aSGavin Atkinsonflag to disable auto-login.
2034f982db4aSGavin Atkinson.It Ic login Ar name
2035f982db4aSGavin AtkinsonIdentify a user on the remote machine.
2036f982db4aSGavin AtkinsonIf this token is present, the auto-login process will initiate
2037f982db4aSGavin Atkinsona login using the specified
2038f982db4aSGavin Atkinson.Ar name .
2039f982db4aSGavin Atkinson.It Ic password Ar string
2040f982db4aSGavin AtkinsonSupply a password.
2041f982db4aSGavin AtkinsonIf this token is present, the auto-login process will supply the
2042f982db4aSGavin Atkinsonspecified string if the remote server requires a password as part
2043f982db4aSGavin Atkinsonof the login process.
2044f982db4aSGavin AtkinsonNote that if this token is present in the
2045f982db4aSGavin Atkinson.Pa .netrc
2046f982db4aSGavin Atkinsonfile for any user other
2047f982db4aSGavin Atkinsonthan
2048f982db4aSGavin Atkinson.Ar anonymous  ,
2049f982db4aSGavin Atkinson.Nm
2050f982db4aSGavin Atkinsonwill abort the auto-login process if the
2051f982db4aSGavin Atkinson.Pa .netrc
2052f982db4aSGavin Atkinsonis readable by
2053f982db4aSGavin Atkinsonanyone besides the user.
2054f982db4aSGavin Atkinson.It Ic account Ar string
2055f982db4aSGavin AtkinsonSupply an additional account password.
2056f982db4aSGavin AtkinsonIf this token is present, the auto-login process will supply the
2057f982db4aSGavin Atkinsonspecified string if the remote server requires an additional
2058f982db4aSGavin Atkinsonaccount password, or the auto-login process will initiate an
2059f982db4aSGavin Atkinson.Dv ACCT
2060f982db4aSGavin Atkinsoncommand if it does not.
2061f982db4aSGavin Atkinson.It Ic macdef Ar name
2062f982db4aSGavin AtkinsonDefine a macro.
2063f982db4aSGavin AtkinsonThis token functions like the
2064f982db4aSGavin Atkinson.Nm
2065f982db4aSGavin Atkinson.Ic macdef
2066f982db4aSGavin Atkinsoncommand functions.
2067f982db4aSGavin AtkinsonA macro is defined with the specified name; its contents begin with the
2068f982db4aSGavin Atkinsonnext
2069f982db4aSGavin Atkinson.Pa .netrc
2070f982db4aSGavin Atkinsonline and continue until a blank line (consecutive new-line
2071f982db4aSGavin Atkinsoncharacters) is encountered.
2072*cc361f65SGavin AtkinsonLike the other tokens in the
2073*cc361f65SGavin Atkinson.Pa .netrc
2074*cc361f65SGavin Atkinsonfile, a
2075*cc361f65SGavin Atkinson.Ic macdef
2076*cc361f65SGavin Atkinsonis applicable only to the
2077*cc361f65SGavin Atkinson.Ic machine
2078*cc361f65SGavin Atkinsondefinition preceding it.
2079*cc361f65SGavin AtkinsonA
2080*cc361f65SGavin Atkinson.Ic macdef
2081*cc361f65SGavin Atkinsonentry cannot be used by multiple
2082*cc361f65SGavin Atkinson.Ic machine
2083*cc361f65SGavin Atkinsondefinitions; rather, it must be defined following each
2084*cc361f65SGavin Atkinson.Ic machine
2085*cc361f65SGavin Atkinsonit is intended to be used with.
2086f982db4aSGavin AtkinsonIf a macro named
2087f982db4aSGavin Atkinson.Ic init
2088f982db4aSGavin Atkinsonis defined, it is automatically executed as the last step in the
2089f982db4aSGavin Atkinsonauto-login process.
2090f982db4aSGavin AtkinsonFor example,
2091f982db4aSGavin Atkinson.Bd -literal -offset indent
2092f982db4aSGavin Atkinsondefault
2093f982db4aSGavin Atkinsonmacdef init
2094f982db4aSGavin Atkinsonepsv4 off
2095f982db4aSGavin Atkinson.Ed
2096f982db4aSGavin Atkinson.Pp
2097f982db4aSGavin Atkinsonfollowed by a blank line.
2098f982db4aSGavin Atkinson.El
2099f982db4aSGavin Atkinson.Sh COMMAND LINE EDITING
2100f982db4aSGavin Atkinson.Nm
2101f982db4aSGavin Atkinsonsupports interactive command line editing, via the
2102f982db4aSGavin Atkinson.Xr editline 3
2103f982db4aSGavin Atkinsonlibrary.
2104f982db4aSGavin AtkinsonIt is enabled with the
2105f982db4aSGavin Atkinson.Ic edit
2106f982db4aSGavin Atkinsoncommand, and is enabled by default if input is from a tty.
2107f982db4aSGavin AtkinsonPrevious lines can be recalled and edited with the arrow keys,
2108f982db4aSGavin Atkinsonand other GNU Emacs-style editing keys may be used as well.
2109f982db4aSGavin Atkinson.Pp
2110f982db4aSGavin AtkinsonThe
2111f982db4aSGavin Atkinson.Xr editline 3
2112f982db4aSGavin Atkinsonlibrary is configured with a
2113f982db4aSGavin Atkinson.Pa .editrc
2114f982db4aSGavin Atkinsonfile - refer to
2115f982db4aSGavin Atkinson.Xr editrc 5
2116f982db4aSGavin Atkinsonfor more information.
2117f982db4aSGavin Atkinson.Pp
2118f982db4aSGavin AtkinsonAn extra key binding is available to
2119f982db4aSGavin Atkinson.Nm
2120f982db4aSGavin Atkinsonto provide context sensitive command and filename completion
2121f982db4aSGavin Atkinson(including remote file completion).
2122f982db4aSGavin AtkinsonTo use this, bind a key to the
2123f982db4aSGavin Atkinson.Xr editline 3
2124f982db4aSGavin Atkinsoncommand
2125f982db4aSGavin Atkinson.Ic ftp-complete .
2126f982db4aSGavin AtkinsonBy default, this is bound to the TAB key.
2127f982db4aSGavin Atkinson.Sh COMMAND LINE PROMPT
2128f982db4aSGavin AtkinsonBy default,
2129f982db4aSGavin Atkinson.Nm
2130f982db4aSGavin Atkinsondisplays a command line prompt of
2131f982db4aSGavin Atkinson.Dq "ftp\*[Gt] "
2132f982db4aSGavin Atkinsonto the user.
2133f982db4aSGavin AtkinsonThis can be changed with the
2134f982db4aSGavin Atkinson.Ic "set prompt"
2135f982db4aSGavin Atkinsoncommand.
2136f982db4aSGavin Atkinson.Pp
2137f982db4aSGavin AtkinsonA prompt can be displayed on the right side of the screen (after the
2138f982db4aSGavin Atkinsoncommand input) with the
2139f982db4aSGavin Atkinson.Ic "set rprompt"
2140f982db4aSGavin Atkinsoncommand.
2141f982db4aSGavin Atkinson.Pp
2142f982db4aSGavin AtkinsonThe following formatting sequences are replaced by the given
2143f982db4aSGavin Atkinsoninformation:
2144f982db4aSGavin Atkinson.Bl -tag -width "%% " -offset indent
2145f982db4aSGavin Atkinson.It Li \&%/
2146f982db4aSGavin AtkinsonThe current remote working directory.
2147f982db4aSGavin Atkinson.\" %c[[0]n], %.[[0]n]
2148*cc361f65SGavin Atkinson.It \&%c Ns Oo Oo Li 0 Oc Ns Ar n Oc , Ns Li \&%. Ns Oo Oo Li 0 Oc Ns Ar n Oc
2149f982db4aSGavin AtkinsonThe trailing component of the current remote working directory, or
2150f982db4aSGavin Atkinson.Em n
2151f982db4aSGavin Atkinsontrailing components if a digit
2152f982db4aSGavin Atkinson.Em n
2153f982db4aSGavin Atkinsonis given.
2154f982db4aSGavin AtkinsonIf
2155f982db4aSGavin Atkinson.Em n
2156f982db4aSGavin Atkinsonbegins with
2157f982db4aSGavin Atkinson.Sq 0 ,
2158f982db4aSGavin Atkinsonthe number of skipped components precede the trailing component(s) in
2159f982db4aSGavin Atkinsonthe format
2160f982db4aSGavin Atkinson.\" ``/<number>trailing''
2161f982db4aSGavin Atkinson.Do
2162f982db4aSGavin Atkinson.Sm off
2163f982db4aSGavin Atkinson.Li / Li \*[Lt] Va number Li \*[Gt]
2164f982db4aSGavin Atkinson.Va trailing
2165f982db4aSGavin Atkinson.Sm on
2166f982db4aSGavin Atkinson.Dc
2167f982db4aSGavin Atkinson(for
2168f982db4aSGavin Atkinson.Sq \&%c )
2169f982db4aSGavin Atkinsonor
2170f982db4aSGavin Atkinson.\" ``...trailing''
2171f982db4aSGavin Atkinson.Dq Li \&... Ns Va trailing
2172f982db4aSGavin Atkinson(for
2173f982db4aSGavin Atkinson.Sq \&%. ) .
2174f982db4aSGavin Atkinson.It Li \&%M
2175f982db4aSGavin AtkinsonThe remote host name.
2176f982db4aSGavin Atkinson.It Li \&%m
2177f982db4aSGavin AtkinsonThe remote host name, up to the first
2178f982db4aSGavin Atkinson.Sq \&. .
2179f982db4aSGavin Atkinson.It Li \&%n
2180f982db4aSGavin AtkinsonThe remote user name.
2181f982db4aSGavin Atkinson.It Li \&%%
2182f982db4aSGavin AtkinsonA single
2183f982db4aSGavin Atkinson.Sq % .
2184f982db4aSGavin Atkinson.El
2185f982db4aSGavin Atkinson.Sh ENVIRONMENT
2186f982db4aSGavin Atkinson.Nm
2187f982db4aSGavin Atkinsonuses the following environment variables.
2188f982db4aSGavin Atkinson.Bl -tag -width "FTPSERVERPORT"
2189f982db4aSGavin Atkinson.It Ev FTPANONPASS
2190f982db4aSGavin AtkinsonPassword to send in an anonymous
2191f982db4aSGavin Atkinson.Tn FTP
2192f982db4aSGavin Atkinsontransfer.
2193f982db4aSGavin AtkinsonDefaults to
2194f982db4aSGavin Atkinson.Dq Li `whoami`@ .
2195f982db4aSGavin Atkinson.It Ev FTPMODE
2196f982db4aSGavin AtkinsonOverrides the default operation mode.
2197f982db4aSGavin AtkinsonSupport values are:
2198f982db4aSGavin Atkinson.Bl -tag -width "passive"
2199f982db4aSGavin Atkinson.It Cm active
2200f982db4aSGavin Atkinsonactive mode
2201f982db4aSGavin Atkinson.Tn FTP
2202f982db4aSGavin Atkinsononly
2203f982db4aSGavin Atkinson.It Cm auto
2204f982db4aSGavin Atkinsonautomatic determination of passive or active (this is the default)
2205f982db4aSGavin Atkinson.It Cm gate
2206f982db4aSGavin Atkinsongate-ftp mode
2207f982db4aSGavin Atkinson.It Cm passive
2208f982db4aSGavin Atkinsonpassive mode
2209f982db4aSGavin Atkinson.Tn FTP
2210f982db4aSGavin Atkinsononly
2211f982db4aSGavin Atkinson.El
2212f982db4aSGavin Atkinson.It Ev FTPPROMPT
2213f982db4aSGavin AtkinsonCommand-line prompt to use.
2214f982db4aSGavin AtkinsonDefaults to
2215f982db4aSGavin Atkinson.Dq "ftp\*[Gt] " .
2216f982db4aSGavin AtkinsonRefer to
2217f982db4aSGavin Atkinson.Sx COMMAND LINE PROMPT
2218f982db4aSGavin Atkinsonfor more information.
2219f982db4aSGavin Atkinson.It Ev FTPRPROMPT
2220f982db4aSGavin AtkinsonCommand-line right side prompt to use.
2221f982db4aSGavin AtkinsonDefaults to
2222f982db4aSGavin Atkinson.Dq "" .
2223f982db4aSGavin AtkinsonRefer to
2224f982db4aSGavin Atkinson.Sx COMMAND LINE PROMPT
2225f982db4aSGavin Atkinsonfor more information.
2226f982db4aSGavin Atkinson.It Ev FTPSERVER
2227f982db4aSGavin AtkinsonHost to use as gate-ftp server when
2228f982db4aSGavin Atkinson.Ic gate
2229f982db4aSGavin Atkinsonis enabled.
2230f982db4aSGavin Atkinson.It Ev FTPSERVERPORT
2231f982db4aSGavin AtkinsonPort to use when connecting to gate-ftp server when
2232f982db4aSGavin Atkinson.Ic gate
2233f982db4aSGavin Atkinsonis enabled.
2234f982db4aSGavin AtkinsonDefault is port returned by a
2235f982db4aSGavin Atkinson.Fn getservbyname
2236f982db4aSGavin Atkinsonlookup of
2237f982db4aSGavin Atkinson.Dq ftpgate/tcp .
2238f982db4aSGavin Atkinson.It Ev FTPUSERAGENT
2239f982db4aSGavin AtkinsonThe value to send for the
2240f982db4aSGavin Atkinson.Tn HTTP
2241f982db4aSGavin AtkinsonUser-Agent
2242f982db4aSGavin Atkinsonheader.
2243f982db4aSGavin Atkinson.It Ev HOME
2244f982db4aSGavin AtkinsonFor default location of a
2245f982db4aSGavin Atkinson.Pa .netrc
2246f982db4aSGavin Atkinsonfile, if one exists.
2247f982db4aSGavin Atkinson.It Ev NETRC
2248f982db4aSGavin AtkinsonAn alternate location of the
2249f982db4aSGavin Atkinson.Pa .netrc
2250f982db4aSGavin Atkinsonfile.
2251f982db4aSGavin Atkinson.It Ev PAGER
2252f982db4aSGavin AtkinsonUsed by various commands to display files.
2253f982db4aSGavin AtkinsonDefaults to
2254f982db4aSGavin Atkinson.Xr more 1
2255f982db4aSGavin Atkinsonif empty or not set.
2256f982db4aSGavin Atkinson.It Ev SHELL
2257f982db4aSGavin AtkinsonFor default shell.
2258f982db4aSGavin Atkinson.It Ev ftp_proxy
2259f982db4aSGavin AtkinsonURL of
2260f982db4aSGavin Atkinson.Tn FTP
2261f982db4aSGavin Atkinsonproxy to use when making
2262f982db4aSGavin Atkinson.Tn FTP
2263f982db4aSGavin AtkinsonURL requests
2264f982db4aSGavin Atkinson(if not defined, use the standard
2265f982db4aSGavin Atkinson.Tn FTP
2266f982db4aSGavin Atkinsonprotocol).
2267f982db4aSGavin Atkinson.Pp
2268f982db4aSGavin AtkinsonSee
2269f982db4aSGavin Atkinson.Ev http_proxy
2270f982db4aSGavin Atkinsonfor further notes about proxy use.
2271f982db4aSGavin Atkinson.It Ev http_proxy
2272f982db4aSGavin AtkinsonURL of
2273f982db4aSGavin Atkinson.Tn HTTP
2274f982db4aSGavin Atkinsonproxy to use when making
2275f982db4aSGavin Atkinson.Tn HTTP
2276f982db4aSGavin AtkinsonURL requests.
2277f982db4aSGavin AtkinsonIf proxy authentication is required and there is a username and
2278f982db4aSGavin Atkinsonpassword in this URL, they will automatically be used in the first
2279f982db4aSGavin Atkinsonattempt to authenticate to the proxy.
2280f982db4aSGavin Atkinson.Pp
2281f982db4aSGavin AtkinsonIf
2282f982db4aSGavin Atkinson.Dq unsafe
2283f982db4aSGavin AtkinsonURL characters are required in the username or password
2284f982db4aSGavin Atkinson(for example
2285f982db4aSGavin Atkinson.Sq @
2286f982db4aSGavin Atkinsonor
2287f982db4aSGavin Atkinson.Sq / ) ,
2288f982db4aSGavin Atkinsonencode them with
2289*cc361f65SGavin Atkinson.Li RFC3986
2290f982db4aSGavin Atkinson.Sq Li \&% Ns Ar XX
2291f982db4aSGavin Atkinsonencoding.
2292f982db4aSGavin Atkinson.Pp
2293f982db4aSGavin AtkinsonNote that the use of a username and password in
2294f982db4aSGavin Atkinson.Ev ftp_proxy
2295f982db4aSGavin Atkinsonand
2296f982db4aSGavin Atkinson.Ev http_proxy
2297f982db4aSGavin Atkinsonmay be incompatible with other programs that use it
2298f982db4aSGavin Atkinson(such as
2299f982db4aSGavin Atkinson.Xr lynx 1 ) .
2300f982db4aSGavin Atkinson.Pp
2301f982db4aSGavin Atkinson.Em NOTE :
2302f982db4aSGavin Atkinsonthis is not used for interactive sessions, only for command-line
2303f982db4aSGavin Atkinsonfetches.
2304f982db4aSGavin Atkinson.It Ev no_proxy
2305f982db4aSGavin AtkinsonA space or comma separated list of hosts (or domains) for which
2306f982db4aSGavin Atkinsonproxying is not to be used.
2307f982db4aSGavin AtkinsonEach entry may have an optional trailing ":port", which restricts
2308f982db4aSGavin Atkinsonthe matching to connections to that port.
2309f982db4aSGavin Atkinson.El
2310f982db4aSGavin Atkinson.Sh EXTENDED PASSIVE MODE AND FIREWALLS
2311f982db4aSGavin AtkinsonSome firewall configurations do not allow
2312f982db4aSGavin Atkinson.Nm
2313f982db4aSGavin Atkinsonto use extended passive mode.
2314f982db4aSGavin AtkinsonIf you find that even a simple
2315f982db4aSGavin Atkinson.Ic ls
2316f982db4aSGavin Atkinsonappears to hang after printing a message such as this:
2317f982db4aSGavin Atkinson.Pp
2318f982db4aSGavin Atkinson.Dl 229 Entering Extended Passive Mode (|||58551|)
2319f982db4aSGavin Atkinson.Pp
2320f982db4aSGavin Atkinsonthen you will need to disable extended passive mode with
2321f982db4aSGavin Atkinson.Ic epsv4 off .
2322f982db4aSGavin AtkinsonSee the above section
2323f982db4aSGavin Atkinson.Sx The .netrc File
2324f982db4aSGavin Atkinsonfor an example of how to make this automatic.
2325f982db4aSGavin Atkinson.Sh SEE ALSO
2326f982db4aSGavin Atkinson.Xr getservbyname 3 ,
2327f982db4aSGavin Atkinson.Xr editrc 5 ,
2328f982db4aSGavin Atkinson.Xr services 5 ,
2329f982db4aSGavin Atkinson.Xr ftpd 8
2330f982db4aSGavin Atkinson.Sh STANDARDS
2331f982db4aSGavin Atkinson.Nm
2332*cc361f65SGavin Atkinsonattempts to be compliant with:
2333*cc361f65SGavin Atkinson.Bl -tag -offset indent -width 8n
2334*cc361f65SGavin Atkinson.It Li RFC0959
2335*cc361f65SGavin Atkinson.Em File Transfer Protocol
2336*cc361f65SGavin Atkinson.It Li RFC1123
2337*cc361f65SGavin Atkinson.Em Requirements for Internet Hosts - Application and Support
2338*cc361f65SGavin Atkinson.It Li RFC1635
2339*cc361f65SGavin Atkinson.Em How to Use Anonymous FTP
2340*cc361f65SGavin Atkinson.It Li RFC2389
2341*cc361f65SGavin Atkinson.Em Feature negotiation mechanism for the File Transfer Protocol
2342*cc361f65SGavin Atkinson.It Li RFC2428
2343*cc361f65SGavin Atkinson.Em FTP Extensions for IPv6 and NATs
2344*cc361f65SGavin Atkinson.It Li RFC2616
2345*cc361f65SGavin Atkinson.Em Hypertext Transfer Protocol -- HTTP/1.1
2346*cc361f65SGavin Atkinson.It Li RFC2822
2347*cc361f65SGavin Atkinson.Em Internet Message Format
2348*cc361f65SGavin Atkinson.It Li RFC3659
2349*cc361f65SGavin Atkinson.Em Extensions to FTP
2350*cc361f65SGavin Atkinson.It Li RFC3986
2351*cc361f65SGavin Atkinson.Em Uniform Resource Identifier (URI)
2352*cc361f65SGavin Atkinson.El
2353f982db4aSGavin Atkinson.Sh HISTORY
2354f982db4aSGavin AtkinsonThe
2355f982db4aSGavin Atkinson.Nm
2356f982db4aSGavin Atkinsoncommand appeared in
2357f982db4aSGavin Atkinson.Bx 4.2 .
2358f982db4aSGavin Atkinson.Pp
2359f982db4aSGavin AtkinsonVarious features such as command line editing, context sensitive
2360f982db4aSGavin Atkinsoncommand and file completion, dynamic progress bar, automatic
2361f982db4aSGavin Atkinsonfetching of files and URLs, modification time preservation,
2362f982db4aSGavin Atkinsontransfer rate throttling, configurable command line prompt,
2363f982db4aSGavin Atkinsonand other enhancements over the standard
2364f982db4aSGavin Atkinson.Bx
2365f982db4aSGavin Atkinson.Nm
2366f982db4aSGavin Atkinsonwere implemented in
2367f982db4aSGavin Atkinson.Nx 1.3
2368f982db4aSGavin Atkinsonand later releases
2369f982db4aSGavin Atkinsonby
2370f982db4aSGavin Atkinson.An Luke Mewburn
2371f982db4aSGavin Atkinson.Aq lukem@NetBSD.org .
2372f982db4aSGavin Atkinson.Pp
2373f982db4aSGavin AtkinsonIPv6 support was added by the WIDE/KAME project
2374f982db4aSGavin Atkinson(but may not be present in all non-NetBSD versions of this program, depending
2375f982db4aSGavin Atkinsonif the operating system supports IPv6 in a similar manner to KAME).
2376f982db4aSGavin Atkinson.Sh BUGS
2377f982db4aSGavin AtkinsonCorrect execution of many commands depends upon proper behavior
2378f982db4aSGavin Atkinsonby the remote server.
2379f982db4aSGavin Atkinson.Pp
2380f982db4aSGavin AtkinsonAn error in the treatment of carriage returns
2381f982db4aSGavin Atkinsonin the
2382f982db4aSGavin Atkinson.Bx 4.2
2383f982db4aSGavin Atkinsonascii-mode transfer code
2384f982db4aSGavin Atkinsonhas been corrected.
2385f982db4aSGavin AtkinsonThis correction may result in incorrect transfers of binary files
2386f982db4aSGavin Atkinsonto and from
2387f982db4aSGavin Atkinson.Bx 4.2
2388f982db4aSGavin Atkinsonservers using the ascii type.
2389f982db4aSGavin AtkinsonAvoid this problem by using the binary image type.
2390f982db4aSGavin Atkinson.Pp
2391f982db4aSGavin Atkinson.Nm
2392f982db4aSGavin Atkinsonassumes that all IPv4 mapped addresses
2393f982db4aSGavin Atkinson.Po
2394f982db4aSGavin AtkinsonIPv6 addresses with a form like
2395f982db4aSGavin Atkinson.Li ::ffff:10.1.1.1
2396f982db4aSGavin Atkinson.Pc
2397f982db4aSGavin Atkinsonindicate IPv4 destinations which can be handled by
2398f982db4aSGavin Atkinson.Dv AF_INET
2399f982db4aSGavin Atkinsonsockets.
2400f982db4aSGavin AtkinsonHowever, in certain IPv6 network configurations, this assumption is not true.
2401f982db4aSGavin AtkinsonIn such an environment, IPv4 mapped addresses must be passed to
2402f982db4aSGavin Atkinson.Dv AF_INET6
2403f982db4aSGavin Atkinsonsockets directly.
2404f982db4aSGavin AtkinsonFor example, if your site uses a SIIT translator for IPv6-to-IPv4 translation,
2405f982db4aSGavin Atkinson.Nm
2406f982db4aSGavin Atkinsonis unable to support your configuration.
2407