LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

stty

Display and change terminal line settings

TLDR

Show all settings
$ stty -a
copy
Show settings for device
$ stty -a -F [/dev/ttyUSB0]
copy
Set baud rate
$ stty -F [/dev/ttyUSB0] [115200]
copy
Disable echo
$ stty -echo
copy
Enable raw mode
$ stty raw
copy
Reset to sane defaults
$ stty sane
copy
Set terminal size
$ stty rows [24] cols [80]
copy

SYNOPSIS

stty [options] [settings...]

DESCRIPTION

stty displays or changes terminal line settings. It controls various aspects of terminal I/O including baud rate, character processing, and signal handling.The tool is essential for configuring serial ports and customizing terminal behavior.

PARAMETERS

-a, --all

Print all settings.
-g, --save
Print in stty-readable form.
-F device, --file=device
Open and use the specified device instead of stdin.
sane
Reset to sane values.
raw
Raw mode (no processing).
cooked
Normal mode (opposite of raw).
echo / -echo
Enable/disable echoing of input characters.
rows n
Set terminal rows.
cols n
Set terminal columns.
ispeed n
Set input baud rate.
ospeed n
Set output baud rate.
ixon / -ixon
Enable/disable START/STOP output control.
ixoff / -ixoff
Enable/disable sending of START/STOP characters.
crtscts / -crtscts
Enable/disable RTS/CTS hardware flow control.
cstopb / -cstopb
Use two stop bits per character (one with '-').

CAVEATS

Settings affect current terminal. Some require appropriate privileges. Raw mode disables many features. Changes may not persist.

HISTORY

stty (set tty) is a traditional Unix utility dating back to early Unix versions. It remains essential for serial communication and terminal configuration.

SEE ALSO

tty(1), setserial(8), getty(8), reset(1)

Copied to clipboard
Kai