Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Terminals in linux

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Shell: Shell refers to software (command parser) that "provides the user with an interface". When we use Linux, we do not deal directly with the system, but through the intermediate program of Shell. Why it is called shell is because it hides the underlying details of the operating system.

It is also the scripting language of the control system. Is a script interpreter that controls system startup, X11 startup, and many other utilities.

Graphical user interfaces GNOME and KDE under graphical Shell:UNIX/Linux.

Terminal (Terminal): corresponding to the / dev/tty device on Linux, the multi-user login of Linux is done through different / dev/tty devices.

Pseudo terminal: Linux provides 6 pure command line interface "terminal" (6 virtual consoles to be exact) to let users log in by default. You can switch on the physical machine system by using [Ctrl] + [Alt] + [F1] ~ [F6].

Console (Console): physical terminal. Can do some low-level operations on the computer, a computer usually can only have one Console, most of the time is part of the mainframe, and CPU share a cabinet.

Pty (virtual terminal or pseudo terminal):

Don't we also need a terminal interaction when we remotely telnet to the host or use xterm? Yes, this is the virtual terminal pty (pseudo-tty).

Tty (collectively referred to as terminal equipment):

The word tty comes from Teletypes, or teletypewriters, which originally refers to a teletypewriter, something that uses a printer keyboard to read and send messages through a serial line, but it was later replaced by a keyboard and display, so now it's more appropriate to call a terminal.

Terminal is a kind of character device, which has many types, and tty is usually used to refer to various types of terminal devices.

Terminal (Terminal): corresponding to the / dev/tty device on Linux, the multi-user login of Linux is done through different / dev/tty 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. Can be connected to the serial port to experiment.

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) are not directly related to the actual physical device! !!

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).

These are the details of the linux terminal, please pay attention to other related articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report