stty
Display and change terminal line settings
TLDR
Show all settings
$ stty -a
Show settings for device$ stty -a -F [/dev/ttyUSB0]
Set baud rate$ stty -F [/dev/ttyUSB0] [115200]
Disable echo$ stty -echo
Enable raw mode$ stty raw
Reset to sane defaults$ stty sane
Set terminal size$ stty rows [24] cols [80]
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.
