UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: stripChapter 2
UNIX Commands
Next: Reference: su


stty [options] [modes]

Set terminal I/O options for the current device. Without options, stty reports the terminal settings, where a ^ indicates the CONTROL key and ^` indicates a null value. Most modes can be switched using an optional - (shown in brackets). The corresponding description is also shown in brackets. As a privileged user, you can set or read settings from another device using the syntax:

stty [options] [modes] < device



Report all option settings.


Report current settings.

control modes


Hang up phone.


Set terminal baud rate to n (e.g., 2400).


[Enable]disable modem control.


[Disable]enable the receiver.


Select character size (5-8).


[One]two stop bits per character.


[Do not]hang up connection on last close.


Same as previous.

ispeed n

Set terminal input baud rate to n.


[Do not]block layer output.

ospeed n

Set terminal output baud rate to n.


[Disable]enable parity generation and detection.


[Disable]enable extended parity generation and detection for mark and space parity.


Use [even]odd parity.

Input modes


[Do not]signal INTR on break.


[Do not]map carriage return (^M) to newline (^J) on input.


[Do not]ignore break on input.


[Do not]ignore carriage return on input.


[Do not]ignore parity errors.


[Do not]echo BEL when input line is too long.


[Do not]map newline to carriage return on input.


[Disable]enable input parity checking.


[Do not]strip input characters to seven bits.


[Do not]map uppercase to lowercase on input.


Allow [XON]any character to restart output.


[Do not]send START/STOP characters when queue is nearly empty/full.


[Disable]enable START/STOP output control.


[Do not]mark parity errors.

Output modes


Select style of delay for backspaces (0 or 1).


Select style of delay for carriage returns (0-3).


Select style of delay for formfeeds (0 or 1).


Select style of delay for linefeeds (0 or 1).


[Do not]map carriage return to newline on output.


Set fill character to [NULL]DEL.


Delay output with [timing]fill characters.


[Do not]map lowercase to uppercase on output.


[Do not]map newline to carriage return-newline on output.


[Do not]perform carriage return after newline.


[Do not]output carriage returns at column zero.


[Do not]postprocess output; ignore all other output modes.


Select style of delay for horizontal tabs (0-3).


Select style of delay for vertical tabs (0 or 1).

Local modes


[Do not]echo every character typed.


[Do not]echo control characters as ^char, delete as ^?.


[Do not]echo ERASE character as BS-space-BS string.


[Do not]echo newline after KILL character.


[Do not]BS-SP-BS erase entire line on line kill.


[Do not]echo newline (^J).


[Do not]echo erase character as character is "erased."


Output is [not] being flushed.


[Disable]enable canonical input (ERASE and KILL processing).


[Disable]enable extended functions for input data.


[Disable]enable checking of characters against INTR, QUIT, and SWITCH.


[Enable]disable flush after INTR, QUIT, or SWITCH.


[Do not]retype pending input at next read or input character.


[Line]application mode on a synchronous line.


[Disable]enable flush on synchronous line.


[Enable]disable truncation on synchronous line.


[Do not]send SIGTTOU when background processes write to the terminal.


[Do not]change case on local output.

Control assignments

ctrl-char c

Set control character to c. ctrl-char is: ctab, discard, dsusp, eof, eol, eol2, erase, intr, kill, lnext, quit, reprint, start, stop, susp, swtch, werase.

min, time n

Set min or time to n.

line i

Set line discipline to i (1-126).

Combination modes


Set normal asynchronous communications.


Same as -raw.


Same as [-]parenb and cs[8]7.


Reset ERASE and KILL characters to # and @.


[Un]set xcase, iuclc, and olcuc.


Same as [-]lcase.


[Disable]enable parenb, parodd, and parext and set cs[8]7.


[Un]set icrnl and onlcr. -nl also unsets inlcr, igncr, ocrnl, and onlret.


Same as [-]parenb, [-]parodd, and cs7[8].


Same as [-]parenb and cs[8]7.


[Disable]enable raw input and output (no ERASE, KILL, INTR, QUIT, EOT, SWITCH, or output postprocessing).


Reset all modes to reasonable values.


[Disable]enable parenb and parext and set cs[8]7.


[Expand to spaces]preserve output tabs.


Set all modes suitable for terminal type term (tty33, tty37, vt05, tn300, ti700, or tek).

Hardware flow control modes


[Disable]enable RTS on input.


[Disable]enable CTS on output.


[Disable]enable DTR on input.


[Disable]enable CD on output.


[Disable]enable isochronous on input.

Clock modes


Get the transmit|receive clock from internal baud rate generator.


Get the transmit|receive clock from transmitter timing-lead, circuit 114, pin 15.


Get the transmit|receive clock from receiver timing-lead, circuit 115, pin 17.

For modes beginning with t, pin is transmitter timing-lead, circuit 113, pin 24. For modes beginning with r, pin is receiver timing-lead, circuit 128, no pin.


No transmitter|receiver timing clock.


Send receive baud rate generator to pin.


Send transmit baud rate generator to pin.


Send transmitter timing to pin.


Send receiver timing to pin.

Window size

columns n

Set size to n columns.

rows n

Set size to n rows.

xpixels n

Set size to n pixels across.

ypixels n

Set size to n pixels up and down.

Previous: Reference: stripUNIX in a Nutshell: System V EditionNext: Reference: su
Reference: stripBook IndexReference: su

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System