Linux terminal type, linux terminal

Source: Internet
Author: User

Linux terminal type, linux terminal

Unix is a multi-user and multi-task operating system. Early computers were expensive, so cheap devices were used to connect to the computer (no keyboard or display was available at the time, paper tapes and cards were used for input and output) to use the operating system, this cheap device is a terminal, which can also be considered as a console. Therefore, the computer itself can be considered as a console terminal, and the cheap connection device is a physical terminal pty.

Linux is a unix-like system, so it also inherits the features of the terminal. However, the computer gradually became cheaper and the display and keyboard appeared. Therefore, the keyboard can be used as the input terminal and the display as the output terminal. These terminals are virtual terminals, and the virtual terminal is actually the virtual console, or a virtual device.

Linux provides many virtual terminals, represented by ttyN. You can use Ctrl + Alt + F [1-6] to switch between virtual terminals, these Terminal devices are recorded in the/dev/directory.

[root@xuexi ~]# ls /dev/ttytty    tty12  tty17  tty21  tty26  tty30  tty35  tty4   tty44  tty49  tty53  tty58  tty62  ttyS0 tty0   tty13  tty18  tty22  tty27  tty31  tty36  tty40  tty45  tty5   tty54  tty59  tty63  ttyS1 tty1   tty14  tty19  tty23  tty28  tty32  tty37  tty41  tty46  tty50  tty55  tty6   tty7   ttyS2 tty10  tty15  tty2   tty24  tty29  tty33  tty38  tty42  tty47  tty51  tty56  tty60  tty8   ttyS3 tty11  tty16  tty20  tty25  tty3   tty34  tty39  tty43  tty48  tty52  tty57  tty61  tty9

Tty is a virtual terminal. CTRL + ALT + F1 indicates that the terminal is switched to the tty1 terminal, and ctrl + alt + f2 indicates that the terminal is switched to the tty2 terminal, generally, only ctrl + alt + f [1-6] can be switched between the six terminals in Linux. Two special terminals are tty and tty0. tty indicates the terminals currently in use, and tty0 indicates all activated virtual terminals. There is also a ttySN, which represents a serial terminal.

Also, terminals connected from the network, such as ssh or telnet, or command line Terminals opened from graphical virtual terminals are called pseudo terminals, expressed by pts/N, the corresponding device is the value N file in the/dev/pts directory.

[root@xuexi ~]# ls /dev/pts/0     ptmx 

0 indicates the first Pseudo Terminal, and 1 indicates the second Pseudo Terminal.

The management of a Pseudo Terminal is different from that of all other terminals. It is managed by a program connected to a computer. For example, for an ssh connection, ssh is responsible for requesting Pseudo Terminal resources, enter the user name and password. If the ssh connection process is killed, the Pseudo Terminal also exits.

In addition, some authenticated programs do not necessarily allocate terminals to connections. For example, when sudo ssh is executed, sudo does not necessarily allocate pseudo terminals to ssh.

In modern Linux, the console terminal has a different meaning from the original one. Its device is mapped to/dev/console, and all kernel output information is output to the console terminal, other user programs output information to virtual terminals or pseudo terminals.

Summary:

/Dev/console: console Terminal

/Dev/ttyN: virtual terminal. ctrl + alt + f [1-6] switches to virtual terminal.

/Dev/ttySN: Serial Terminal

/Dev/pts/N: A Pseudo Terminal. ssh or other tools are used to connect to the command line terminal opened in the previous live graphics terminal.

 

Back to series article outline: http://www.cnblogs.com/f-ck-need-u/p/7048359.html

Reprinted please indicate the source: http://www.cnblogs.com/f-ck-need-u/p/7099578.html

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.