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