In the Linux system device special file directory/dev/, terminal Special equipment files generally have the following:
1. Serial port terminal (/DEV/TTYSN)
The serial port terminal (Serial Port Terminal) is a terminal device connected using a computer serial port. The computer sees each serial port as a character device. For a while these serial port devices are often referred to as end-device, because it is used to connect the terminal at that time. The serial port corresponding to the device name is/dev/tts/0 (or/DEV/TTYS0),/DEV/TTS/1 (or/dev/ttys1), etc., the device number is (4,0), (4,1), respectively, corresponding to the DOS system COM1, COM2 and so on. To send data to a port, you can redirect standard output to these special file names on the command line. For example, at the command-line prompt, type: Echo Test >/dev/ttys1 will send the word "test" to the device connected to the TtyS1 (COM2) port.
For example/DEV/PTYP3 and/DEV/TTYP3 (or/dev/pty/m3 and/dev/pty/in device file systems, respectively) S3). They are not directly related to the actual physical device. If a program considers PTYP3 (master device) as a serial port device, its read/write operation on that port is reflected on the other TTYP3 (slave device) corresponding to the logical terminal. The TTYP3 is a logical device that another program uses for read and write operations. Telnet Host A is to communicate with host A's login program through "Pseudo Terminal".
3, control terminal (/dev/tty)
5 Virtual terminal (/dev/pts/n)
Pseudo terminal in Xwindows mode. If I use Konsole under Kubuntu, I use the virtual terminal, and I can see/DEV/PTS/1 with the TTY command.
6 Other types
The Linux system also has many other kinds of terminal equipment special files for many different character devices. For example,/dev/ttyin terminal equipment for ISDN devices. Don't repeat it here.
TTY devices include virtual consoles, serial ports, and pseudo-terminal units.
/dev/tty represents the current TTY device and enters echo "Hello" >/dev/tty in the current terminal, which is displayed directly in the current terminal.
Terminal special device files for Linux systems