Many of these settings only apply to legacy terminals using low speed modems with dial-up connections and do not
apply to ssh
or telnet
connections over a network.
Without arguments, displays baud rate, line discipline, and deviations from stty sane
.
For example:
speed 9600 baud; lflags: echoe echoke echoctl pendin iflags: iutf8 oflags: -oxtabs cflags: cs8 -parenb
Linux> stty -a speed 9600 baud; rows 33; columns 132; line = 0; intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = - before SETTING indicates negation. non-POSIX are in this font/color The underlying system defines which settings are available. Special characters:
Special settings:
Control settings:[-]clocal disable modem control signals [-]cread allow input to be received [-]crtscts enable RTS/CTS handshaking (disables DTR/DSR) [-]cdtrdsr enable DTR/DSR handshaking (disables RTS/CTS), no stty readable form available, has to be supported by device csN set character size to N bits, N in [5..8] [-]cstopb use two stop bits per character (one with `-') [-]parenb generate parity bit in output and expect parity bit in input [-]parodd set odd parity (even with `-') [-]hup send a hangup signal when the last process closes the tty [-]hupcl same as [-]hup Input settings: [-]brkint breaks cause an interrupt signal [-]icrnl translate carriage return to newline [-]ignbrk ignore break characters [-]igncr ignore carriage return [-]ignpar ignore characters with parity errors [-]imaxbel beep and do not flush a full input buffer on a character [-]inlcr translate newline to carriage return [-]inpck enable input parity checking [-]istrip clear high (8th) bit of input characters [-]iutf8 assume input characters are UTF-8 encoded [-]iuclc translate uppercase characters to lowercase [-]ixany let any character restart output, not only start character [-]ixoff enable sending of start/stop characters [-]ixon enable XON/XOFF flow control [-]parmrk mark parity errors (with a 255-0-character sequence) [-]tandem same as [-]ixoff Output settings: (the delays are for printing terminals without a buffer) bsN backspace delay style, N in [0..1] crN carriage return delay style, N in [0..3] ffN form feed delay style, N in [0..1] nlN newline delay style, N in [0..1] tabN horizontal tab delay style, N in [0..3] tabs same as tab0 -tabs same as tab3 vtN vertical tab delay style, N in [0..1] [-]ocrnl translate carriage return to newline [-]ofdel use delete characters for fill instead of null characters [-]ofill use fill (padding) characters instead of timing for delays [-]olcuc translate lowercase characters to uppercase [-]onlcr translate newline to carriage return-newline [-]onlret newline performs a carriage return [-]onocr do not display carriage returns in the first column [-]opost postprocess output Local settings: |
[-]LCASE [-]lcase cbreak -icanon -cbreak icanon crt echoe echoctl echoke dec echoe echoctl echoke -ixany intr ^c erase 0177 kill ^u [-]decctlq [-]ixany ek erase and kill characters to their default values evenp parenb -parodd cs7 -evenp -parenb cs8 [-]lcase xcase iuclc olcuc litout -parenb -istrip -opost cs8 -litout parenb istrip opost cs7 nl -icrnl -onlcr -nl icrnl -inlcr -igncr onlcr -ocrnl -onlret oddp parenb parodd cs7 -oddp -parenb cs8 [-]parity [-]evenp pass8 -parenb -istrip cs8 -pass8 parenb istrip cs7 cooked brkint ignpar istrip icrnl ixon opost isig icanon, eof and eol characters to their default values -cooked raw raw -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -opost -isig -icanon -xcase min 1 time 0 -raw cooked sane cread -ignbrk brkint -inlcr -igncr icrnl -iutf8 -ixoff -iuclc -ixany imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke, all special characters to their default values.Handle the tty line connected to standard input.
BSD | solaris |
stty -- set the options for a terminal device interface
stty [-a | -e | -g] [-f file]
[operands ]
Sets or displays on terminal characteristics for the device that is its standard input.
Editor note: Many of these apply to terminals remotely connected serial communication lines
and are not applicatable to console .
Most interesting operatnds which do apply to CONSOLE are:
|
If no options or operands are specified, it reports the settings of a subset of characteristics as well as additional ones if they differ from their default values.
speed 9600 baud; lflags: echoe echoke echoctl pendin oflags: -oxtabs cflags: cs8 -parenb
-a
stty all|everything
Reports all the terminal modes as with stty -a
, except that the control characters are displayed in a columnar format.
speed 9600 baud; 30 rows; 110 columns; lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo -extproc iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -iutf8 -ignbrk brkint -inpck -ignpar -parmrk oflags: opost onlcr -oxtabs -onocr -onlret cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow -dtrflow -mdmbuf cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = |
-e
all
formatspeed 9600 baud; 30 rows; 110 columns; lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl -echoprt -altwerase -noflsh -tostop -flusho pendin -nokerninfo -extproc iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -iutf8 -ignbrk brkint -inpck -ignpar -parmrk oflags: opost onlcr -oxtabs -onocr -onlret cflags: cread cs8 -parenb -parodd hupcl -clocal -cstopb -crtscts -dsrflow -dtrflow -mdmbuf discard dsusp eof eol eol2 erase intr kill lnext ^O ^Y ^D |
-f
Open and use the terminal named by file rather than using standard input. The file is
opened using the O_NONBLOCK flag of open(, making it possible to set or display settings on a terminal that might otherwise block on the open.
-g
Display all the current settings for the terminal to standard output in a form that
may be used as an argument to a subsequent invocation of stty to restore the current
terminal state as per IEEE Std 1003.2 (``POSIX.2''.
gfmt1:cflag=4b00:iflag=2b02:lflag=200005cb:oflag=3:discard=f:dsusp=19:eof=4:eol=ff:Control Modes:
eol2=ff:erase=7f:intr=3:kill=15:lnext=16:min=1:quit=1c:redisplay=12:start=11:status=14:stop=13:
susp=1a:time=0:werase=17:ispeed=9600:ospeed=9600i
c_cflag
in the termios
structure.
nnnn |