stty - set the options for a terminal
stty [ -a ] [ -g ] [ options ]
stty sets certain terminal I/O options for the device that is the current
standard input; without arguments, it reports the settings of certain
In this report, if a character is preceded by a caret (^), then the value
of that option is the corresponding CTRL character (e.g., ``^H'' is
CTRL-H ; in this case, recall that CTRL-H is the same as the
``backspace'' key.) The sequence ``^''' means that an option has a null
value. For example, normally stty -a will report that the value of swtch
is ``^'''; however, if csh(1) is used, swtch will have the value ``^Z''.
-a reports all of the option settings;
-g reports current settings in a form that can be used as an argument
to another stty command; this does not include the rows and columns
Options in the last group are implemented using options in the previous
groups. Note that many combinations of options make no sense, but no
sanity checking is performed. The options are selected from the
Control Modes [Toc] [Back]
enable (disable) parity generation and detection.
select odd (even) parity.
cs5 cs6 cs7 cs8
select character size (see termio(7)).
0 hang up phone line immediately.
110 300 600 1200 1800 2400 4800 9600 19200 38400 57600 115200 etc.
Set terminal input and output baud rate to the number given, if
possible. (All speeds are not supported by all hardware
ispeed ( <speed> )
where speed is a baud rate as defined above, set only the input
baud rate to the given value, if possible (some hardware may
require the input and output baud rate to be the same). If the
speed specified is 0, set the input speed to match the output
ospeed ( <speed> )
where speed is a baud rate as defined above, set only the
output baud rate to the given value, if possible (some hardware
may require the input and output baud rate to be the same). If
the speed specified is 0, a hangup is generated.
hang up (do not hang up) serial-line connections on last close.
same as hupcl (-hupcl).
use two (one) stop bits per character.
enable (disable) the receiver.
assume a line without (with) modem control.
enable (disable) RTS/CTS flow control.
block (do not block) output from a background job.
block (do not block) output from a background job (same as
Input Modes [Toc] [Back]
ignore (do not ignore) break on input.
signal (do not signal) INTR on break.
ignore (do not ignore) parity errors.
mark (do not mark) parity errors (see termio(7)).
enable (disable) input parity checking.
strip (do not strip) input characters to seven bits.
map (do not map) NL to CR on input.
ignore (do not ignore) CR on input.
map (do not map) CR to NL on input.
map (do not map) upper-case alphabetics to lower case on input.
enable (disable) START/STOP output control. Output is stopped
by sending the stop character (default is CTRL-S) and started
by sending the start character (default is CTRL-Q).
allow any character (only the start character like CTRL-Q) to
allow only the start character like CTRL-Q (allow any
character) to restart output. An alias for -ixany.
request that the system send (not send) START/STOP characters
when the input queue is nearly empty/full.
echo BEL if the input stream overflows.
Output Modes [Toc] [Back]
post-process output (do not post-process output; ignore all
other output modes).
map (do not map) lower-case alphabetics to upper case on
map (do not map) NL to CR-NL on output.
map (do not map) CR to NL on output.
do not (do) output CRs at column zero.
on the terminal NL performs (does not perform) the CR function.
use fill characters (use timing) for delays.
fill characters are DELs (NULs).
cr0 cr1 cr2 cr3
select style of delay for carriage returns (see termio(7)).
nl0 nl1 select style of delay for line-feeds (see termio(7)).
tab0 tab1 tab2 tab3
select style of delay for horizontal tabs (see termio(7)).
bs0 bs1 select style of delay for backspaces (see termio(7)).
ff0 ff1 select style of delay for form-feeds (see termio(7)).
vt0 vt1 select style of delay for vertical tabs (see termio(7)).
Local Modes [Toc] [Back]
enable (disable) the checking of characters against the special
control characters INTR, QUIT and SWTCH.
enable (disable) canonical input (ERASE and KILL processing).
canonical (unprocessed) upper/lower-case presentation.
echo back (do not echo back) every character typed.
echo (do not echo) ERASE character as a backspace-spacebackspace
string. Note: this mode will erase the ERASEed
character on many CRT terminals; however, it does not keep
track of column position and, as a result, may be confusing on
escaped characters, tabs, and backspaces.
echo (do not echo) NL after KILL character.
the same as echok (-echok); obsolete.
echo (do not echo) the KILL character by erasing each character
on the line from the screen (using the mechanism selected by
echoe and echoprt).
Echo (do not echo) control characters as ^char, delete as ^?.
Echo (do not echo) erase character as character erased.
echo (do not echo) NL.
disable (enable) flush after INTR, QUIT or SWTCH.
If set, data written to the terminal is discarded. This bit is
automatically set when the flush/discard control-character (see
below) is typed. This bit is automatically cleared by
subsequent input from the terminal.
Retype pending input at next read or input char then
automatically clear pendin.
Control Assignments [Toc] [Back]
line i set the line discipline to 0 (standard System V discipline) or
1 (4.3BSD csh(1) discipline).
rows n set the number of rows for the terminal, used by some screen
oriented programs. This is currently supported only on pty
cols n (or columns) set the number of columns for the terminal, used
by some screen oriented programs. This is currently supported
only on pty devices.
set control-character to c, where control-character is intr,
quit, erase, eof, eol, old-swtch, min, or time. (min and time
are used with -icanon; see termio(7)). If line discipline is
set to 1, the following control-characters can be set: lnext,
werase, rprnt, flush (a.k.a. discard), stop, If c is preceded
by an (escaped from the shell) caret (^), then the value used
is the corresponding CTRL character (e.g., ``^D'' is a CTRL-D);
``^?'' is interpreted as DEL and ``^-'' or ``undef'' is
interpreted as undefined. In the case of min and time , the
numerical argument is interpreted as a literal value rather
than as an ascii character.
Combination Modes [Toc] [Back]
evenp or parity
enable parenb and cs7.
oddp enable parenb, cs7, and parodd.
-parity, -evenp, or -oddp
disable parenb, and set cs8.
raw (-raw or cooked)
enable (disable) raw input and output (no ERASE, KILL, INTR,
QUIT, SWTCH, EOT, or output post processing).
Enable (disable) any implementation-dependent special control
characters not currently controlled by icanon, isig, ixon or
nl (-nl) set (unset) icrnl. In addition -nl unsets inlcr, igncr.
set (unset) xcase, iuclc, and olcuc.
same as lcase (-lcase).
tabs (-tabs or tab3)
preserve (expand to spaces) tabs when printing.
ek reset ERASE and KILL characters back to normal ^H and ^U.
sane resets all modes to some reasonable values.
dec ERASE, KILL, and INTR characters set to ^?, ^U, and ^C; echoe
and echok set; ixany unset.
term set all modes suitable for the terminal type term, where term
is one of tty33, tty37, vt05, tn300, ti700, or tek.
tabs(1), ioctl(2), termio(7)
PPPPaaaaggggeeee 5555 [ Back ]