telnet(1) USER COMMANDS telnet(1)
NAME
telnet - user interface to a remote system using the TELNET
protocol
SYNOPSIS
telnet [ host [ port ] ]
DESCRIPTION
telnet communicates with another host using the TELNET pro-
tocol. If telnet is invoked without arguments, it enters
command mode, indicated by its prompt telnet>. In this
mode, it accepts and executes the commands listed below. If
it is invoked with arguments, it performs an open command
(see ``Telnet Commands'' below) with those arguments.
Once a connection has been opened, telnet enters input mode.
In this mode, text typed is sent to the remote host. The
input mode entered will be either character at a time or
line by line depending on what the remote system supports.
In character at a time mode, most text typed is immediately
sent to the remote host for processing.
In line by line mode, all text is echoed locally, and (nor-
mally) only completed lines are sent to the remote host.
The local echo character (initially ^E) may be used to turn
off and on the local echo (this would mostly be used to
enter passwords without the password being echoed).
In either mode, if the localchars toggle is TRUE (the
default in line mode; see below), the user's quit, intr, and
flush characters are trapped locally, and sent as TELNET
protocol sequences to the remote side. There are options
(see toggle, autoflush, and toggle, autosynch) which cause
this action to flush subsequent output to the terminal
(until the remote host acknowledges the TELNET sequence) and
flush previous terminal input (in the case of quit and
intr).
While connected to a remote host, telnet command mode may be
entered by typing the telnet escape character (initially
^]). When in command mode, the normal terminal editing con-
ventions are available.
USAGE
Telnet Commands
The following commands are available. Only enough of each
command to uniquely identify it need be typed (this is also
true for arguments to the mode, set, toggle, and display
commands).
1
telnet(1) USER COMMANDS telnet(1)
open host [ port ]
Open a connection to the named host. If no port number
is specified, telnet will attempt to contact a TELNET
server at the default port. The host specification may
be either a host name [see hosts(4)] or an Internet
address specified in the dot notation [see inet(7)].
close
Close any open TELNET session and exit telnet. An EOF
(in command mode) will also close a session and exit.
quit Same as close, above.
z Suspend telnet. This command only works when the user
is using a shell that supports job control, such as
sh(1).
mode type
type is either line (for line by line mode) or charac-
ter (for character at a time mode). The remote host is
asked for permission to go into the requested mode. If
the remote host is capable of entering that mode, the
requested mode will be entered.
status
Show the current status of telnet. This includes the
peer one is connected to, as well as the current mode.
display [ argument... ]
Display all, or some, of the set and toggle values (see
toggle, arguments).
? [ command ]
Get help. With no arguments, telnet print a help sum-
mary. If a command is specified, telnet will print the
help information for just that command.
send arguments
Send one or more special character sequences to the
remote host. The following are the arguments which may
be specified (more than one argument may be specified
at a time):
escape
Send the current telnet escape character (ini-
tially ^]).
synch
Send the TELNET SYNCH sequence. This sequence
discards all previously typed (but not yet read)
input on the remote system. This sequence is sent
as TCP urgent data (and may not work if the remote
2
telnet(1) USER COMMANDS telnet(1)
system is a 4.2 BSD system - if it does not work,
a lower case r may be echoed on the terminal).
brk Send the TELNET BRK (Break) sequence, which may
have significance to the remote system.
ip Send the TELNET IP (Interrupt Process) sequence,
which aborts the currently running process on the
remote system.
ao Sends the TELNET AO (Abort Output) sequence, which
flushes all output from the remote system to the
user's terminal.
ayt Sends the TELNET AYT (Are You There) sequence, to
which the remote system may or may not choose to
respond.
ec Sends the TELNET EC (Erase Character) sequence,
which erases the last character entered.
el Sends the TELNET EL (Erase Line) sequence, which
should cause the remote system to erase the line
currently being entered.
ga Sends the TELNET GA (Go Ahead) sequence, which
likely has no significance to the remote system.
nop Sends the TELNET NOP (No Operation) sequence.
? Prints out help information for the send command.
set argument value
Set any one of a number of telnet variables to a
specific value. The special value off turns off the
function associated with the variable. The values of
variables may be interrogated with the display command.
The variables which may be specified are:
echo This is the value (initially ^E) which, when in
line by line mode, toggles between doing local
echoing of entered characters (for normal process-
ing), and suppressing echoing of entered charac-
ters (for example, entering a password).
escape
This is the telnet escape character (initially ^])
which enters telnet command mode (when connected
to a remote system).
interrupt
If telnet is in localchars mode (see toggle
3
telnet(1) USER COMMANDS telnet(1)
localchars) and the interrupt character is typed,
a TELNET IP sequence (see send and ip) is sent to
the remote host. The initial value for the inter-
rupt character is taken to be the terminal's intr
character.
quit If telnet is in localchars mode (see toggle local-
chars) and the quit character is typed, a TELNET
BRK sequence (see send, brk) is sent to the remote
host. The initial value for the quit character is
taken to be the terminal's quit character.
flushoutput
If telnet is in localchars mode (see toggle local-
chars) and the flushoutput character is typed, a
TELNET AO sequence (see send, ao) is sent to the
remote host. The initial value for the flush
character is taken to be the terminal's flush
character.
erase
If telnet is in localchars mode (see toggle local-
chars), and if telnet is operating in character at
a time mode, then when this character is typed, a
TELNET EC sequence (see send, ec) is sent to the
remote system. The initial value for the erase
character is taken to be the terminal's erase
character.
kill If telnet is in localchars mode (see toggle local-
chars), and if telnet is operating in character at
a time mode, then when this character is typed, a
TELNET EL sequence (see send, el) is sent to the
remote system. The initial value for the kill
character is taken to be the terminal's kill char-
acter.
eof If telnet is operating in line by line mode,
entering this character as the first character on
a line sends this character to the remote system.
The initial value of the eof character is taken to
be the terminal's eof character.
toggle arguments...
Toggle (between TRUE and FALSE) various flags that con-
trol how telnet responds to events. More than one
argument may be specified. The state of these flags
may be interrogated with the display command. Valid
arguments are:
autoflush
If autoflush and localchars are both TRUE, then
4
telnet(1) USER COMMANDS telnet(1)
when the ao, intr, or quit characters are recog-
nized (and transformed into TELNET sequences; see
set for details), telnet refuses to display any
data on the user's terminal until the remote sys-
tem acknowledges (using a TELNET Timing Mark
option) that it has processed those TELNET
sequences. The initial value for this toggle is
TRUE if the terminal user had not done an stty
noflsh, otherwise FALSE [see stty(1)].
autosynch
If autosynch and localchars are both TRUE, then
when either the intr or quit characters are typed
(see set for descriptions of the intr and quit
characters), the resulting TELNET sequence sent is
followed by the TELNET SYNCH sequence. This pro-
cedure should cause the remote system to begin
throwing away all previously typed input until
both of the TELNET sequences have been read and
acted upon. The initial value of this toggle is
FALSE.
crmod
Toggle RETURN mode. When this mode is enabled,
most RETURN characters received from the remote
host will be mapped into a RETURN followed by a
line feed. This mode does not affect those char-
acters typed by the user, only those received from
the remote host. This mode is not very useful
unless the remote host only sends RETURN, but
never LINEFEED. The initial value for this toggle
is FALSE.
debug
Toggle socket level debugging (useful only to the
super-user). The initial value for this toggle is
FALSE .
localchars
If this is TRUE , then the flush, interrupt, quit,
erase, and kill characters (see set) are recog-
nized locally, and transformed into appropriate
TELNET control sequences (respectively ao, ip,
brk, ec, and el; see send). The initial value for
this toggle is TRUE in line by line mode, and
FALSE in character at a time mode.
netdata
Toggle the display of all network data (in hexade-
cimal format). The initial value for this toggle
is FALSE.
5
telnet(1) USER COMMANDS telnet(1)
options
Toggle the display of some internal telnet proto-
col processing (having to do with TELNET options).
The initial value for this toggle is FALSE.
? Display the legal toggle commands.
SEE ALSO
rlogin(1), sh(1), stty(1), hosts(4), inet(7).
NOTES
Do not attempt to run layers(1) while using telnet.
There is no adequate way for dealing with flow control.
On some remote systems, echo has to be turned off manually
when in line by line mode.
There is enough settable state to justify a file.
In line by line mode, the terminal's EOF character is only
recognized (and sent to the remote system) when it is the
first character on a line.
6