Penguin
Annotated edit history of pftp(1) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 ----
2 __NAME__
3
4
5 ftp - Internet file transfer
6 program
7 __SYNOPSIS__
8
9
10 ftp [[-pinegvd] [[host]
11
12
13 pftp [[-inegvd] [[host]
14 __DESCRIPTION__
15
16
17 Ftp is the user interface to the Internet
18 standard File Transfer Protocol. The program allows a user
19 to transfer files to and from a remote network
20 site.
21
22
23 Options may be specified at the command line, or to the com- mand interpreter.
24 -p
25
26
27 Use passive mode for data transfers. Allows use of ftpin environments where a firewall prevents connectionsfrom the outside world back to the client machine.Requires that the ftp server support the PASV command.This is the default if invoked as pftp.-iTurns off interactive prompting during multiple filetransfers.-nRestrains ftp from attempting ``auto-login'' upon ini-tial connection. If auto-login is enabled, ftp willcheck the .netrc (see netrc(5)) file in the user's home directory for an entry describing an account on the remote machine. If no entry exists, ftp will prompt for the remote machine login name (default is the user identity on the local machine), and, if necessary, prompt for a password and an account with which to login.
28
29
30 -e
31 Disables command editing and history support, if it was
32 compiled into the ftp executable. Otherwise, does noth-
33 ing.
34
35
36 -g
37 Disables file name globbing.
38
39
40 -v
41 Verbose option forces ftp to show all responses from the
42 remote server, as well as report on data transfer
43 statistics.
44
45
46 -d
47 Enables debugging.
48
49
50 The client host with which ftp is to communicate may be
51 specified on the command line. If this is done, ftp will
52 immediately attempt to establish a connection to an
53 FTP server on that host; otherwise, ftp will
54 enter its command interpreter and await instructions from
55 the user. When ftp is awaiting commands from the user the
56 prompt ftp is pro- vided to the user. The
57 following commands are recognized by ftp:
58
59
60 ! [[command [[args]]
61 Invoke an interactive shell on the local machine. If there
62 are arguments, the first is taken to be a command to execute
63 directly, with the rest of the arguments as its
64 arguments.
65
66
67 $ macro-name [[args]
68 Execute the macro macro-name that was defined with the
69 macdef command. Arguments are passed to the macro
70 unglobbed.
71
72
73 account [[passwd]
74 Supply a supplemental password required by a remote system
75 for access to resources once a login has been successfully
76 completed. If no argument is included, the user will be
77 prompted for an account password in a non-echoing input
78 mode.
79
80
81 append local-file [[remote-file]
82 Append a local file to a file on the remote machine. If
83 remote-file is left unspecified, the local file name is used
84 in naming the remote file after being altered by any ntrans
85 or nmap set- ting. File transfer uses the current settings
86 for type, format, mode, and structure.
87
88
89 ascii
90 Set the file transfer type to network ASCII .
91 This is the default type.
92
93
94 bell
95 Arrange that a bell be sounded after each file transfer
96 command is completed.
97
98
99 binary
100 Set the file transfer type to support binary image
101 transfer.
102
103
104 bye
105 Terminate the FTP session with the remote
106 server and exit ftp. An end of file will also terminate the
107 session and exit.
108
109
110 case
111 Toggle remote computer file name case mapping during mget
112 commands. When case is on (default is off), remote computer
113 file names with all let- ters in upper case are written in
114 the local directory with the letters mapped to lower
115 case.
116
117
118 cd remote-directory
119 Change the working directory on the remote machine to
120 remote-directory.
121
122
123 cdup
124 Change the remote machine working directory to the parent of
125 the current remote machine working directory.
126
127
128 chmod mode file-name
129 Change the permission modes of the file file-name on the
130 remote sytem to mode.
131
132
133 close
134 Terminate the FTP session with the remote
135 server, and return to the command interpreter. Any defined
136 macros are erased.
137
138
139 cr
140 Toggle carriage return stripping during ascii type file
141 retrieval. Records are denoted by a carriage return/linefeed
142 sequence during ascii type file transfer. When cr is on (the
143 default), carriage returns are stripped from this sequence
144 to conform with the UNIX single linefeed
145 record delimiter. Records on non- UNIX remote
146 systems may contain single linefeeds; when an ascii type
147 transfer is made, these linefeeds may be distin- guished
148 from a record delimiter only when cr is off.
149
150
151 qc
152 Toggle the printing of control characters in the output of
153 ASCII type commands. When this is turned on,
154 control characters are replaced with a question mark if the
155 output file is the standard output. This is the default when
156 the standard output is a tty.
157
158
159 delete remote-file
160 Delete the file remote-file on the remote
161 machine.
162
163
164 debug [[debug-value]
165 Toggle debugging mode. If an optional debug-value is
166 specified it is used to set the debugging level. When
167 debugging is on, ftp prints each command sent to the remote
168 machine, preceded by the string --
169
170
171 dir
172 [[remote-directory]
173 [[local-file]
174 Print a listing of the directory contents in the directory,
175 remote-directory, and, optionally, placing the output in
176 local-file. If interactive prompting is on, ftp will prompt
177 the user to ver- ify that the last argument is indeed the
178 target local file for receiving dir output. If no directory
179 is specified, the current working directory on the remote
180 machine is used. If no local file is specified, or
181 local-file is -, out- put comes to the
182 terminal.
183
184
185 disconnect
186 A synonym for close.
187
188
189 form format
190 Set the file transfer form to format. The default format is
191 ``file''.
192
193
194 get remote-file [[local-file]
195 Retrieve the remote-file and store it on the local machine.
196 If the local file name is not specified, it is given the
197 same name it has on the remote machine, subject to
198 alteration by the current case, ntrans, and nmap settings.
199 The current settings for type, form, mode, and structure are
200 used while transferring the file.
201
202
203 glob
204 Toggle filename expansion for mdelete, mget and mput. If
205 globbing is turned off with glob, the file name arguments
206 are taken literally and not expanded. Globbing for mput is
207 done as in csh(1). For mdelete and mget, each
208 remote file name is expanded separately on the remote
209 machine and the lists are not merged. Expansion of a
210 directory name is likely to be different from expansion of
211 the name of an ordinary file: the exact result depends on
212 the foreign operating system and ftp server, and can be
213 previewed by doing mls remote-files - Note: mget
214 and mput are not meant to transfer entire directory subtrees
215 of files. That can be done by transferring a tar(1)
216 archive of the subtree (in binary mode).
217
218
219 hash
220 Toggle hash-sign (``#'') printing for each data block
221 transferred. The size of a data block is 1024
222 bytes.
223
224
225 help [[command]
226 Print an informative message about the meaning of command.
227 If no argument is given, ftp prints a list of the known
228 commands.
229
230
231 idle [[seconds]
232 Set the inactivity timer on the remote server to seconds
233 seconds. If seconds is ommitted, the current inactivity
234 timer is printed.
235
236
237 lcd [[directory]
238 Change the working directory on the local machine. If no
239 directory is specified, the user's home directory is
240 used.
241
242
243 ls
244 [[remote-directory]
245 [[local-file]
246 Print a listing of the contents of a directory on the remote
247 machine. The listing includes any system-dependent
248 information that the server chooses to include; for example,
249 most UNIX sys- tems will produce output from
250 the command ls -l. (See also nlist.) If
251 remote-directory is left unspecified, the current working
252 directory is used. If interactive prompting is on, ftp will
253 prompt the user to verify that the last argument is indeed
254 the target local file for receiving ls output. If no local
255 file is specified, or if local-file is -, the output is sent
256 to the termi- nal.
257
258
259 macdef macro-name
260 Define a macro. Subsequent lines are stored as the macro
261 macro-name; a null line (consecutive newline characters in a
262 file or carriage returns from the terminal) terminates macro
263 input mode. There is a limit of 16 macros and 4096 total
264 characters in all defined macros. Macros remain defined
265 until a close command is executed. The macro processor
266 interprets `$' and `' as special characters. A `$' followed
267 by a number (or num- bers) is replaced by the corresponding
268 argument on the macro invocation command line. A `$' fol-
269 lowed by an `i' signals that macro processor that the
270 executing macro is to be looped. On the first pass `$i' is
271 replaced by the first argument on the macro invocation
272 command line, on the sec- ond pass it is replaced by the
273 second argument, and so on. A `' followed by any character
274 is replaced by that character. Use the `' to pre- vent
275 special treatment of the `$'.
276
277
278 mdelete [[remote-files]
279 Delete the remote-files on the remote machine.
280
281
282 mdir remote-files local-file
283 Like dir, except multiple remote files may be specified. If
284 interactive prompting is on, ftp will prompt the user to
285 verify that the last argument is indeed the target local
286 file for receiving mdir output.
287
288
289 mget remote-files
290 Expand the remote-files on the remote machine and do a get
291 for each file name thus produced. See glob for details on
292 the filename expansion. Resulting file names will then be
293 processed according to case, ntrans, and nmap settings.
294 Files are transferred into the local working directory,
295 which can be changed with lcd directory; new local
296 directories can be created with ! mkdir
297 directory.
298
299
300 mkdir directory-name
301 Make a directory on the remote machine.
302
303
304 mls remote-files local-file
305 Like nlist, except multiple remote files may be specified,
306 and the local-file must be specified. If interactive
307 prompting is on, ftp will prompt the user to verify that the
308 last argument is indeed the target local file for receiving
309 mls output.
310
311
312 mode [[mode-name]
313 Set the file transfer mode to mode-name. The default mode is
314 ``stream'' mode.
315
316
317 modtime file-name
318 Show the last modification time of the file on the remote
319 machine.
320
321
322 mput local-files
323 Expand wild cards in the list of local files given as
324 arguments and do a put for each file in the resulting list.
325 See glob for details of filename expansion. Resulting file
326 names will then be processed according to ntrans and nmap
327 settings.
328
329
330 newer file-name [[local-file]
331 Get the file only if the modification time of the remote
332 file is more recent that the file on the current system. If
333 the file does not exist on the current system, the remote
334 file is considered newer. Otherwise, this command is
335 identical to get.
336
337
338 nlist
339 [[remote-directory]
340 [[local-file]
341 Print a list of the files in a directory on the remote
342 machine. If remote-directory is left unspecified, the
343 current working directory is used. If interactive prompting
344 is on, ftp will prompt the user to verify that the last
345 argument is indeed the target local file for receiving nlist
346 output. If no local file is specified, or if local-file is
347 -, the output is sent to the terminal.
348
349
350 nmap [[inpattern outpattern]
351 Set or unset the filename mapping mechanism. If no arguments
352 are specified, the filename mapping mechanism is unset. If
353 arguments are specified, remote filenames are mapped during
354 mput commands and put commands issued without a specified
355 remote target filename. If arguments are speci- fied, local
356 filenames are mapped during mget com- mands and get commands
357 issued without a specified local target filename. This
358 command is useful when connecting to a non-
359 UNIX remote computer with different file
360 naming conventions or prac- tices. The mapping follows the
361 pattern set by inpattern and outpattern. [[Inpattern] is a
362 tem- plate for incoming filenames (which may have already
363 been processed according to the ntrans and case settings).
364 Variable templating is accomplished by including the
365 sequences `$1', `$2', ..., `$9' in inpattern. Use `' to
366 prevent this special treatment of the `$' character. All
367 other characters are treated literally, and are used to
368 determine the nmap [[inpattern] variable values. For example,
369 given inpattern $1.$2 and the remote file name
370
371
372 nmap $1.$2.$3 [[$1,$2].[[$2,file]
373 would yield the output filename
374 ntrans [[inchars [[outchars]]
375
376
377 Set or unset the filename character translationmechanism. If no arguments are specified, thefilename character translation mechanism isunset. If arguments are specified, characters inremote filenames are translated during mput com-mands and put commands issued without a specifiedremote target filename. If arguments are speci-fied, characters in local filenames are trans-lated during mget commands and get commandsissued without a specified local target filename.This command is useful when connecting to anon-UNIX remote computer with different file nam-ing conventions or practices. Characters in afilename matching a character in inchars arereplaced with the corresponding character inoutchars. If the character's position in incharsis longer than the length of outchars, the char-acter is deleted from the file name.open host [[port] Establish a connection to the specified host FTPserver. An optional port number may be supplied,in which case, ftp will attempt to contact an FTPserver at that port. If the auto-login option ison (default), ftp will also attempt to automati-cally log the user in to the FTP server (seebelow).prompt Toggle interactive prompting. Interactiveprompting occurs during multiple file transfersto allow the user to selectively retrieve orstore files. If prompting is turned off (defaultis on), any mget or mput will transfer all files,and any mdelete will delete all files.proxy ftp-command Execute an ftp command on a secondary controlconnection. This command allows simultaneousconnection to two remote ftp servers for trans-ferring files between the two servers. The firstproxy command should be an open, to establish thesecondary control connection. Enter the command command by the server on the secondary control connection.
378
379
380 put local-file [[remote-file]
381 Store a local file on the remote machine. If remote-file is
382 left unspecified, the local file name is used after
383 processing according to any ntrans or nmap settings in
384 naming the remote file. File transfer uses the current
385 settings for type, format, mode, and structure.
386
387
388 pwd
389 Print the name of the current working directory on the
390 remote machine.
391
392
393 quit
394 A synonym for bye.
395
396
397 quote arg1 arg2 ...
398 The arguments specified are sent, verbatim, to the remote
399 FTP server.
400
401
402 recv remote-file [[local-file]
403 A synonym for get.
404
405
406 reget remote-file [[local-file]
407 Reget acts like get, except that if local-file exists and is
408 smaller than remote-file, local-file is presumed to be a
409 partially trans- ferred copy of remote-file and the transfer
410 is continued from the apparent point of failure. If
411 local-file does not exist ftp won't fetch the file. This
412 command is useful when transferring very large files over
413 networks that are prone to dropping
414 connections.
415
416
417 remotehelp [[command-name]
418 Request help from the remote FTP server. If a
419 command-name is specified it is supplied to the server as
420 well.
421
422
423 remotestatus [[file-name]
424 With no arguments, show status of remote machine. If
425 file-name is specified, show status of file-name on remote
426 machine.
427
428
429 rename
430 [[from]
431 [[to]
432 Rename the file from on the remote machine, to the file
433 to.
434
435
436 reset
437 Clear reply queue. This command re-synchronizes
438 command/reply sequencing with the remote ftp server.
439 Resynchronization may be necessary fol- lowing a violation
440 of the ftp protocol by the remote server.
441
442
443 restart marker
444 Restart the immediately following get or put at the
445 indicated marker. On UNIX systems, marker is
446 usually a byte offset into the file.
447
448
449 rmdir directory-name
450 Delete a directory on the remote machine.
451
452
453 runique
454 Toggle storing of files on the local system with unique
455 filenames. If a file already exists with a name equal to the
456 target local filename for a get or mget command, a
457
458
459 send local-file [[remote-file]
460 A synonym for put.
461
462
463 sendport
464 Toggle the use of PORT commands. By default, ftp
465 will attempt to use a PORT command when estab-
466 lishing a connection for each data transfer. The use of
467 PORT commands can prevent delays when per- forming
468 multiple file transfers. If the PORT command fails,
469 ftp will use the default data port. When the use of
470 PORT commands is disabled, no attempt will be made
471 to use PORT commands for each data transfer. This
472 is useful for certain FTP implementations
473 which do ignore PORT commands but, incorrectly,
474 indicate they've been accepted.
475
476
477 site arg1 arg2 ...
478 The arguments specified are sent, verbatim, to the remote
479 FTP server as a SITE
480 command.
481
482
483 size file-name
484 Return size of file-name on remote machine.
485
486
487 status
488 Show the current status of ftp.
489
490
491 struct [[struct-name]
492 Set the file transfer structure to struct-name. By default
493 ``stream'' structure is used.
494
495
496 sunique
497 Toggle storing of files on remote machine under unique file
498 names. Remote ftp server must sup- port ftp protocol
499 STOU command for successful completion. The remote
500 server will report unique name. Default value is
501 off.
502
503
504 system
505 Show the type of operating system running on the remote
506 machine.
507
508
509 tenex
510 Set the file transfer type to that needed to talk to
511 TENEX machines.
512
513
514 trace
515 Toggle packet tracing.
516
517
518 type [[type-name]
519 Set the file transfer type to type-name. If no type is
520 specified, the current type is printed. The default type is
521 network ASCII .
522
523
524 umask [[newmask]
525 Set the default umask on the remote server to newmask. If
526 newmask is ommitted, the current umask is
527 printed.
528
529
530 user user-name
531 [[password]
532 [[account]
533 Identify yourself to the remote FTP server.
534 If the password is not specified and the server requires it,
535 ftp will prompt the user for it (after disabling local
536 echo). If an account field is not specified, and the
537 FTP server requires it, the user will be
538 prompted for it. If an account field is specified, an
539 account com- mand will be relayed to the remote server after
540 the login sequence is completed if the remote server did not
541 require it for logging in. Unless ftp is invoked with
542 ``auto-login'' disabled, this process is done automatically
543 on initial connec- tion to the FTP
544 server.
545
546
547 verbose
548 Toggle verbose mode. In verbose mode, all responses from the
549 FTP server are displayed to the user. In
550 addition, if verbose is on, when a file transfer completes,
551 statistics regarding the efficiency of the transfer are
552 reported. By default, verbose is on.
553
554
555 ? [[command]
556 A synonym for help.
557
558
559 Command arguments which have embedded spaces may be quoted
560 with quote `
561
562
563 __ABORTING A FILE TRANSFER__
564
565
566 To abort a file transfer, use the terminal interrupt key
567 (usually Ctrl-C). Sending transfers will be immediately
568 halted. Receiving transfers will be halted by sending a ftp
569 protocol ABOR command to the remote server, and
570 discarding any further data received. The speed at which
571 this is accomplished depends upon the remote server's
572 support for ABOR processing. If the remote server
573 does not support the ABOR command, an
574 ftp prompt will not appear until the remote
575 server has completed sending the requested
576 file.
577
578
579 The terminal interrupt key sequence will be ignored when ftp
580 has completed any local processing and is awaiting a reply
581 from the remote server. A long delay in this mode may result
582 from the ABOR processing described above, or from unexpected
583 behavior by the remote server, including viola- tions of the
584 ftp protocol. If the delay results from unex- pected remote
585 server behavior, the local ftp program must be killed by
586 hand.
587 __FILE NAMING CONVENTIONS__
588
589
590 Files specified as arguments to ftp commands are processed
591 according to the following rules.
592 1.If the file name - is specified, the stdin (for reading)or stdout (for writing) is used.
593
594
595 2.If the first character of the file name is |, theremainder of the argument is interpreted as a shell com-mand. Ftp then forks a shell, using popen(3) with the argument supplied, and reads (writes) from the stdout (stdin). If the shell command includes spaces, the argument must be quoted; e.g. ``
596
597
598 3.Failing the above checks, if ``globbing'' is enabled,
599 local file names are expanded according to the rules used in
600 the csh(1); c.f. the glob command. If the ftp
601 command expects a single local file (.e.g. put), only the
602 first filename generated by the
603
604
605 4.For mget commands and get commands with unspecified local
606 file names, the local filename is the remote file- name,
607 which may be altered by a case, ntrans, or nmap setting. The
608 resulting filename may then be altered if runique is
609 on.
610
611
612 5.For mput commands and put commands with unspecified remote
613 file names, the remote filename is the local filename, which
614 may be altered by a ntrans or nmap set- ting. The resulting
615 filename may then be altered by the remote server if sunique
616 is on.
617
618
619 __FILE TRANSFER PARAMETERS__
620
621
622 The FTP specification specifies many parameters which may
623 affect a file transfer. The type may be one of ``ascii'',
624 ``image'' (binary), ``ebcdic'', and ``local byte size'' (for
625 PDP -10's and PDP -20's
626 mostly). Ftp supports the ascii and image types of file
627 transfer, plus local byte size 8 for tenex mode
628 transfers.
629
630
631 Ftp supports only the default values for the remaining file
632 transfer parameters: mode, form, and struct.
633 __ENVIRONMENT__
634
635
636 Ftp utilizes the following environment
637 variables.
638 HOME
639 For default location of a .netrc file, if one
640 exists.
641
642
643 SHELL
644 For default shell.
645
646
647 __SEE ALSO__
648
649
650 ftpd(8), RFC 959
651 __HISTORY__
652
653
654 The ftp command appeared in 4.2 BSD
655 .
656 __BUGS__
657
658
659 Correct execution of many commands depends upon proper
660 behavior by the remote server.
661
662
663 An error in the treatment of carriage returns in the 4.2 BSD ascii-mode transfer code has been corrected. This correc- tion may result in incorrect transfers of binary files to and from 4.2 BSD servers using the ascii type. Avoid this problem by using the binary image type.
664
665
2 perry 666 Linux !NetKit (0.17) August 15, 1999 1
1 perry 667 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.