Get the App
SLTechnology News&Howtos  ›  Servers  › 

Example Analysis of Management Terminal Interface in CentOS

Shulou Source: shulou.com Published: 2022-06-01 10:12:37 11月16日 Update

This article mainly introduces the example analysis of the management terminal interface in CentOS, which is very detailed and has a certain reference value. Interested friends must read it!

I. brief introduction

The CentOS6.2 system opens six consoles and a graphical interface by default. The switching management operation on them can still improve the work efficiency, and it is also interesting to open multiple graphical interfaces.

Second, detailed explanation

1. Switch between graphics and character interface

(1) Boot switch

Open / etc/inittab:

[html] view plaincopy

# Default runlevel. The runlevels used are: # 0-halt (Do NOT set initdefault to this) # 1-Single user mode # 2-Multiuser, without NFS (The same as 3, if you do not have networking) # 3-Full multiuser mode # 4-unused # 5-X11 # 6-reboot (Do NOT set initdefault to this) # id:5:initdefault:

Among them, id:5:initdefault: opens the graphical interface by default, and modifies it to id:3:initdefault: starts the character interface. Starting the graphical interface requires more than 100m of memory and the load of cpu makes the startup speed too slow, while the startup character interface is much faster.

If you want to enter the graphical interface after starting the character interface, enter the tty terminal and enter # startx, but the started interface is in English (starting the second graphical interface in Chinese is Chinese). You can first enter # export LC_ALL=zh_CN.UTF-8 or # export LC_ALL=zh_CN.GBK in the tty terminal (when there is no font library, the system will prompt you to find the corresponding file), and then enter startx to start the Chinese interface.

(2) work switching

The CentOS6.2 system opens 6 consoles by default, and use the following command to view:

# ps aux | grep tty | grep-v grep

If the console of the five-character interface can be switched through Ctrl+Alt+F2 plus Ctrl+Alt+F6 under the graphical interface, and the six consoles can be switched from Alt+F1 to Alt+F6 under the character interface (once you switch back to the graphical interface, you need to use Ctrl+Alt+F to switch back to the characters).

(3) add console

Ctrl+Alt+F7 and later F8 will open a new character interface. Using # startx under the graphical interface will prompt:

If display 0 has been activated, use the command # startx--: 1 to start the second graphical interface. # startx--: 2 launch the third graphical interface, and then start multiple graphical interfaces in turn.

2. Management console

(1) View

With the w command, you can view all the Control stations currently in use:

Pts/2 is its own host ssh remote login terminal of other hosts, pts/5 is the remote terminal to the local machine, other tty is the login character interface terminal, pts is the shell terminal.

(2) send messages

You can use # echo "helloworld" > / dev/pts/5 to send information to the host terminal that logs in remotely, or you can send information between terminals. Here is the information received:

(3) kill the terminal

If you want to kill the remote login user, you can not only close the ssh port, but also use # skill-9 pts/5 to kill the remote login terminal. You can also use this command to kill the character interface terminal and the graphical interface terminal.

3. Close the redundant console

Modify id:5:initdefault: to id:3:initdefault: can not start the graphical interface, reducing memory and cpu consumption. The extra tty character interface terminals can be closed through the configuration files / etc/init/start-ttys.conf and / etc/sysconfig/init to save memory.

Linux servers are logged in remotely, generally using pts terminals, while tty terminals use only two or three local logins, and the rest can be closed.

The previous version of CentOS6 was to modify the / etc/inittab file by adding # and commenting out tty4,tty5,tty6. From CentOS6, change the configuration of TTY from / etc/inittab to / etc/init/start-ttys.conf, and execute the command # vim / etc/init/start-ttys.conf to change the default / dev/tty [1-6] to / dev/tty [1-3] as follows:

[html] view plaincopy

# # This service starts the configured number of gettys. Start on stopped rc RUNLEVEL= [2345] env ACTIVE_CONSOLES=/dev/tty [1-3] env X_TTY=/dev/tty1 task script. / etc/sysconfig/init for tty in $(echo $ACTIVE_CONSOLES); do ["$RUNLEVEL" = "5"-a "$tty" = "$X_TTY"] & & continue initctl start tty TTY=$tty done end script

Then open # vim / etc/sysconfig/init:

Change ACTIVE_CONSOLES=/dev/tty [1-6] to ACTIVE_CONSOLES=/dev/tty [1-3] and restart.

The above is all the contents of the article "sample Analysis of the Management Terminal Interface in CentOS". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Interface terminal graphics characters console control login switching commands management information host memory files system Chinese input examples analysis content Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno vpn Redmi Shulou Tech Info