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