Commit | Line | Data |
---|---|---|
cb8ade2f KB |
1 | .\" Copyright (c) 1985 The Regents of the University of California. |
2 | .\" All rights reserved. | |
9e7fc5bf | 3 | .\" |
cb8ade2f KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
ff00793c | 14 | .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
9e7fc5bf | 15 | .\" |
90eb797b | 16 | .\" @(#)ftp.1 6.12.1.1 (Berkeley) %G% |
cb8ade2f | 17 | .\" |
ff00793c | 18 | .TH FTP 1 "February 23, 1989" |
9e7fc5bf KM |
19 | .UC 5 |
20 | .SH NAME | |
1609770c | 21 | ftp \- ARPANET file transfer program |
9e7fc5bf KM |
22 | .SH SYNOPSIS |
23 | .B ftp | |
24 | [ | |
25 | .B \-v | |
26 | ] [ | |
27 | .B \-d | |
28 | ] [ | |
29 | .B \-i | |
30 | ] [ | |
31 | .B \-n | |
32 | ] [ | |
33 | .B \-g | |
34 | ] [ | |
a154ee89 | 35 | .B host |
9e7fc5bf KM |
36 | ] |
37 | .SH DESCRIPTION | |
38 | .I Ftp | |
39 | is the user interface to the ARPANET standard File Transfer Protocol. | |
a154ee89 GM |
40 | The program allows a user to transfer files to and from a |
41 | remote network site. | |
42 | .PP | |
9e7fc5bf KM |
43 | The client host with which |
44 | .I ftp | |
45 | is to communicate may be specified on the command line. | |
46 | If this is done, | |
47 | .I ftp | |
a154ee89 GM |
48 | will immediately attempt to establish a connection to an FTP |
49 | server on that host; otherwise, | |
50 | .I ftp | |
51 | will enter its command interpreter and await instructions | |
52 | from the user. When | |
53 | .I ftp | |
54 | is awaiting commands from the user the prompt \*(lqftp>\*(rq | |
adbdb3c0 | 55 | is provided to the user. The following commands are recognized |
9e7fc5bf KM |
56 | by |
57 | .IR ftp : | |
58 | .TP | |
a154ee89 GM |
59 | \fB\&!\fP [ \fIcommand\fP [ \fIargs\fP ] ] |
60 | Invoke an interactive shell on the local machine. | |
61 | If there are arguments, the first is taken to be a command to execute | |
62 | directly, with the rest of the arguments as its arguments. | |
63 | .TP | |
64 | \fB\&$\fP \fImacro-name\fP [ \fIargs\fP ] | |
65 | Execute the macro \fImacro-name\fP that was defined with the | |
66 | \fBmacdef\fP command. | |
67 | Arguments are passed to the macro unglobbed. | |
68 | .TP | |
69 | \fBaccount\fP [ \fIpasswd\fP ] | |
70 | Supply a supplemental password required by a remote system for access | |
71 | to resources once a login has been successfully completed. | |
72 | If no argument is included, the user will be prompted for an account | |
73 | password in a non-echoing input mode. | |
9e7fc5bf KM |
74 | .TP |
75 | \fBappend\fP \fIlocal-file\fP [ \fIremote-file\fP ] | |
76 | Append a local file to a file on the remote machine. If | |
77 | .I remote-file | |
78 | is left unspecified, the local file name is used in naming the | |
a154ee89 GM |
79 | remote file after being altered by any |
80 | .I ntrans | |
81 | or | |
82 | .I nmap | |
83 | setting. | |
84 | File transfer uses the current settings for | |
85 | .IR type , | |
86 | .IR format , | |
87 | .IR mode , | |
88 | and | |
89 | .IR structure . | |
9e7fc5bf KM |
90 | .TP |
91 | .B ascii | |
a154ee89 GM |
92 | Set the file transfer |
93 | .I type | |
94 | to network ASCII. This is the default type. | |
9e7fc5bf KM |
95 | .TP |
96 | .B bell | |
97 | Arrange that a bell be sounded after each file transfer | |
98 | command is completed. | |
99 | .TP | |
100 | .B binary | |
a154ee89 GM |
101 | Set the file transfer |
102 | .I type | |
103 | to support binary image transfer. | |
9e7fc5bf KM |
104 | .TP |
105 | .B bye | |
106 | Terminate the FTP session with the remote server | |
107 | and exit | |
108 | .IR ftp . | |
3c604e97 | 109 | An end of file will also terminate the session and exit. |
9e7fc5bf | 110 | .TP |
a154ee89 GM |
111 | .B case |
112 | Toggle remote computer file name case mapping during | |
113 | .B mget | |
114 | commands. | |
115 | When | |
116 | .B case | |
117 | is on (default is off), remote computer file names with all letters in | |
118 | upper case are written in the local directory with the letters mapped | |
119 | to lower case. | |
120 | .TP | |
9e7fc5bf KM |
121 | .BI cd " remote-directory" |
122 | Change the working directory on the remote machine | |
123 | to | |
124 | .IR remote-directory . | |
125 | .TP | |
a154ee89 GM |
126 | .B cdup |
127 | Change the remote machine working directory to the parent of the | |
128 | current remote machine working directory. | |
129 | .TP | |
9e7fc5bf KM |
130 | .B close |
131 | Terminate the FTP session with the remote server, and | |
132 | return to the command interpreter. | |
a154ee89 GM |
133 | Any defined macros are erased. |
134 | .TP | |
135 | .B cr | |
136 | Toggle carriage return stripping during | |
137 | ascii type file retrieval. | |
138 | Records are denoted by a carriage return/linefeed sequence | |
139 | during ascii type file transfer. | |
140 | When | |
141 | .B cr | |
142 | is on (the default), carriage returns are stripped from this | |
143 | sequence to conform with the UNIX single linefeed record | |
144 | delimiter. | |
145 | Records on non-UNIX remote systems may contain single linefeeds; | |
146 | when an ascii type transfer is made, these linefeeds may be | |
147 | distinguished from a record delimiter only when | |
148 | .B cr | |
149 | is off. | |
9e7fc5bf KM |
150 | .TP |
151 | .BI delete " remote-file" | |
152 | Delete the file | |
153 | .I remote-file | |
154 | on the remote machine. | |
155 | .TP | |
156 | \fBdebug\fP [ \fIdebug-value\fP ] | |
157 | Toggle debugging mode. If an optional | |
158 | .I debug-value | |
159 | is specified it is used to set the debugging level. | |
160 | When debugging is on, | |
161 | .I ftp | |
162 | prints each command sent to the remote machine, preceded | |
163 | by the string \*(lq-->\*(rq. | |
164 | .TP | |
165 | \fBdir\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ] | |
166 | Print a listing of the directory contents in the | |
167 | directory, | |
168 | .IR remote-directory , | |
169 | and, optionally, placing the output in | |
170 | .IR local-file . | |
cd8a871b KB |
171 | If interactive prompting is on, |
172 | .I ftp | |
173 | will prompt the user to verify that the last argument is indeed the | |
174 | target local file for receiving | |
175 | .B dir | |
176 | output. | |
9e7fc5bf KM |
177 | If no directory is specified, the current working |
178 | directory on the remote machine is used. If no local | |
a154ee89 | 179 | file is specified, or \fIlocal-file\fP is \fB-\fP, |
1609770c | 180 | output comes to the terminal. |
9e7fc5bf | 181 | .TP |
a154ee89 GM |
182 | .B disconnect |
183 | A synonym for | |
184 | .BR close . | |
185 | .TP | |
186 | .BI form " format" | |
187 | Set the file transfer | |
188 | .I form | |
189 | to | |
190 | .IR format . | |
191 | The default format is \*(lqfile\*(rq. | |
9e7fc5bf KM |
192 | .TP |
193 | \fBget\fP \fIremote-file\fP [ \fIlocal-file\fP ] | |
194 | Retrieve the | |
195 | .I remote-file | |
196 | and store it on the local machine. If the local | |
197 | file name is not specified, it is given the same | |
a154ee89 GM |
198 | name it has on the remote machine, subject to |
199 | alteration by the current | |
200 | .IR case , | |
201 | .IR ntrans , | |
202 | and | |
203 | .I nmap | |
204 | settings. | |
205 | The current settings for | |
206 | .IR type , | |
207 | .IR form , | |
208 | .IR mode , | |
209 | and | |
210 | .I structure | |
9e7fc5bf KM |
211 | are used while transferring the file. |
212 | .TP | |
a154ee89 GM |
213 | \fBglob\fP |
214 | Toggle filename expansion for \fBmdelete\fP, \fBmget\fP and \fBmput\fP. | |
215 | If globbing is turned off with \fBglob\fP, the file name arguments | |
216 | are taken literally and not expanded. | |
217 | Globbing for \fBmput\fP is done as in \fBcsh\fP(1). | |
218 | For \fBmdelete\fP and \fBmget\fP, each remote file name is expanded | |
219 | separately on the remote machine and the lists are not merged. | |
220 | Expansion of a directory name is likely to be | |
1609770c | 221 | different from expansion of the name of an ordinary file: |
a154ee89 GM |
222 | the exact result depends on the foreign operating system and ftp server, |
223 | and can be previewed by doing `\fBmls\fP\ \fIremote-files\fP\ \fB-\fP'. | |
224 | Note: \fBmget\fP and \fBmput\fP are not meant to transfer | |
225 | entire directory subtrees of files. That can be done by | |
226 | transferring a \fBtar\fP(1) archive of the subtree (in binary mode). | |
1609770c | 227 | .TP |
a154ee89 | 228 | \fBhash\f |
9e7fc5bf KM |
229 | Toggle hash-sign (``#'') printing for each data block |
230 | transferred. The size of a data block is 1024 bytes. | |
231 | .TP | |
9e7fc5bf KM |
232 | \fBhelp\fP [ \fIcommand\fP ] |
233 | Print an informative message about the meaning of | |
234 | .IR command . | |
235 | If no argument is given, | |
236 | .I ftp | |
237 | prints a list of the known commands. | |
238 | .TP | |
239 | \fBlcd\fP [ \fIdirectory\fP ] | |
240 | Change the working directory on the local machine. If | |
241 | no | |
242 | .I directory | |
243 | is specified, the user's home directory is used. | |
244 | .TP | |
245 | \fBls\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ] | |
ff00793c | 246 | Print a listing of the contents of a |
cdc35b45 MK |
247 | directory on the remote machine. |
248 | The listing includes any system-dependent information that the server | |
249 | chooses to include; for example, most UNIX systems will produce | |
250 | output from the command \*(lqls -l\*(rq. | |
251 | (See also \fBnlist\fP.) | |
252 | If | |
9e7fc5bf | 253 | .I remote-directory |
cd8a871b KB |
254 | is left unspecified, the current working directory is used. |
255 | If interactive prompting is on, | |
256 | .I ftp | |
257 | will prompt the user to verify that the last argument is indeed the | |
258 | target local file for receiving | |
259 | .B ls | |
260 | output. | |
261 | If no local file is specified, or if \fIlocal-file\fR is \fB-\fR, | |
1609770c KM |
262 | the output is sent to the terminal. |
263 | .TP | |
a154ee89 GM |
264 | \fBmacdef\fP \fImacro-name\fP |
265 | Define a macro. | |
266 | Subsequent lines are stored as the macro | |
267 | \fImacro-name\fP; a null line (consecutive newline characters | |
268 | in a file or | |
269 | carriage returns from the terminal) terminates macro input mode. | |
270 | There is a limit of 16 macros and 4096 total characters in all | |
271 | defined macros. | |
272 | Macros remain defined until a | |
273 | .B close | |
274 | command is executed. | |
275 | The macro processor interprets '$' and '\\' as special characters. | |
276 | A '$' followed by a number (or numbers) is replaced by the | |
277 | corresponding argument on the macro invocation command line. | |
278 | A '$' followed by an 'i' signals that macro processor that the | |
279 | executing macro is to be looped. On the first pass '$i' is | |
280 | replaced by the first argument on the macro invocation command line, | |
281 | on the second pass it is replaced by the second argument, and so on. | |
282 | A '\\' followed by any character is replaced by that character. | |
283 | Use the '\\' to prevent special treatment of the '$'. | |
284 | .TP | |
1609770c KM |
285 | \fBmdelete\fP [ \fIremote-files\fP ] |
286 | Delete the \fIremote-files\fP on the remote machine. | |
287 | .TP | |
cd800a97 | 288 | \fBmdir\fP \fIremote-files\fP \fIlocal-file\fP |
1609770c | 289 | Like \fBdir\fP, except multiple remote files may be specified. |
a154ee89 GM |
290 | If interactive prompting is on, |
291 | .I ftp | |
292 | will prompt the user to verify that the last argument is indeed the | |
293 | target local file for receiving | |
294 | .B mdir | |
295 | output. | |
9e7fc5bf KM |
296 | .TP |
297 | \fBmget\fP \fIremote-files\fP | |
1609770c KM |
298 | Expand the \fIremote-files\fP on the remote machine |
299 | and do a \fBget\fP for each file name thus produced. | |
300 | See \fBglob\fR for details on the filename expansion. | |
a154ee89 GM |
301 | Resulting file names will then be processed according to |
302 | .IR case , | |
303 | .IR ntrans , | |
304 | and | |
305 | .I nmap | |
306 | settings. | |
1609770c | 307 | Files are transferred into the local working directory, |
a154ee89 GM |
308 | which can be changed with `\fBlcd\fP\ directory'; |
309 | new local directories can be created with `\fB!\fP\ mkdir\ directory'. | |
9e7fc5bf KM |
310 | .TP |
311 | \fBmkdir\fP \fIdirectory-name\fP | |
312 | Make a directory on the remote machine. | |
313 | .TP | |
cd800a97 | 314 | \fBmls\fP \fIremote-files\fP \fIlocal-file\fP |
cdc35b45 MK |
315 | Like \fBnlist\fP, except multiple remote files may be specified, |
316 | and the \fIlocal-file\fP must be specified. | |
a154ee89 GM |
317 | If interactive prompting is on, |
318 | .I ftp | |
319 | will prompt the user to verify that the last argument is indeed the | |
320 | target local file for receiving | |
321 | .B mls | |
322 | output. | |
9e7fc5bf KM |
323 | .TP |
324 | \fBmode\fP [ \fImode-name\fP ] | |
a154ee89 GM |
325 | Set the file transfer |
326 | .I mode | |
327 | to | |
9e7fc5bf | 328 | .IR mode-name . |
a154ee89 | 329 | The default mode is \*(lqstream\*(rq mode. |
9e7fc5bf | 330 | .TP |
ff00793c MK |
331 | \fBmodtime\fP \fIfile-name\fP |
332 | Show the last modification time of the file on the remote machine. | |
333 | .TP | |
9e7fc5bf | 334 | \fBmput\fP \fIlocal-files\fP |
1609770c KM |
335 | Expand wild cards in the list of local files given as arguments |
336 | and do a \fBput\fR for each file in the resulting list. | |
337 | See \fBglob\fP for details of filename expansion. | |
a154ee89 GM |
338 | Resulting file names will then be processed according to |
339 | .I ntrans | |
340 | and | |
341 | .I nmap | |
342 | settings. | |
343 | .TP | |
ff00793c | 344 | \fBnlist\fP [ \fIremote-directory\fP ] [ \fIlocal-file\fP ] |
cdc35b45 | 345 | Print a list of the files of a |
ff00793c MK |
346 | directory on the remote machine. If |
347 | .I remote-directory | |
348 | is left unspecified, the current working directory is used. | |
349 | If interactive prompting is on, | |
350 | .I ftp | |
351 | will prompt the user to verify that the last argument is indeed the | |
352 | target local file for receiving | |
353 | .B nlist | |
354 | output. | |
355 | If no local file is specified, or if \fIlocal-file\fR is \fB-\fR, | |
356 | the output is sent to the terminal. | |
357 | .TP | |
a154ee89 GM |
358 | \fBnmap\fP [ \fIinpattern\fP \fIoutpattern\fP ] |
359 | Set or unset the filename mapping mechanism. | |
360 | If no arguments are specified, the filename mapping mechanism is unset. | |
361 | If arguments are specified, remote filenames are mapped during | |
362 | .B mput | |
363 | commands and | |
364 | .B put | |
365 | commands issued without a specified remote target filename. | |
366 | If arguments are specified, local filenames are mapped during | |
367 | .B mget | |
368 | commands and | |
369 | .B get | |
370 | commands issued without a specified local target filename. | |
371 | This command is useful when connecting to a non-UNIX remote computer | |
372 | with different file naming conventions or practices. | |
373 | The mapping follows the pattern set by | |
374 | .I inpattern | |
375 | and | |
376 | .IR outpattern . | |
377 | .I Inpattern | |
378 | is a template for incoming filenames (which may have already been | |
379 | processed according to the | |
380 | .B ntrans | |
381 | and | |
382 | .B case | |
383 | settings). | |
2c32d7db | 384 | Variable templating is accomplished by including the sequences '$1', '$2', ..., '$9' in |
a154ee89 GM |
385 | .IR inpattern . |
386 | Use '\\' to prevent this special treatment of the '$' character. | |
387 | All other characters are treated literally, and are used to determine the | |
388 | .B nmap | |
389 | .I inpattern | |
390 | variable values. | |
ff00793c | 391 | For example, given |
a154ee89 GM |
392 | .I inpattern |
393 | $1.$2 and the remote file name "mydata.data", $1 would have the value | |
394 | "mydata", and $2 would have the value "data". | |
395 | The | |
396 | .I outpattern | |
397 | determines the resulting mapped filename. | |
398 | The sequences '$1', '$2', ...., '$9' are replaced by any value resulting | |
399 | from the | |
400 | .I inpattern | |
401 | template. | |
402 | The sequence '$0' is replace by the original filename. | |
403 | Additionally, the sequence '[\fIseq1\fP,\fIseq2\f\P]' is replaced by | |
404 | .I seq1 | |
405 | if | |
406 | .I seq1 | |
407 | is not a null string; otherwise it is replaced by | |
408 | .IR seq2 . | |
409 | For example, the command "nmap $1.$2.$3 [$1,$2].[$2,file]" would yield | |
410 | the output filename "myfile.data" for input filenames "myfile.data" and | |
411 | "myfile.data.old", "myfile.file" for the input filename "myfile", and | |
412 | "myfile.myfile" for the input filename ".myfile". | |
413 | Spaces may be included in | |
414 | .IR outpattern , | |
415 | as in the example: nmap $1 |sed "s/ *$//" > $1 . | |
416 | Use the '\\' character to prevent special treatment | |
417 | of the '$', '[', ']', and ',' characters. | |
418 | .TP | |
419 | \fBntrans\fP [ \fIinchars\fP [ \fIoutchars\fP ] ] | |
420 | Set or unset the filename character translation mechanism. | |
421 | If no arguments are specified, the filename character | |
422 | translation mechanism is unset. | |
423 | If arguments are specified, characters in | |
424 | remote filenames are translated during | |
425 | .B mput | |
426 | commands and | |
427 | .B put | |
428 | commands issued without a specified remote target filename. | |
429 | If arguments are specified, characters in | |
430 | local filenames are translated during | |
431 | .B mget | |
432 | commands and | |
433 | .B get | |
434 | commands issued without a specified local target filename. | |
435 | This command is useful when connecting to a non-UNIX remote computer | |
436 | with different file naming conventions or practices. | |
437 | Characters in a filename matching a character in | |
438 | .I inchars | |
439 | are replaced with the corresponding character in | |
440 | .IR outchars . | |
441 | If the character's position in | |
442 | .I inchars | |
443 | is longer than the length of | |
444 | .IR outchars , | |
445 | the character is deleted from the file name. | |
9e7fc5bf KM |
446 | .TP |
447 | \fBopen\fP \fIhost\fP [ \fIport\fP ] | |
448 | Establish a connection to the specified | |
449 | .I host | |
450 | FTP server. An optional port number may be supplied, | |
451 | in which case, | |
452 | .I ftp | |
453 | will attempt to contact an FTP server at that port. | |
454 | If the | |
455 | .I auto-login | |
456 | option is on (default), | |
457 | .I ftp | |
458 | will also attempt to automatically log the user in to | |
459 | the FTP server (see below). | |
460 | .TP | |
461 | .B prompt | |
462 | Toggle interactive prompting. Interactive prompting | |
463 | occurs during multiple file transfers to allow the | |
1609770c | 464 | user to selectively retrieve or store files. |
a154ee89 | 465 | If prompting is turned off (default is on), any \fBmget\fP or \fBmput\fP |
1609770c | 466 | will transfer all files, and any \fBmdelete\fP will delete all files. |
9e7fc5bf | 467 | .TP |
a154ee89 GM |
468 | \fBproxy\fP \fIftp-command\fP |
469 | Execute an ftp command on a secondary control connection. | |
470 | This command allows simultaneous connection to two remote ftp | |
471 | servers for transferring files between the two servers. | |
472 | The first | |
473 | .B proxy | |
474 | command should be an | |
475 | .BR open , | |
476 | to establish the secondary control connection. | |
477 | Enter the command "proxy ?" to see other ftp commands executable on the | |
478 | secondary connection. | |
98a310f2 | 479 | The following commands behave differently when prefaced by |
a154ee89 GM |
480 | .BR proxy : |
481 | .B open | |
482 | will not define new macros during the auto-login process, | |
483 | .B close | |
484 | will not erase existing macro definitions, | |
485 | .B get | |
486 | and | |
487 | .B mget | |
488 | transfer files from the host on the primary control connection | |
489 | to the host on the secondary control connection, and | |
490 | .BR put , | |
491 | .BR mput , | |
492 | and | |
493 | .B append | |
494 | transfer files from the host on the secondary control connection | |
495 | to the host on the primary control connection. | |
496 | Third party file transfers depend upon support of the ftp protocol | |
497 | PASV command by the server on the secondary control connection. | |
498 | .TP | |
9e7fc5bf KM |
499 | \fBput\fP \fIlocal-file\fP [ \fIremote-file\fP ] |
500 | Store a local file on the remote machine. If | |
501 | .I remote-file | |
502 | is left unspecified, the local file name is used | |
a154ee89 GM |
503 | after processing according to any |
504 | .I ntrans | |
505 | or | |
506 | .I nmap | |
507 | settings | |
9e7fc5bf | 508 | in naming the remote file. File transfer uses the |
a154ee89 GM |
509 | current settings for |
510 | .IR type , | |
511 | .IR format , | |
512 | .IR mode , | |
513 | and | |
514 | .IR structure . | |
9e7fc5bf KM |
515 | .TP |
516 | .B pwd | |
517 | Print the name of the current working directory on the remote | |
518 | machine. | |
519 | .TP | |
520 | .B quit | |
3c604e97 JL |
521 | A synonym for |
522 | .BR bye . | |
9e7fc5bf | 523 | .TP |
a154ee89 GM |
524 | .BI quote " arg1 arg2 ..." |
525 | The arguments specified are sent, verbatim, to the remote FTP | |
526 | server. | |
9e7fc5bf KM |
527 | .TP |
528 | \fBrecv\fP \fIremote-file\fP [ \fIlocal-file\fP ] | |
a154ee89 | 529 | A synonym for get. |
9e7fc5bf KM |
530 | .TP |
531 | \fBremotehelp\fP [ \fIcommand-name\fP ] | |
532 | Request help from the remote FTP server. If a | |
533 | .I command-name | |
534 | is specified it is supplied to the server as well. | |
535 | .TP | |
ff00793c MK |
536 | \fBremotestatus\fP [ \fIfile-name\fP ] |
537 | With no arguments, show status of remote machine. If \fIfile-name\fP | |
538 | is specified, show status of \fIfile-name\fP on remote machine. | |
539 | .TP | |
a154ee89 | 540 | \fBrename\fP [ \fIfrom\fP ] [ \fIto\fP ] |
9e7fc5bf KM |
541 | Rename the file |
542 | .I from | |
a154ee89 | 543 | on the remote machine, to the file |
9e7fc5bf KM |
544 | .IR to . |
545 | .TP | |
a154ee89 GM |
546 | .B reset |
547 | Clear reply queue. | |
548 | This command re-synchronizes command/reply sequencing with the remote | |
549 | ftp server. | |
ff00793c | 550 | Resynchronization may be necessary following a violation of the ftp protocol |
a154ee89 GM |
551 | by the remote server. |
552 | .TP | |
9e7fc5bf KM |
553 | .BI rmdir " directory-name" |
554 | Delete a directory on the remote machine. | |
555 | .TP | |
a154ee89 GM |
556 | .B runique |
557 | Toggle storing of files on the local system with unique filenames. | |
558 | If a file already exists with a name equal to the target | |
559 | local filename for a | |
560 | .B get | |
561 | or | |
562 | .B mget | |
2c32d7db | 563 | command, a ".1" is appended to the name. |
a154ee89 GM |
564 | If the resulting name matches another existing file, |
565 | a ".2" is appended to the original name. | |
566 | If this process continues up to ".99", an error | |
567 | message is printed, and the transfer does not take place. | |
568 | The generated unique filename will be reported. | |
569 | Note that | |
570 | .B runique | |
571 | will not affect local files generated from a shell command | |
572 | (see below). | |
573 | The default value is off. | |
574 | .TP | |
9e7fc5bf | 575 | \fBsend\fP \fIlocal-file\fP [ \fIremote-file\fP ] |
a154ee89 | 576 | A synonym for put. |
9e7fc5bf KM |
577 | .TP |
578 | .B sendport | |
579 | Toggle the use of PORT commands. By default, | |
580 | .I ftp | |
581 | will attempt to use a PORT command when establishing | |
a154ee89 GM |
582 | a connection for each data transfer. |
583 | The use of PORT commands can prevent delays | |
584 | when performing multiple file transfers. If the PORT | |
9e7fc5bf KM |
585 | command fails, |
586 | .I ftp | |
587 | will use the default data port. When the use of PORT | |
588 | commands is disabled, no attempt will be made to use | |
589 | PORT commands for each data transfer. This is useful | |
a154ee89 GM |
590 | for certain FTP implementations which do ignore PORT |
591 | commands but, incorrectly, indicate they've been accepted. | |
9e7fc5bf | 592 | .TP |
ff00793c MK |
593 | .BI size " file-name" |
594 | Return size of \fIfile-name\fP on remote machine. | |
595 | .TP | |
9e7fc5bf KM |
596 | .B status |
597 | Show the current status of | |
598 | .IR ftp . | |
599 | .TP | |
600 | \fBstruct\fP [ \fIstruct-name\fP ] | |
a154ee89 GM |
601 | Set the file transfer |
602 | .I structure | |
603 | to | |
9e7fc5bf | 604 | .IR struct-name . |
a154ee89 GM |
605 | By default \*(lqstream\*(rq structure is used. |
606 | .TP | |
607 | .B sunique | |
608 | Toggle storing of files on remote machine under unique file names. | |
609 | Remote ftp server must support ftp protocol STOU command for | |
610 | successful completion. | |
611 | The remote server will report unique name. | |
612 | Default value is off. | |
9e7fc5bf | 613 | .TP |
ff00793c MK |
614 | .B system |
615 | Show the type of operating system running on the remote machine. | |
616 | .TP | |
9e7fc5bf | 617 | .B tenex |
a154ee89 | 618 | Set the file transfer type to that needed to |
9e7fc5bf KM |
619 | talk to TENEX machines. |
620 | .TP | |
621 | .B trace | |
a154ee89 | 622 | Toggle packet tracing. |
9e7fc5bf KM |
623 | .TP |
624 | \fBtype\fP [ \fItype-name\fP ] | |
a154ee89 GM |
625 | Set the file transfer |
626 | .I type | |
627 | to | |
9e7fc5bf KM |
628 | .IR type-name . |
629 | If no type is specified, the current type | |
a154ee89 | 630 | is printed. The default type is network ASCII. |
9e7fc5bf KM |
631 | .TP |
632 | \fBuser\fP \fIuser-name\fP [ \fIpassword\fP ] [ \fIaccount\fP ] | |
633 | Identify yourself to the remote FTP server. If the | |
634 | password is not specified and the server requires it, | |
635 | .I ftp | |
636 | will prompt the user for it (after disabling local echo). | |
637 | If an account field is not specified, and the FTP server | |
a154ee89 GM |
638 | requires it, the user will be prompted for it. |
639 | If an account field is specified, an account command will | |
640 | be relayed to the remote server after the login sequence | |
641 | is completed if the remote server did not require it | |
642 | for logging in. | |
643 | Unless | |
9e7fc5bf KM |
644 | .I ftp |
645 | is invoked with \*(lqauto-login\*(rq disabled, this | |
646 | process is done automatically on initial connection to | |
647 | the FTP server. | |
648 | .TP | |
649 | .B verbose | |
650 | Toggle verbose mode. In verbose mode, all responses from | |
651 | the FTP server are displayed to the user. In addition, | |
a154ee89 | 652 | if verbose is on, when a file transfer completes, statistics |
9e7fc5bf | 653 | regarding the efficiency of the transfer are reported. By default, |
a154ee89 | 654 | verbose is on. |
9e7fc5bf KM |
655 | .TP |
656 | \fB?\fP [ \fIcommand\fP ] | |
a154ee89 GM |
657 | A synonym for help. |
658 | .PP | |
9e7fc5bf KM |
659 | Command arguments which have embedded spaces may be quoted with |
660 | quote (") marks. | |
a154ee89 | 661 | .SH "ABORTING A FILE TRANSFER" |
98a310f2 | 662 | To abort a file transfer, use the terminal interrupt key |
a154ee89 GM |
663 | (usually Ctrl-C). |
664 | Sending transfers will be immediately halted. | |
665 | Receiving transfers will be halted by sending a ftp protocol ABOR | |
666 | command to the remote server, and discarding any further data received. | |
667 | The speed at which this is accomplished depends upon the remote | |
668 | server's support for ABOR processing. | |
98a310f2 | 669 | If the remote server does not support the ABOR command, an "ftp>" |
a154ee89 GM |
670 | prompt will not appear until the remote server has completed |
671 | sending the requested file. | |
672 | .PP | |
673 | The terminal interrupt key sequence will be ignored when | |
674 | .I ftp | |
675 | has completed any local processing and is awaiting a reply | |
676 | from the remote server. | |
677 | A long delay in this mode may result from the ABOR processing described | |
678 | above, or from unexpected behavior by the remote server, including | |
679 | violations of the ftp protocol. | |
680 | If the delay results from unexpected remote server behavior, the local | |
cd800a97 | 681 | .I ftp |
a154ee89 | 682 | program must be killed by hand. |
9e7fc5bf | 683 | .SH "FILE NAMING CONVENTIONS" |
a154ee89 | 684 | Files specified as arguments to |
9e7fc5bf KM |
685 | .I ftp |
686 | commands are processed according to the following rules. | |
687 | .TP | |
688 | 1) | |
a154ee89 GM |
689 | If the file name \*(lq\-\*(rq is specified, the |
690 | .B stdin | |
691 | (for reading) or | |
692 | .B stdout | |
9e7fc5bf KM |
693 | (for writing) is used. |
694 | .TP | |
695 | 2) | |
696 | If the first character of the file name is \*(lq|\*(rq, the | |
697 | remainder of the argument is interpreted as a shell command. | |
a154ee89 | 698 | .I Ftp |
9e7fc5bf | 699 | then forks a shell, using |
a154ee89 GM |
700 | .IR popen (3) |
701 | with the argument supplied, and reads (writes) from the stdout | |
702 | (stdin). If the shell command includes spaces, the argument | |
9e7fc5bf KM |
703 | must be quoted; e.g. \*(lq"| ls -lt"\*(rq. A particularly |
704 | useful example of this mechanism is: \*(lqdir |more\*(rq. | |
705 | .TP | |
706 | 3) | |
a154ee89 | 707 | Failing the above checks, if ``globbing'' is enabled, |
9e7fc5bf KM |
708 | local file names are expanded |
709 | according to the rules used in the | |
710 | .IR csh (1); | |
a154ee89 | 711 | c.f. the |
9e7fc5bf | 712 | .I glob |
a154ee89 GM |
713 | command. |
714 | If the | |
715 | .I ftp | |
716 | command expects a single local file ( .e.g. | |
717 | .BR put ), | |
718 | only the first filename generated by the "globbing" operation is used. | |
719 | .TP | |
720 | 4) | |
721 | For | |
722 | .B mget | |
723 | commands and | |
724 | .B get | |
725 | commands with unspecified local file names, the local filename is | |
726 | the remote filename, which may be altered by a | |
727 | .BR case , | |
728 | .BR ntrans , | |
729 | or | |
730 | .B nmap | |
731 | setting. | |
732 | The resulting filename may then be altered if | |
733 | .B runique | |
734 | is on. | |
735 | .TP | |
736 | 5) | |
737 | For | |
738 | .B mput | |
739 | commands and | |
740 | .B put | |
741 | commands with unspecified remote file names, the remote filename is | |
742 | the local filename, which may be altered by a | |
743 | .B ntrans | |
744 | or | |
745 | .B nmap | |
746 | setting. | |
747 | The resulting filename may then be altered by the remote server if | |
748 | .B sunique | |
749 | is on. | |
9e7fc5bf KM |
750 | .SH "FILE TRANSFER PARAMETERS" |
751 | The FTP specification specifies many parameters which may | |
a154ee89 GM |
752 | affect a file transfer. The |
753 | .I type | |
754 | may be one of \*(lqascii\*(rq, \*(lqimage\*(rq (binary), | |
755 | \*(lqebcdic\*(rq, and \*(lqlocal byte size\*(rq (for PDP-10's | |
756 | and PDP-20's mostly). | |
757 | .I Ftp | |
758 | supports the ascii and image types of file transfer, | |
759 | plus local byte size 8 for \fBtenex\fP mode transfers. | |
760 | .PP | |
761 | .I Ftp | |
762 | supports only the default values for the remaining | |
763 | file transfer parameters: | |
764 | .IR mode , | |
765 | .IR form , | |
766 | and | |
767 | .IR struct . | |
9e7fc5bf KM |
768 | .SH OPTIONS |
769 | Options may be specified at the command line, or to the | |
770 | command interpreter. | |
a154ee89 GM |
771 | .PP |
772 | The | |
9e7fc5bf | 773 | .B \-v |
a154ee89 | 774 | (verbose on) option forces |
9e7fc5bf | 775 | .I ftp |
a154ee89 GM |
776 | to show all responses from the remote server, as well |
777 | as report on data transfer statistics. | |
778 | .PP | |
779 | The | |
9e7fc5bf | 780 | .B \-n |
a154ee89 GM |
781 | option restrains |
782 | .I ftp | |
783 | from attempting \*(lqauto-login\*(rq upon initial connection. | |
9e7fc5bf KM |
784 | If auto-login is enabled, |
785 | .I ftp | |
a154ee89 GM |
786 | will check the |
787 | .I .netrc | |
788 | (see below) file in the user's home directory for an entry describing | |
9e7fc5bf KM |
789 | an account on the remote machine. If no entry exists, |
790 | .I ftp | |
a154ee89 GM |
791 | will prompt for the remote machine login name (default is the user |
792 | identity on the local machine), and, if necessary, prompt for a password | |
793 | and an account with which to login. | |
794 | .PP | |
795 | The | |
9e7fc5bf | 796 | .B \-i |
a154ee89 GM |
797 | option turns off interactive prompting during |
798 | multiple file transfers. | |
799 | .PP | |
800 | The | |
cd800a97 | 801 | .B \-d |
a154ee89 GM |
802 | option enables debugging. |
803 | .PP | |
804 | The | |
805 | .B \-g | |
806 | option disables file name globbing. | |
807 | .SH "THE .netrc FILE" | |
808 | The .netrc file contains login and initialization information | |
809 | used by the auto-login process. | |
810 | It resides in the user's home directory. | |
811 | The following tokens are recognized; they may be separated by spaces, | |
812 | tabs, or new-lines: | |
813 | .TP | |
814 | \fBmachine\fP \fIname\fP | |
815 | Identify a remote machine name. | |
816 | The auto-login process searches the .netrc file for a | |
817 | .B machine | |
2c32d7db | 818 | token that matches the remote machine specified on the |
a154ee89 GM |
819 | .I ftp |
820 | command line or as an | |
821 | .B open | |
822 | command argument. | |
a154ee89 GM |
823 | Once a match is made, the subsequent .netrc tokens are processed, |
824 | stopping when the end of file is reached or another | |
825 | .B machine | |
cdc35b45 MK |
826 | or a |
827 | .B default | |
a154ee89 GM |
828 | token is encountered. |
829 | .TP | |
cdc35b45 MK |
830 | \fBdefault\fP |
831 | This is the same as \fBmachine\fP \fIname\fP except that \fBdefault\fP | |
832 | matches any name. | |
833 | There can be only one \fBdefault\fP token, and it must be after all | |
834 | \fBmachine\fP tokens. | |
835 | This is normally used as: | |
ff00793c MK |
836 | .ce |
837 | default login anonymous password user@site | |
838 | thereby giving the user \fIautomatic\fP anonymous ftp login to | |
839 | machines not specified in \fB.netrc\fP. This can be overridden | |
840 | by using the \fB\-n\fP flag to disable auto-login. | |
841 | .TP | |
a154ee89 GM |
842 | \fBlogin\fP \fIname\fP |
843 | Identify a user on the remote machine. | |
844 | If this token is present, the auto-login process will initiate | |
845 | a login using the specified name. | |
846 | .TP | |
847 | \fBpassword\fP \fIstring\fP | |
848 | Supply a password. | |
849 | If this token is present, the auto-login process will supply the | |
850 | specified string if the remote server requires a password as part | |
851 | of the login process. | |
cdc35b45 MK |
852 | Note that if this token is present in the .netrc file for any user other |
853 | than \fIanonymous\fP, | |
a154ee89 GM |
854 | .I ftp |
855 | will abort the auto-login process if the .netrc is readable by | |
856 | anyone besides the user. | |
857 | .TP | |
858 | \fBaccount\fP \fIstring\fP | |
859 | Supply an additional account password. | |
860 | If this token is present, the auto-login process will supply the | |
861 | specified string if the remote server requires an additional | |
862 | account password, or the auto-login process will initiate an | |
863 | ACCT command if it does not. | |
864 | .TP | |
865 | \fBmacdef\fP \fIname\fP | |
866 | Define a macro. | |
867 | This token functions like the | |
868 | .I ftp | |
869 | .B macdef | |
870 | command functions. | |
871 | A macro is defined with the specified name; its contents begin with the | |
872 | next .netrc line and continue until a null line (consecutive new-line | |
873 | characters) is encountered. | |
874 | If a macro named | |
875 | .I init | |
876 | is defined, it is automatically executed as the last step in the | |
877 | auto-login process. | |
1ff88243 KB |
878 | .SH "SEE ALSO" |
879 | ftpd(8) | |
9e7fc5bf | 880 | .SH BUGS |
a154ee89 GM |
881 | Correct execution of many commands depends upon proper behavior |
882 | by the remote server. | |
cd800a97 | 883 | .PP |
98a310f2 MK |
884 | An error in the treatment of carriage returns |
885 | in the 4.2BSD UNIX ascii-mode transfer code | |
a154ee89 GM |
886 | has been corrected. |
887 | This correction may result in incorrect transfers of binary files | |
98a310f2 | 888 | to and from 4.2BSD servers using the ascii type. |
a154ee89 | 889 | Avoid this problem by using the binary image type. |