Linux command, stty command is mainly used to print or modify the terminal settings, plus various parameters can achieve different functions, the following small series will be for the stty command in Linux application for everyone to do A brief introduction, I hope to provide some help to friends who do not understand.
1, the command line, output prohibiting uppercase method
stty -icanon read operation is provided disposable, such as using getchar () reads without pressing enter < Br>
stty icanon cancel the above settings
stty -a view information
stty -echo set command is not displayed
stty echo cancels no display
stty raw -echo
stty raw echo
stty iuclc #开启
stty -iuclc #restore
2, prohibited at the command line Output lowercase
stty olcuc #开启
stty -olcuc#recover
3, print out the number of rows and columns of the terminal
stty size
4, change the ctrl+D method:
stty eof “string”
The system default is ctrl+D to indicate the end of the file, and by this method, change!
5, shield display
stty -echo # disable echo
stty echo #open echo
Test method:
Stty -echo;read;stty echo;read
6. Ignore carriage returns
stty igncr #开启
stty -igncr#recover
7 Timed input
timeout_read()
{
timeout=$1
old_stty_settings=`stty -g` #save current settings
stty -icanon min 0 time 100 #set 10seconds,not 100seconds
eval read varname #=read $varname
stty “$old_stty_settings” #recover settings
}
The simpler way is to use the -t option of the read command
read -t 10 varname
The above is the way to use the stty command on Linux. By stty command you You can make various settings for the terminal, such as prohibiting input of uppercase letters, ignoring carriage returns, etc., and practicing these to grasp these usages.
FreeBSD is a UNIX-like operating system, and there is a certain difference between UNIX and UNIX sys
AIX is a UNIX-like operating system, and hacmp is a control application for AIX systems. When AIX su
In the previous tutorial, we mentioned that using the top, vmstat and other command
When the name of the folder has a space, it can be easily deleted under Windows. Ho
How to use the read command under Linux
Common usage summary of free commands under Linux
Linux installation GBK/GB2312 program shows garbled how to do?
How to solve the error when modifying the Locale in the Ubuntu system?
How Linux uses the alias command
How does the Linux system redirect data streams?
How Linux uses Sysdig to troubleshoot system faults
Ubuntu system to change the terminal user name to red skills
What should I do if the Linux system Git cannot exit completely (exit code 128 or 1)?
Ubuntu defragmentation command summary
Linux ls command operation example summary
What should I do if the Java process under Linux system disappears without cause?
Microsoft's experience gained through win7 system
T220 G5B SCSI module fan bad alarm sound how to close
Win10 system restores the traditional Win7 control panel method
Win10 closes the notification center operation method
What is the process of peeradapter.exe? Win7 closes the peerader.exe process steps
Win7 can not identify the usb device how to do
Win 8 hard drive no solution for install.wim file
How win7 network discovery function improves computer security
How to delete the system in the computer?
Win7 desktop can not be automatically refreshed need to press F5 button how to do