converted man page
[unix-history] / usr / src / usr.bin / telnet / telnet.1
CommitLineData
b5dc1377 1.\" Copyright (c) 1983, 1990 The Regents of the University of California.
59ccfe44 2.\" All rights reserved.
24854a1c 3.\"
b5dc1377 4.\" %sccs.include.redist.man%
24854a1c 5.\"
b5dc1377 6.\" @(#)telnet.1 6.9 (Berkeley) %G%
59ccfe44 7.\"
b5dc1377
CL
8.Dd
9.Dt TELNET 1
10.Os BSD 4.2
11.Sh NAME
12.Nm telnet
13.Nd user interface to the
14.Li TELNET
15protocol
16.Sh SYNOPSIS
17.Nm telnet
18.Op Fl d
19.Op Fl n Ar tracefile
20.Op Ar host Op Ar port
21.Sh DESCRIPTION
b750597e 22The
b5dc1377 23.Nm telnet
b750597e 24command
b5dc1377
CL
25is used to communicate with another host using the
26.Li TELNET
27protocol.
28If
29.Nm telnet
b750597e 30is invoked without the
b5dc1377 31.Ar host
b750597e 32argument, it enters command mode,
b5dc1377
CL
33indicated by its prompt
34.Pq Nm telnet\&> .
24854a1c
KM
35In this mode, it accepts and executes the commands listed below.
36If it is invoked with arguments, it performs an
b5dc1377
CL
37.Ic open
38command with those arguments.
39.Pp
40Options:
41.Tw Fl
42.Tp Fl d
43Sets the initial value of the
44.Ic debug
45toggle to
46.Li TRUE
47.Tp Cx Fl n
48.Cx \&\ \&
49.Ar tracefile
50.Cx
51Opens
52.Ar tracefile
53for recording trace information.
54See the
55.Ic set tracefile
56command below.
57.Tp Ar host
58Indicates the official name, an alias, or the Internet address
59of a remote host.
60.Tp Ar port
61Indicates a port number (address of an application). If a number is
62not specified, the default
63.Nm telnet
64port is used.
65.Tp
66.Pp
24854a1c 67Once a connection has been opened,
b5dc1377 68.Nm telnet
b750597e 69will attempt to enable the
b5dc1377 70.Li TELNET LINEMODE
b750597e
PB
71option.
72If this fails, then
b5dc1377 73.Nm telnet
b750597e 74will revert to one of two input modes:
b5dc1377
CL
75either \*(Lqcharacter at a time\*(Rq
76or \*(Lqold line by line\*(Rq
5c2bded5 77depending on what the remote system supports.
b5dc1377
CL
78.Pp
79When
80.Li LINEMODE
81is enabled, character processing is done on the
b750597e
PB
82local system, under the control of the remote system. When input
83editing or character echoing is to be disabled, the remote system
84will relay that information. The remote system will also relay
85changes to any special characters that happen on the remote
86system, so that they can take effect on the local system.
b5dc1377
CL
87.Pp
88In \*(Lqcharacter at a time\*(Rq mode, most
5c2bded5 89text typed is immediately sent to the remote host for processing.
b5dc1377
CL
90.Pp
91In \*(Lqold line by line\*(Rq mode, all text is echoed locally,
5c2bded5 92and (normally) only completed lines are sent to the remote host.
b5dc1377 93The \*(Lqlocal echo character\*(Rq (initially \*(Lq^E\*(Rq) may be used
5c2bded5
GM
94to turn off and on the local echo
95(this would mostly be used to enter passwords
96without the password being echoed).
b5dc1377
CL
97.Pp
98If the
99.Li LINEMODE
100option is enabled, or if the
101.Ic localchars
102toggle is TRUE (the default for \*(Lqold line by line\*(Lq; see below),
5c2bded5 103the user's
b5dc1377
CL
104.Ic quit ,
105.Ic intr ,
5c2bded5 106and
b5dc1377 107.Ic flush
5c2bded5 108characters are trapped locally, and sent as
b5dc1377 109.Li TELNET
5c2bded5 110protocol sequences to the remote side.
b5dc1377
CL
111If
112.Li LINEMODE
113has ever been enabled, then the user's
114.Ic susp
b750597e 115and
b5dc1377 116.Ic eof
b750597e 117are also sent as
b5dc1377 118.Li TELNET
b750597e
PB
119protocol sequences,
120and
b5dc1377
CL
121.Ic quit
122is sent as a
123.Li TELNET ABORT
124instead of
125.Li BREAK
5c2bded5 126There are options (see
b5dc1377
CL
127.Ic toggle
128.Ic autoflush
5c2bded5 129and
b5dc1377
CL
130.Ic toggle
131.Ic autosynch
5c2bded5
GM
132below)
133which cause this action to flush subsequent output to the terminal
134(until the remote host acknowledges the
b5dc1377 135.Li TELNET
5c2bded5
GM
136sequence) and flush previous terminal input
137(in the case of
b5dc1377 138.Ic quit
5c2bded5 139and
b5dc1377
CL
140.Ic intr ) .
141.Pp
5c2bded5 142While connected to a remote host,
b5dc1377 143.Nm telnet
5c2bded5 144command mode may be entered by typing the
b5dc1377
CL
145.Nm telnet
146\*(Lqescape character\*(Rq (initially \*(Lq^
147\*(Rq).
24854a1c 148When in command mode, the normal terminal editing conventions are available.
b5dc1377
CL
149.Pp
150The following .Nm telnet
151commands are available.
5c2bded5
GM
152Only enough of each command to uniquely identify it need be typed
153(this is also true for arguments to the
b5dc1377
CL
154.Ic mode ,
155.Ic set ,
156.Ic toggle ,
157.Ic unset ,
158.Ic slc ,
5c2bded5 159and
b5dc1377 160.Ic display
5c2bded5 161commands).
b5dc1377
CL
162.Pp
163.Tw Ic
164.Tp Ic close
5c2bded5 165Close a
b5dc1377 166.Li TELNET
5c2bded5 167session and return to command mode.
b5dc1377
CL
168.Tp Cx Ic display
169.Cx \&\ \&
170.Ar argument ...
171.Cx
b750597e 172Displays all, or some, of the
b5dc1377 173.Ic set
b750597e 174and
b5dc1377 175.Ic toggle
b750597e 176values (see below).
b5dc1377
CL
177.Tp Cx Ic mode
178.Cx \&\ \&
179.Ar type
180.Cx
181.Ar Type
b750597e 182is one of several options, depending on the state of the
b5dc1377 183.Li TELNET
b750597e 184session.
5c2bded5
GM
185The remote host is asked for permission to go into the requested mode.
186If the remote host is capable of entering that mode, the requested
187mode will be entered.
b5dc1377
CL
188.Tw Ar
189.Tp Ic character
b750597e 190Disable the
b5dc1377 191.Li TELNET LINEMODE
b750597e 192option, or, if the remote side does not understand the
b5dc1377
CL
193.Li LINEMODE
194option, then enter \*(Lqcharacter at a time\*(Lq mode.
195.Tp Ic line
b750597e 196Enable the
b5dc1377 197.Li TELNET LINEMODE
b750597e 198option, or, if the remote side does not understand the
b5dc1377
CL
199.Li LINEMODE
200option, then attempt to enter \*(Lqold-line-by-line\*(Lq mode.
201.Tp Cx Ic isig
202.Cx \&\ \&
203.Pq Ic \-isig
204.Cx
205Attempt to enable (disable) the
206.Li TRAPSIG
207mode of the
208.Li LINEMODE
209option.
210This requires that the
211.Li LINEMODE
212option be enabled.
213.Tp Cx Ic edit
214.Cx \&\ \&
215.Pq Ic \-edit
216.Cx
217Attempt to enable (disable) the
218.Li EDIT
219mode of the
220.Li LINEMODE
221option.
222This requires that the
223.Li LINEMODE
224option be enabled.
225.Tp Ic \&?
b750597e 226Prints out help information for the
b5dc1377 227.Ic mode
b750597e 228command.
b5dc1377
CL
229.Tp
230.Tp Cx Ic open
231.Cx \&\ \&
232.Ar host
233.Cx \&\ \&
234.Cx [
235.Op Fl
236.Cx \&\ \&
237.Ar port
238.Cx ]
239.Cx
b750597e
PB
240Open a connection to the named host.
241If no port number
b5dc1377
CL
242is specified,
243.Nm telnet
b750597e 244will attempt to contact a
b5dc1377 245.Li TELNET
b750597e 246server at the default port.
b5dc1377
CL
247The host specification may be either a host name (see
248.Xr hosts 5 )
249or an Internet address specified in the \*(Lqdot notation\*(Rq (see
250.Xr inet 3 ) .
b750597e 251When connecting to a non-standard port,
b5dc1377 252.Nm telnet
b750597e 253omits any automatic initiation of
b5dc1377 254.Li TELNET
b750597e
PB
255options. When the port number is preceeded by a minus sign,
256the inital option negotiation is done.
b5dc1377
CL
257After establishing a connection, the file
258.Pa \&.telnetrc
259in the
b750597e
PB
260users home directory is opened. Lines begining with a # are
261comment lines. Blank lines are ignored. Lines that begin
262without whitespace are the start of a machine entry. The
263first thing on the line is the name of the machine that is
264being connected to. The rest of the line, and successive
265lines that begin with whitespace are assumed to be
b5dc1377 266.Nm telnet
b750597e
PB
267commands and are processed as if they had been typed
268in manually to the
b5dc1377 269.Nm telnet
b750597e 270command prompt.
b5dc1377 271.Tp Ic quit
b750597e 272Close any open
b5dc1377
CL
273.Li TELNET
274session and exit
275.Nm telnet .
b750597e 276An end of file (in command mode) will also close a session and exit.
b5dc1377
CL
277.Tp Cx Ic send
278.Cx \&\ \&
279.Ar arguments
280.Cx
b750597e
PB
281Sends one or more special character sequences to the remote host.
282The following are the arguments which may be specified
283(more than one argument may be specified at a time):
b5dc1377
CL
284.Pp
285.Tw Ds
286.Tp Ic abort
5c2bded5 287Sends the
b5dc1377 288.Li TELNET ABORT
b750597e
PB
289(ABORT processes)
290sequence.
b5dc1377 291.Tp Ic ao
5c2bded5 292Sends the
b5dc1377 293.Li TELNET AO
5c2bded5
GM
294(Abort Output) sequence, which should cause the remote system to flush
295all output
b5dc1377 296.Em from
5c2bded5 297the remote system
b5dc1377 298.Em to
5c2bded5 299the user's terminal.
b5dc1377 300.Tp Ic ayt
5c2bded5 301Sends the
b5dc1377 302.Li TELNET AYT
5c2bded5 303(Are You There)
349a83e1 304sequence, to which the remote system may or may not choose to respond.
b5dc1377 305.Tp Ic brk
5c2bded5 306Sends the
b5dc1377 307.Li TELNET BRK
b750597e
PB
308(Break) sequence, which may have significance to the remote
309system.
b5dc1377 310.Tp Ic ec
b750597e 311Sends the
b5dc1377 312.Li TELNET EC
5c2bded5
GM
313(Erase Character)
314sequence, which should cause the remote system to erase the last character
315entered.
b5dc1377 316.Tp Ic el
5c2bded5 317Sends the
b5dc1377 318.Li TELNET EL
5c2bded5
GM
319(Erase Line)
320sequence, which should cause the remote system to erase the line currently
321being entered.
b5dc1377 322.Tp Ic eof
b750597e 323Sends the
b5dc1377 324.Li TELNET EOF
b750597e
PB
325(End Of File)
326sequence.
b5dc1377 327.Tp Ic eor
b750597e 328Sends the
b5dc1377 329.Li TELNET EOR
b750597e
PB
330(End of Record)
331sequence.
b5dc1377 332.Tp Ic escape
b750597e 333Sends the current
b5dc1377
CL
334.Nm telnet
335escape character (initially \*(Lq^\*(Rq).
336.Tp Ic ga
5c2bded5 337Sends the
b5dc1377 338.Li TELNET GA
5c2bded5
GM
339(Go Ahead)
340sequence, which likely has no significance to the remote system.
b5dc1377 341.Tp Ic getstatus
6570c863 342If the remote side supports the
b5dc1377 343.Li TELNET STATUS
6570c863 344command,
b5dc1377 345.Ic getstatus
6570c863
PB
346will send the subnegotiation to request that the server send
347its current option status.
b5dc1377 348.Tp Ic ip
5c2bded5 349Sends the
b5dc1377 350.Li TELNET IP
b750597e
PB
351(Interrupt Process) sequence, which should cause the remote
352system to abort the currently running process.
b5dc1377 353.Tp Ic nop
b750597e 354Sends the
b5dc1377 355.Li TELNET NOP
5c2bded5
GM
356(No OPeration)
357sequence.
b5dc1377 358.Tp Ic susp
b750597e 359Sends the
b5dc1377 360.Li TELNET SUSP
b750597e
PB
361(SUSPend process)
362sequence.
b5dc1377 363.Tp Ic synch
b750597e 364Sends the
b5dc1377 365.Li TELNET SYNCH
b750597e
PB
366sequence.
367This sequence causes the remote system to discard all previously typed
368(but not yet read) input.
369This sequence is sent as TCP urgent
370data (and may not work if the remote system is a 4.2 BSD system -- if
b5dc1377
CL
371it doesn't work, a lower case \*(Lqr\*(Rq may be echoed on the terminal).
372.Tp Ic \&?
5c2bded5 373Prints out help information for the
b5dc1377 374.Ic send
5c2bded5 375command.
b5dc1377
CL
376.Tp
377.Tp Cx Ic set
378.Cx \&\ \&
379.Ar argument value
380.Cx
381.Tp Cx Ic unset
382.Cx \&\ \&
383.Ar argument value
384.Cx
b750597e 385The
b5dc1377 386.Ic set
b750597e 387command will set any one of a number of
b5dc1377 388.Nm telnet
b750597e 389variables to a specific value or to TRUE.
b5dc1377
CL
390The special value
391.Ic off
392turns off the function associated with
b750597e 393the variable, this is equivalent to using the
b5dc1377 394.Ic unset
b750597e
PB
395command.
396The
b5dc1377 397.Ic unset
b750597e 398command will disable or set to FALSE any of the specified functions.
349a83e1 399The values of variables may be interrogated with the
b5dc1377 400.Ic display
349a83e1 401command.
b750597e
PB
402The variables which may be set or unset, but not toggled, are
403listed here. In addition, any of the variables for the
b5dc1377
CL
404.Ic toggle
405command may be explicitly set or unset using
406the
407.Ic set
408and
409.Ic unset
410commands.
411.Tw Fl
412.Tp Ic echo
413This is the value (initially \*(Lq^E\*(Rq) which, when in
414\*(Lqline by line\*(Rq mode, toggles between doing local echoing
5c2bded5
GM
415of entered characters (for normal processing), and suppressing
416echoing of entered characters (for entering, say, a password).
b5dc1377 417.Tp Ic eof
b750597e 418If
b5dc1377 419.Nm telnet
b750597e 420is operating in
b5dc1377
CL
421.Li LINEMODE
422or \*(Lqold line by line\*(Rq mode, entering this character
b750597e
PB
423as the first character on a line will cause this character to be
424sent to the remote system.
425The initial value of the eof character is taken to be the terminal's
b5dc1377 426.Ic eof
b750597e 427character.
b5dc1377 428.Tp Ic erase
5c2bded5 429If
b5dc1377 430.Nm telnet
5c2bded5 431is in
b5dc1377 432.Ic localchars
5c2bded5 433mode (see
b5dc1377
CL
434.Ic toggle
435.Ic localchars
b750597e 436below),
b5dc1377 437.Sy and
b750597e 438if
b5dc1377
CL
439.Nm telnet
440is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
5c2bded5 441character is typed, a
b5dc1377 442.Li TELNET EC
5c2bded5 443sequence (see
b5dc1377
CL
444.Ic send
445.Ic ec
5c2bded5 446above)
b750597e
PB
447is sent to the remote system.
448The initial value for the erase character is taken to be
5c2bded5 449the terminal's
b5dc1377 450.Ic erase
5c2bded5 451character.
b5dc1377 452.Tp Ic escape
b750597e 453This is the
b5dc1377
CL
454.Nm telnet
455escape character (initially \*(Lq^[\*(Rq) which causes entry
b750597e 456into
b5dc1377 457.Nm telnet
b750597e 458command mode (when connected to a remote system).
b5dc1377 459.Tp Ic flushoutput
5c2bded5 460If
b5dc1377 461.Nm telnet
5c2bded5 462is in
b5dc1377 463.Ic localchars
5c2bded5 464mode (see
b5dc1377
CL
465.Ic toggle
466.Ic localchars
5c2bded5
GM
467below)
468and the
b5dc1377 469.Ic flushoutput
5c2bded5 470character is typed, a
b5dc1377 471.Li TELNET AO
5c2bded5 472sequence (see
b5dc1377
CL
473.Ic send
474.Ic ao
5c2bded5
GM
475above)
476is sent to the remote host.
b750597e 477The initial value for the flush character is taken to be
5c2bded5 478the terminal's
b5dc1377 479.Ic flush
5c2bded5 480character.
b5dc1377 481.Tp Ic interrupt
5c2bded5 482If
b5dc1377 483.Nm telnet
5c2bded5 484is in
b5dc1377 485.Ic localchars
5c2bded5 486mode (see
b5dc1377
CL
487.Ic toggle
488.Ic localchars
5c2bded5
GM
489below)
490and the
b5dc1377 491.Ic interrupt
5c2bded5 492character is typed, a
b5dc1377 493.Li TELNET IP
5c2bded5 494sequence (see
b5dc1377
CL
495.Ic send
496.Ic ip
5c2bded5
GM
497above)
498is sent to the remote host.
b750597e 499The initial value for the interrupt character is taken to be
5c2bded5 500the terminal's
b5dc1377 501.Ic intr
5c2bded5 502character.
b5dc1377 503.Tp Ic kill
5c2bded5 504If
b5dc1377 505.Nm telnet
5c2bded5 506is in
b5dc1377 507.Ic localchars
5c2bded5 508mode (see
b5dc1377
CL
509.Ic toggle
510.Ic localchars
5c2bded5 511below),
b5dc1377 512.Ic and
5c2bded5 513if
b5dc1377
CL
514.Nm telnet
515is operating in \*(Lqcharacter at a time\*(Rq mode, then when this
5c2bded5 516character is typed, a
b5dc1377 517.Li TELNET EL
5c2bded5 518sequence (see
b5dc1377
CL
519.Ic send
520.Ic el
5c2bded5
GM
521above)
522is sent to the remote system.
b750597e 523The initial value for the kill character is taken to be
5c2bded5 524the terminal's
b5dc1377 525.Ic kill
b750597e 526character.
b5dc1377 527.Tp Ic lnext
b750597e 528If
b5dc1377 529.Nm telnet
b750597e 530is operating in
b5dc1377
CL
531.Li LINEMODE
532or \*(Lqold line by line\*(Lq mode, then this character is taken to
b750597e 533be the terminal's
b5dc1377 534.Ic lnext
b750597e
PB
535character.
536The initial value for the lnext character is taken to be
537the terminal's
b5dc1377 538.Ic lnext
5c2bded5 539character.
b5dc1377 540.Tp Ic quit
5c2bded5 541If
b5dc1377 542.Nm telnet
5c2bded5 543is in
b5dc1377 544.Ic localchars
5c2bded5 545mode (see
b5dc1377
CL
546.Ic toggle
547.Ic localchars
b750597e
PB
548below)
549and the
b5dc1377 550.Ic quit
5c2bded5 551character is typed, a
b5dc1377 552.Li TELNET BRK
5c2bded5 553sequence (see
b5dc1377
CL
554.Ic send
555.Ic brk
5c2bded5 556above)
b750597e
PB
557is sent to the remote host.
558The initial value for the quit character is taken to be
559the terminal's
b5dc1377 560.Ic quit
b750597e 561character.
b5dc1377 562.Tp Ic reprint
b750597e 563If
b5dc1377 564.Nm telnet
b750597e 565is operating in
b5dc1377
CL
566.Li LINEMODE
567or \*(Lqold line by line\*(Lq mode, then this character is taken to
b750597e 568be the terminal's
b5dc1377 569.Ic reprint
b750597e
PB
570character.
571The initial value for the reprint character is taken to be
572the terminal's
b5dc1377 573.Ic reprint
b750597e 574character.
b5dc1377 575.Tp Ic start
b750597e 576If the
b5dc1377 577.Li TELNET TOGGLE-FLOW-CONTROL
b750597e
PB
578option has been enabled,
579then this character is taken to
580be the terminal's
b5dc1377 581.Ic start
b750597e 582character.
5c2bded5
GM
583The initial value for the kill character is taken to be
584the terminal's
b5dc1377 585.Ic start
5c2bded5 586character.
b5dc1377 587.Tp Ic stop
b750597e 588If the
b5dc1377 589.Li TELNET TOGGLE-FLOW-CONTROL
b750597e
PB
590option has been enabled,
591then this character is taken to
592be the terminal's
b5dc1377 593.Ic stop
b750597e
PB
594character.
595The initial value for the kill character is taken to be
596the terminal's
b5dc1377 597.Ic stop
b750597e 598character.
b5dc1377 599.Tp Ic susp
5c2bded5 600If
b5dc1377 601.Nm telnet
b750597e 602is in
b5dc1377 603.Ic localchars
b750597e 604mode, or
b5dc1377 605.Li LINEMODE
b750597e 606is enabled, and the
b5dc1377 607.Ic suspend
b750597e 608character is typed, a
b5dc1377 609.Li TELNET SUSP
b750597e 610sequence (see
b5dc1377
CL
611.Ic send
612.Ic susp
b750597e
PB
613above)
614is sent to the remote host.
615The initial value for the suspend character is taken to be
616the terminal's
b5dc1377 617.Ic suspend
b750597e 618character.
b5dc1377
CL
619.Tp Ic tracefile
620Thi is the file to which the output, caused by
621.Ic netdata
622or
623.Ic option
624tracing being TRUE, will be written. If it is set to
625.Dq Fl ,
b750597e 626then tracing information will be written to standard output (the default).
b5dc1377 627.Tp Ic worderase
b750597e 628If
b5dc1377 629.Nm telnet
b750597e 630is operating in
b5dc1377
CL
631.Li LINEMODE
632or \*(Lqold line by line\*(Lq mode, then this character is taken to
b750597e 633be the terminal's
b5dc1377 634.Ic worderase
b750597e
PB
635character.
636The initial value for the worderase character is taken to be
637the terminal's
b5dc1377 638.Ic worderase
5c2bded5 639character.
b5dc1377
CL
640.Tp
641.Tp Cx Ic slc
642.Cx \&\ \&
643.Ar state
644.Cx
b750597e 645The
b5dc1377 646.Ic slc
b750597e
PB
647command (Set Local Characters) is used to set
648or change the state of the the special
b5dc1377
CL
649characters when the
650.Li TELNET LINEMODE
651option has
b750597e 652been enabled. Special characters are characters that get
b5dc1377
CL
653mapped to
654.Li TELNET
655commands sequences (like
656.Ic ip
b750597e 657or
b5dc1377 658.Ic quit )
b750597e 659or line editing characters (like
b5dc1377 660.Ic erase
b750597e 661and
b5dc1377 662.Ic kill ) .
b750597e 663By default, the local special characters are exported.
b5dc1377
CL
664.Tw Fl
665.Tp Ic export
b750597e
PB
666Switch to the local defaults for the special characters. The
667local default characters are those of the local terminal at
668the time when
b5dc1377 669.Nm telnet
b750597e 670was started.
b5dc1377 671.Tp Ic import
b750597e
PB
672Switch to the remote defaults for the special characters.
673The remote default characters are those of the remote system
b5dc1377
CL
674at the time when the
675.Li TELNET
676connection was established.
677.Tp Ic check
b750597e
PB
678Verify the current settings for the current special characters.
679The remote side is requested to send all the current special
680character settings, and if there are any discrepencies with
681the local side, the local side will switch to the remote value.
b5dc1377 682.Ic Ic \&?
b750597e 683Prints out help information for the
b5dc1377 684.Ic slc
b750597e 685command.
b5dc1377
CL
686.Tp
687.Tp Ic \&?
b750597e 688Displays the legal
b5dc1377
CL
689.Ic set
690.Pq Ic unset
b750597e 691commands.
b5dc1377
CL
692.Tp Cx Ic toggle
693.Cx \&\ \&
694.Ar arguments ...
695.Cx
5c2bded5
GM
696Toggle (between
697TRUE
698and
699FALSE)
700various flags that control how
b5dc1377 701.Nm telnet
5c2bded5 702responds to events.
b750597e
PB
703These flags may be set explicitly to TRUE or FALSE
704using the
b5dc1377 705.Ic set
b750597e 706and
b5dc1377 707.Ic unset
b750597e 708commands listed above.
5c2bded5 709More than one argument may be specified.
349a83e1 710The state of these flags may be interrogated with the
b5dc1377 711.Ic display
349a83e1 712command.
5c2bded5 713Valid arguments are:
b5dc1377
CL
714.Tw Ar
715.Tp Ic autoflush
5c2bded5 716If
b5dc1377 717.Ic autoflush
5c2bded5 718and
b5dc1377 719.Ic localchars
5c2bded5
GM
720are both
721TRUE,
722then when the
b5dc1377 723.Ic ao ,
5c2bded5 724or
b5dc1377 725.Ic quit
5c2bded5 726characters are recognized (and transformed into
b5dc1377 727.Li TELNET
5c2bded5 728sequences; see
b5dc1377 729.Ic set
5c2bded5 730above for details),
b5dc1377 731.Nm telnet
5c2bded5
GM
732refuses to display any data on the user's terminal
733until the remote system acknowledges (via a
b5dc1377 734.Li TELNET TIMING MARK
5c2bded5
GM
735option)
736that it has processed those
b5dc1377 737.Li TELNET
5c2bded5
GM
738sequences.
739The initial value for this toggle is TRUE if the terminal user had not
740done an "stty noflsh", otherwise FALSE (see
b5dc1377
CL
741.Xr stty 1 ) .
742.Tp Ic autosynch
349a83e1 743If
b5dc1377 744.Ic autosynch
349a83e1 745and
b5dc1377 746.Ic localchars
349a83e1
MK
747are both
748TRUE,
749then when either the
b5dc1377 750.Ic intr
349a83e1 751or
b5dc1377 752.Ic quit
349a83e1 753characters is typed (see
b5dc1377 754.Ic set
349a83e1 755above for descriptions of the
b5dc1377 756.Ic intr
349a83e1 757and
b5dc1377 758.Ic quit
349a83e1 759characters), the resulting
b5dc1377 760.Li TELNET
349a83e1 761sequence sent is followed by the
b5dc1377 762.Li TELNET SYNCH
349a83e1
MK
763sequence.
764This procedure
b5dc1377 765.Ic should
349a83e1
MK
766cause the remote system to begin throwing away all previously
767typed input until both of the
b5dc1377 768.Li TELNET
349a83e1
MK
769sequences have been read and acted upon.
770The initial value of this toggle is FALSE.
b5dc1377 771.Tp Ic binary
b750597e 772Enable or disable the
b5dc1377 773.Li TELNET BINARY
6570c863 774option on both input and output.
b5dc1377 775.Tp Ic inbinary
6570c863 776Enable or disable the
b5dc1377 777.Li TELNET BINARY
6570c863 778option on input.
b5dc1377 779.Tp Ic outbinary
6570c863 780Enable or disable the
b5dc1377 781.Li TELNET BINARY
6570c863 782option on output.
b5dc1377 783.Tp Ic crlf
b750597e
PB
784If this is TRUE, then carriage returns will be sent as <CR><LF>.
785If this is FALSE, then carriage returns will be send as <CR><NUL>.
786The initial value for this toggle is FALSE.
b5dc1377 787.Tp Ic crmod
5c2bded5
GM
788Toggle carriage return mode.
789When this mode is enabled, most carriage return characters received from
790the remote host will be mapped into a carriage return followed by
791a line feed.
792This mode does not affect those characters typed by the user, only
793those received from the remote host.
794This mode is not very useful unless the remote host
795only sends carriage return, but never line feed.
796The initial value for this toggle is FALSE.
b5dc1377 797.Tp Ic debug
5c2bded5 798Toggles socket level debugging (useful only to the
b5dc1377 799.Ic super user ) .
5c2bded5 800The initial value for this toggle is FALSE.
b5dc1377 801.Tp Ic localchars
b750597e
PB
802If this is
803TRUE,
804then the
b5dc1377
CL
805.Ic flush ,
806.Ic quit ,
b750597e 807and
b5dc1377 808.Ic kill
b750597e 809characters (see
b5dc1377 810.Ic set
b750597e 811above) are recognized locally, and transformed into (hopefully) appropriate
b5dc1377 812.Li TELNET
b750597e
PB
813control sequences
814(respectively
b5dc1377
CL
815.Ic ao ,
816.Ic brk ,
b750597e 817and
b5dc1377 818.Ic el ;
b750597e 819see
b5dc1377 820.Ic send
b750597e 821above).
b5dc1377
CL
822The initial value for this toggle is TRUE in \*(Lqold line by line\*(Rq mode,
823and FALSE in \*(Lqcharacter at a time\*(Rq mode.
b750597e 824When the
b5dc1377 825.Li LINEMODE
b750597e 826option is enabled, the value of
b5dc1377 827.Ic localchars
b750597e
PB
828is ignored, and assumed to always be TRUE.
829If
b5dc1377 830.Li LINEMODE
b750597e 831has ever been enabled, then
b5dc1377 832.Ic quit
b750597e 833is sent as
b5dc1377 834.Ic abort ,
b750597e 835and
b5dc1377 836.Ic eof and
b750597e
PB
837.B suspend
838are sent as
b5dc1377 839.Ic eof and
b750597e 840see
b5dc1377 841.Ic send
b750597e 842above).
b5dc1377 843.Tp Ic netdata
b750597e
PB
844Toggles the display of all network data (in hexadecimal format).
845The initial value for this toggle is FALSE.
b5dc1377 846.Tp Ic options
5c2bded5 847Toggles the display of some internal
b5dc1377 848.Nm telnet
5c2bded5 849protocol processing (having to do with
b5dc1377 850.Li TELNET
5c2bded5
GM
851options).
852The initial value for this toggle is FALSE.
b5dc1377 853.Tp Ic prettydump
b750597e 854When the
b5dc1377 855.Ic netdata
b750597e 856toggle is enabled, if
b5dc1377 857.Ic prettydump
b750597e 858is enabled the output from the
b5dc1377 859.Ic netdata
b750597e
PB
860command will be formated in a more user readable format.
861Spaces are put between each character in the output, and the
862begining of any
b5dc1377 863.Li TELNET
b750597e 864escape sequence is preceeded by a '*' to aid in locating them.
b5dc1377 865.Tp Ic \&?
5c2bded5 866Displays the legal
b5dc1377 867.Ic toggle
5c2bded5 868commands.
b5dc1377
CL
869.Tp
870.Tp Ic z
b750597e 871Suspend
b5dc1377
CL
872.Nm telnet .
873This command only works when the user is using the
874.Xr csh 1 .
875.Tp Cx Ic \&!
876.Cx \&\ \&
877.Op Ar command
878.Cx
b750597e 879Execute a single command in a subshell on the local
b5dc1377
CL
880system. If
881.Ic command
882is ommitted, then an interactive
b750597e 883subshell is invoked.
b5dc1377
CL
884.Tp Ic status
885Show the current status of
886.Nm telnet .
b750597e
PB
887This includes the peer one is connected to, as well
888as the current mode.
b5dc1377
CL
889.Tp Cx Ic \&?
890.Cx \&\ \&
891.Op Ar command
892.Cx
b750597e 893Get help. With no arguments,
b5dc1377 894.Nm telnet
b750597e 895prints a help summary.
b5dc1377
CL
896If a command is specified,
897.Nm telnet
b750597e 898will print the help information for just that command.
b5dc1377
CL
899.Sh ENVIRONMENT
900.Nm Telnet
901uses the
902.Ev HOME ,
903.Ev SHELL
904and
905.Ev TERM
906environent variables.
907.Sh FILES
908.Dw ~/.telnetrc
909.Di L
910.Dp Pa ~/.telnetrc
911user customized telnet startup values
912.Dp
913.Sh HISTORY
914.Nm Telnet
915appeared in 4.2 BSD.
916.Sh NOTES
917.Pp
5c2bded5 918On some remote systems, echo has to be turned off manually when in
b5dc1377
CL
919\*(Lqold line by line\*(Rq mode.
920.Pp
921In \*(Lqold line by line\*(Rq mode or
922.Li LINEMODE
923the terminal's
924.Ic eof
5c2bded5
GM
925character is only recognized (and sent to the remote system)
926when it is the first character on a line.