Linux uses stty to display and modify terminal line settings

Linux uses stty to display and modify terminal line settings

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

1. Parameters:

1. Print terminal line settings

-a, --all Print all current settings in human-readable form; the -a parameter prints more detailed terminal information than the stty command alone.

-g, --save Print all current settings in a stty-readable format

-F, --file=DEVICE Open and use the specified device (DEVICE) instead of standard input (stdin)

--help show help and exit

--version display version and exit

2. Usage

1. stty size prints the number of rows and columns of the terminal

2. Disable lowercase output in the command line

stty olcuc #Open
stty -olcuc#Restore

3. Print the number of rows and columns of the terminal

stty size

4. Change the method of ctrl+D:

stty eof "string"

The system defaults to ctrl+D to indicate the end of the file, but this method can change it!

5. Shield display

stty -echo #Disable echo
stty echo #Open echo

Test Method:

stty -echo;read;stty echo;read

6. Ignore carriage return

stty igncr # enable
stty -igncr#Restore

7. Use it to set our serial port printing operation information.

stty -F /dev/ttyS0 speed 115200 cs8 -parenb -cstopb -echo

Explanation: Use stty to set the /dev/ttyS0 serial port, baud rate to 115200, data bit to cs8, parity bit to -parenb, stop bit to -cstopb, and -echo to disable terminal echo.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Commands to find domain IP address in Linux terminal (five methods)
  • Detailed explanation of how to use socks5 proxy for Linux terminal
  • Android's implementation method of executing shell scripts in the Linux terminal to directly print the log of the currently running app
  • How to use Shell script to get terminal width in Linux
  • Get a list of your top 10 most frequently used terminal commands in Linux
  • Two tools for splitting the screen in the Linux command line terminal
  • Two methods of terminal split screen under Linux (screen and tmux)
  • Detailed explanation of commonly used shortcut keys for Linux terminal command line
  • How to exit the Python command line in the Linux terminal

<<:  How to connect to MySQL remotely through Navicat

>>:  Understand the usage of Vue2.x and Vue3.x custom instructions and the principle of hook functions

Recommend

How to implement vertical text alignment with CSS (Summary)

The default arrangement of text in HTML is horizo...

MySQL uses custom functions to recursively query parent ID or child ID

background: In MySQL, if there is a limited level...

A friendly alternative to find in Linux (fd command)

The fd command provides a simple and straightforw...

Various front-end printing methods of web: CSS controls web page printing style

CSS controls the printing style of web pages : Use...

Installing Win10 system on VMware workstation 14 pro

This article introduces how to install the system...

Vue3.0 implements encapsulation of checkbox components

This article example shares the specific code of ...

avue-crud implementation example of multi-level complex dynamic header

Table of contents Preface Background data splicin...

In html table, set different colors and widths for each cell

It is recommended that you do not set the width, h...

SELinux Getting Started

Back in the Kernel 2.6 era, a new security system...

JavaScript Objects (details)

Table of contents JavaScript Objects 1. Definitio...

Cleverly use CSS3's webkit-box-reflect to achieve various dynamic effects

In an article a long time ago, I talked about the...

Solution to Tomcat server failing to open tomcat7w.exe

I encountered a little problem when configuring t...

Detailed explanation of Vue's ref attribute

Summarize This article ends here. I hope it can b...