O'Reilly logo

Linux in a Nutshell, Fourth Edition by Aaron Weber, Stephen Figgins, Ellen Siever

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

stty

Synopsis

                  stty [options] [modes]

Set terminal I/O options for the current standard input device. Without options, stty reports the terminal settings that differ from those set by running stty sane, where ^ indicates the Ctrl key and ^` indicates a null value. Most modes can be negated using an optional - (shown in brackets). The corresponding description is also shown in brackets. Some arguments use non-POSIX extensions; these are marked with *.

Options

-a, --all

Report all option settings.

-F, --device

Open the specified device and use it instead of standard input.

-g, --save

Report settings in stty-readable form (i.e., hex).

--help

Print help message and exit.

--version

Print version information and exit.

Control modes

n

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

[-]clocal

[Enable] disable modem control.

[-]cread

[Disable] enable the receiver.

[-]crtscts*

[Disable] enable RTS/CTS handshaking.

cs bits

Set character size to bits, which must be 5, 6, 7, or 8.

[-]cstopb

[1] 2 stop bits per character.

[-]hup

[Do not] hang up connection on last close.

[-]hupcl

Same as previous.

ispeed n

Set terminal input baud rate to n.

ospeed n

Set terminal output baud rate to n.

[-]parenb

[Disable] enable parity generation and detection.

[-]parodd

Use [even] odd parity.

Flow control modes

The following flow control modes are available by combining the ortsfl, ctsflow, and rtsflow flags:

Flag settings

Flow control mode

ortsfl rtsflow ctsflow

Enable unidirectional flow control.

ortsfl ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required