In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
What are the terminal device files under the Linux system? I believe many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Terminal is a kind of character device, which has many types, and tty is usually used to refer to various types of terminal devices.
Under the device special file directory / dev/ of the Linux system, there are generally the following types of terminal special device files:
1. Serial port terminal (/ dev/ttySn)
A serial port terminal (Serial Port Terminal) is a terminal device connected using a computer serial port. The computer treats each serial port as a character device. There was a time when these serial port devices were often called terminal devices because their greatest use at that time was to connect terminals. The device names corresponding to these serial ports are / dev/tts/0 (or / dev/ttyS0), / dev/tts/1 (or / dev/ttyS1), etc., and the device numbers are (4je 0), (4je 1), etc., respectively, corresponding to COM1 and COM2 under the DOS system. To send data to a port, you can redirect standard output to these special file names on the command line. For example, typing: echo test > / dev/ttyS1 at the command line prompt sends the word "test" to the device connected to the ttyS1 (COM2) port.
2. Pseudo terminal (/ dev/pty/)
Pseudo terminals (Pseudo Terminal) are pairs of logical end devices (that is, master and slave devices, and operations on master are reflected on the slave).
For example, / dev/ptyp3 and / dev/ttyp3 (or / dev/pty/ m3 and / dev/pty/s3 in the device file system, respectively). They are not directly related to the actual physical equipment. If a program treats ptyp3 (master device) as a serial port device, its read / write operations to that port will be reflected in another ttyp3 (slave device) corresponding to the logical terminal device. Ttyp3 is the logical device used by another program to read and write. Telnet host A communicates with host A through the login program of "pseudo terminal".
3. Control terminal (/ dev/tty)
If the current process has a control terminal (Controlling Terminal), then / dev/tty is the device special file of the control terminal of the current process. You can use the command "ps-ax" to see which control terminal the process is connected to. For the shell,/dev/tty you are logged in to is the terminal you are using, the device number is (5pc0). Use the command "tty" to see which actual end device it corresponds to. / dev/tty is somewhat similar to a connection to the actual terminal device used.
4. Console terminal (/ dev/ttyn, / dev/console)
In Linux systems, computer monitors are often called console terminals (Console). It simulates a terminal (TERM=Linux) of type Linux and has some device-specific files associated with it: tty0, tty1, tty2, and so on. When you log in on the console, you are using tty1. When using the Alt+ [F1-F6] key combination, we can switch to tty2, tty3, etc. Tty1-tty6 and so on are called virtual terminals, and tty0 is an alias of the currently used virtual terminals, and the information generated by the system will be sent to the terminal (also called console terminal at this time). Therefore, no matter which virtual terminal is currently in use, the system information will be sent to the console terminal. / dev/console is the console, which is a device that interacts with the operating system, and the system outputs some information directly to the console. Currently, users are allowed to log on to the console only in single-user mode.
5 Virtual Terminal (/ dev/pts/n)
Pseudo terminal in Xwindow mode. If you use konsole under Kubuntu, you are using a virtual terminal. You can see / dev/pts/name with the tty command, and name is the current user name.
6 other types
There are also many other kinds of terminal device special files for many different character devices in the Linux system. For example, / dev/ttyIn terminal devices for ISDN devices and the like.
Tty devices include virtual console, serial port and pseudo terminal devices.
/ dev/tty represents the current tty device. Typing echo "hello" > / dev/tty in the current terminal will be displayed directly in the current terminal.
Text Telephones (TTY)
Deaf-mute phone, support to send and receive text after the mobile phone is plugged into a special device, network support is required.
In addition to the deaf-mute mode, it also supports two modes: HCO and VCO.
After reading the above, have you mastered the methods of terminal equipment files under the Linux system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.