O'Reilly logo

Mac OS X in a Nutshell by Chris Stone, Chuck Toporek, Jason McIntosh

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 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 preceding - (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

stty is one of the most complicated Unix commands. The complexity stems from the need to deal with a large range of conflicting, incompatible, and nonstandardized terminal devices—everything from printing teletypes to CRTs to pseudoterminals for windowing systems. Only a few of the options are really needed for day-to-day use. stty sane is a particularly valuable one to remember.

Options

-a

Report all option settings.

-e

Report current settings in BSD format.

-f file

Use file instead of standard input.

-g

Report current settings in stty format.

Control modes

0

Hang up connection (set the baud rate to zero).

n

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

[-]clocal

[Enable] disable modem control.

[-]cread

[Disable] enable the receiver.

[-]crtscts

[Disable] enable output hardware flow control using RTS/CTS.

csn

Select character size in bits (5 n 8).

[-]cstopb

[One] two stop bits per character.

[-]hup

[Do not] hang up connection on last close.

[-]hupcl

Same as [-]hup.

ispeed n

Set terminal input baud rate to n.

[-]loblk

[Do not] ...

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