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

Docker installation and configuration steps for MySQL

Table of contents Preface environment Install Cre...

TypeScript installation and use and basic data types

The first step is to install TypeScript globally ...

Grid systems in web design

Formation of the grid system In 1692, the newly c...

How to install ROS Noetic in Ubuntu 20.04

Disclaimer: Since the project requires the use of...

How to download excel stream files and set download file name in vue

Table of contents Overview 1. Download via URL 2....

Two ways to specify the character set of the html page

1. Two ways to specify the character set of the h...

mysql solves the problem of finding records where two or more fields are NULL

Core code /*-------------------------------- Find...

Teach you how to use AWS server resources for free

AWS - Amazon's cloud computing service platfo...

Detailed explanation of the solution to permission denied in Linux

Permission denied: The reason for this is: there ...

How to set the width attribute to the style of the span tag

If you directly set the width attribute to the sty...

MySQL Server IO 100% Analysis and Optimization Solution

Preface During the stress test, if the most direc...

Detailed explanation of how to install MySQL on Alibaba Cloud

As a lightweight open source database, MySQL is w...

The difference between ID and Name attributes of HTML elements

Today I am a little confused about <a href=&quo...