Terminal and console in linux0.11

Source: Internet
Author: User
Terminal and console in linux0.11-general Linux technology-Linux programming and kernel information. The following is a detailed description. I. Historical differences between the console and the terminal
(1) Terminal
1. As we all know, a computer was generally used by multiple people at the same time because it was expensive.
Two computers need to be connected to many keyboards and monitors for use by multiple people.
3 In the past, this kind of equipment was dedicated to connecting to a computer. Only the display and keyboard, as well as a simple processing circuit, was not capable of processing computer information, he is responsible for connecting to a normal computer (usually through a serial port), then logging on to the computer and performing operations on the computer.

4. A device that can only connect to a computer through a display or keyboard through a serial port is called a terminal. It is a device connected to a host through cables, networks, and so on.

(2) Console
1. the console is a table that directly controls the device.
2. In a computer, the keyboard and display that are directly connected to the computer are called the console, which is a native device directly connected to the computer.
Note: The difference between a terminal and a terminal is that the terminal is connected through a serial port, not a computer, but a console is a computer, and a computer has only one console.
3. the console also has the same functions as the terminal, and the console is sometimes collectively referred to as the terminal.
4. When the computer is started, all information is displayed on the console rather than on the terminal.
5. Information unrelated to the terminal, such as kernel messages and background service messages, can be displayed on the console but not on the terminal.

Ii. Current console and terminal
1. Because computer hardware is getting cheaper and cheaper, it is usually operated by a person exclusively on a computer and no longer connects to the previous "terminal device ".
2. The concepts of terminals and consoles have gradually evolved. Terminals and consoles are evolved from hardware to software.
3 terminals, such as virtual terminals in linux, are all software concepts. He uses computer software to simulate previous hardware methods.
4. The terminal that can directly display system messages is called the console, while others are called terminals.
Note: in linux, this concept is also vague.
5 echo "hello, world">/dev/console
The purpose of this command is to display "hello, world" to the console./dev/console is the device name of the console device. In linux, no matter which virtual terminal you run this command in character mode, the characters hello and world are displayed under the current virtual terminal. That is to say, linux treats the current terminal as the console.

The concepts of the console and terminal are also gradually discussed.

3/dev/console
1/dev/console is the device name of the console device.
2. In all terminals, you can specify a terminal as the console. The device name dev/console can be used to represent and find the terminal used for the console.
3. The/dev/console always requires something practical, which is configured in system management. Each UNIX system has a specified terminal or display to receive console messages.
In the past, it may be a dedicated printing terminal; in modern linux, it is usually an active virtual console; In X Window System, it is a special Console window on the screen.
For example, if you associate/dev/console with/dev/tty0, system monitoring messages and messages displayed to users are printed on your screen, no matter which tty you go.
Note: tty0 is an alias for the current virtual terminal.

For example, if you need to report some exceptions to the system administrator when writing an application, you can simply open (/dev/console ,..), then write () the message to this fd. Then the system administrator can see the message. If you are writing a telnet program and you find someone attacking your system, you can use this method to notify the system administrator, not necessarily on the user terminal, because, it makes no sense to know that the user cannot handle this situation.

4/dev/tty
1. process control terminal
As the name implies, it is the terminal that controls the process running (from this terminal to the host to submit the process, and the process will show some information to this terminal ). ---- In my personal understanding, if there is an error, ah, no tricks!

2/dev/tty is the alias of the current process control terminal (logical device ),
3. If the current process has a final control,/dev/tty is the special device file of the control terminal of the current process.
4 can I use the command "ps? Ax to check which control terminal the process is connected.
5. Run the "tty" command to check which actual terminal device it corresponds.
6. It does not refer to any physical terminal./dev/tty is similar to a connection to the actually used terminal device.

Note: In windows, you will find that it is mapped to a Pseudo Terminal. Pseudo Terminal (/dev/pty/) is the development of the terminal to meet current needs (such as network login, xwindow window management ).

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.