Home » Linux » Stty - Linux command to display and modify setting...

Stty - Linux command to display and modify settings for terminal

stty is a common command for changing and printing terminal settings under Linux.

1, parameter:

1. print terminal line set

-a, --all prints all current settings in a human readable manner; the -a parameter is more detailed than the terminal information output from a separate stty command

-g, --save prints all current settings
in a stty readable manner

-F, --file=DEVICE opens and uses a specific device (DEVICE) instead of the standard input (stdin)

--help displays help and exits

--version displays the version and exits

two: usage

1.stty size print terminal rows and columns

2, the lower case
is prohibited under the command line
Stty olcuc # open

Stty -olcuc# restores

3, print out the number of rows and columns of the terminal

Stty size

4, change the ctrl+D approach:

Stty EOF, "string",

The system defaults to ctrl+D to indicate the end of the file, and in this way you can change

5, shielding display

Stty -echo # ban back

Stty echo # open back

Test method:

Stty -echo; read; stty echo; read

6, ignore carriage return

Stty igncr # open

Stty -igncr# restores

7. Use it to set up our serial print operation information.

Stty, -F, /dev/ttyS0, speed,, CS8, -echo
, -parenb, -cstopb,...
Interpretation: the /dev/ttyS0 serial port is set by stty, the baud rate is 115200, the data bits CS8, parity bit -parenb, stop bit -cstopb, and at the same time, the -echo prohibits the terminal to display.

copyright notice: This article is original article for blogger. Without permission from blogger,.

must not be reprinted