Home  >  Article  >  Operation and Maintenance  >  what is linux terminal

what is linux terminal

(*-*)浩
(*-*)浩Original
2019-12-11 13:34:526635browse

what is linux terminal

##pty (virtual terminal or pseudo terminal):                                                                                                                                                                   When we remotely telnet to the host or use xterm, don’t we also need a terminal for interaction? Yes, this is the virtual terminal pty (pseudo-tty).

tty (general name for terminal equipment):

The word tty originates from Teletypes, or teletypewriters, which originally refers to teletypewriters, which are passed through a serial line using a printer keyboard A device for reading and sending messages was later replaced by a keyboard and a monitor, so now it is more appropriately called a terminal.

The terminal is a character-type device, which comes in many types. tty is usually used to refer to various types of terminal devices.

Terminal (Terminal): Corresponds to the /dev/tty device on Linux. Multi-user login in Linux is completed through different /dev/tty devices.

In the device special file directory /dev/ of the Linux system, the terminal special device files generally include the following types:

1. String Serial Port Terminal (/dev/ttySn)

Serial Port Terminal is a terminal device connected using a computer's 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 biggest use at that time was to connect to 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 ( 4,0), (4,1), etc., respectively correspond to COM1, COM2, etc. under the DOS system.

To send data to a port, you can redirect the standard output to these special file names on the command line! ! ! !

For example, typing at the command line prompt: echo test > /dev/ttyS1 will send the word "test" to the device connected to the ttyS1 (COM2) port. Can be connected to the serial port for verification.

2. Pseudo terminal (/dev/pty/)

Pseudo Terminal (Pseudo Terminal) is a pair of logical terminal devices (ie master and slave) equipment, operations on the master will be reflected on the slave).

For example, /dev/ptyp3 and /dev/ttyp3 (or /dev/pty/m3 and /dev/pty/s3 respectively in the device file system), they are not directly related to the actual physical device! ! ! !!

3. Control terminal (/dev/tty)

If the current process has a controlling terminal (Controlling Terminal), then /dev/tty is the current process Device special files for controlling terminals. You can use the command "ps -ax" to see which control terminal the process is connected to.

For the shell you log in to, /dev/tty is the terminal you use, and the device number is (5,0). Use the command "tty" to see which actual terminal 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, the computer monitor is usually called the console terminal (Console )! ! ! !

The above is the detailed content of what is linux terminal. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn