In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
There are many commands in UNIX system, so let's explain stty. This command is a common command used to change and print terminal line settings.
1. The stty (set tty, set tty) command is used to check and modify the communication parameters of the currently registered terminal.
The UNIX system provides an important control means for the input of the keyboard and the output of the terminal. Options can be set for specific terminals or communication lines through stty commands.
You can use-an in the stty command to view the settings of the currently registered terminal.
$stty-a
Speed 9600 baud; line = 0 TX intro = DEL;quit = ^; erase = ^ hte kill = ^ U; eof = ^ dittStart = ^ Q; stop= ^ s
-parenb-parodd cs8-cstopb-hupcl cread-clocal-loblk
-ignbrk brkint ignpar-parmrk-inpck istrip-inlcr-igncr icrnl-iuclc
Ixon ixany-ixoff
Isig icanon-xcase echo echoe echok-echonl-noflsh
Opost-olcuc onlcr-ocrnl-onocr onlret ofill ofdel tab3
The various options shown here can be reconfigured when needed. Each terminal option has its own name (such as ixon), most of which are either set or cleared. In stty, the corresponding option is preceded by a negative sign (-), which is cleared (disabled); if there is no negative sign, this option is set.
When you want to modify the values of each selection, you should correctly write the corresponding options in the stty command. As ordered
$stty-ixon
Set the flow control to OFF, and the command
$stty ixon
Then set it to ON. Multiple options can be set simultaneously in the stty command:
$stty ixon 1200
This command sets the terminal to 1200 baud and the flow control to ON.
When the list of options is long, you should be careful that your changes cause confusion in the session. Typically, the terminal does not work at all when it is set up incorrectly. It often occurs that the column output is displayed or the user's keystrokes are not correctly accepted by shell. Sometimes the NEWLINE may only display or walk one line but not return the line, that is, the NEWLINE character entered by the user cannot be read correctly by shell. The process of establishing a new registration identity usually establishes the correct stty options and rarely needs to be modified in daily use. However, if the variable TERM is not set correctly or the user wants to use a new terminal or communication channel (such as a local area network), you need to modify the option of stty.
If you register with a machine and the terminal operates normally, but then for some reason there is confusion, then the best solution is to log out and then register with the system. Because the system will reset the appropriate options when registering. Another less stringent solution is:
$stty sane
The command sane appears most often in the collection of stty options for most terminals. It does not change the rate of the communication channel, but it can usually produce beneficial results when the terminal is confused. The command sane may prevent full-screen applications such as vi from working correctly, and after setting the option sane, if you can't solve any problems, you should log out immediately and register again. If the terminal still does not work correctly after registration, the user registration may not be successful.
If the terminal is confused and the NEWLINE key cannot end the command line, you can use CTRL-J instead of NEWLINE until the user executes stty sane. At this point, terminate the stty sane with CTRL-J to return the system to normal.
Several main option functions of the stty command are:
The option parenb causes the terminal to perform parity, while-parenb forbids parity
The options cs5, cs6, cs7, and cs8 set the character size to 5, 6, 7, and 8 bits, respectively
Options 300,600,1200, 2400, 4800, 9600 and 19200 to set the baud rate
Cstopb and-cstopb set two or one stop bit respectively
Tabs causes the system to use tabs instead of space sequences, thus reducing output, and the option-tabs uses only spaces, which should be used when the terminal does not handle tabs (tab) correctly.
2. Stty can also be used to control some keys with special control functions.
1) under the command line, the method of outputting uppercase is prohibited
Stty iuclc # enabled
Stty-iuclc # recovery
2) disable lowercase output on the command line
Stty olcuc # enabled
Stty-olcuc# recovery
3) print out the number of rows and columns of the terminal
Stty size
4) the method of changing ctrl+D:
The system may already use CTRL-D as the file Terminator, but you may like to use CTRL-C.
Stty eof "string"
Such as: $stty eof ^ c
Press CTRL-C and it displays as ^ c. You can enter control characters directly, preceded by a backslash and a delimited character (^). The system defaults to ctrl+D to represent the end of the file, which can be changed in this way!
5) screen display
Stty-echo # forbids echo
Stty echo # Open Echo
Test method:
Stty-echo;read;stty echo;read
6) ignore carriage return
Stty igncr # enabled
Stty-igncr# recovery
7) resume using the Backspace key
$stty erase ^ h
Note: press Backspace and ^ h appears.
The solaris system does not support Backspace by default, so it can be used normally after changing with this command, which is much more convenient.
8) you can set a session period so that when you type a backspace key, the system responds with backspace, delete, and backspace sequences. At this point, you can see that the characters covered with the Backspace key disappear from the display, which is more in line with the computer convention. Use the command
$stty echo
You can set this feature to ON.
Terminal mode and its management is one of the difficult contents in UNIX system. There is a full list of stty options in the user manual of the system. Before you try, you should consult the manual and analyze it carefully so as not to cause trouble to your work.
For the oracle video tutorial, please follow: http://u.youku.com/user_video/id_UMzAzMjkxMjE2.html
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.