How to use character interface and window mode in CentOS
In the CentOS interface switching problem, many people may be accustomed to entering the character working mode to operate. So how do you switch to character working? Below we will introduce 3 methods to enter the character working mode: Let’s take a look!
Open a terminal window in a graphical environment to enter character working mode. Enter character working mode directly after system startup. Use remote login mode (Te lnet or SSH) to enter character working mode.
Virtual Console
When the system starts up and enters the character working mode directly, the system provides multiple (default is 6) virtual consoles. Each virtual console can be used independently without affecting each other. You can use Alt F1 ~ Alt F6 to switch between multiple virtual consoles. If the user uses the startx command to start the graphical environment in the character CentOS interface, then you can use C trl Alt F1 ~ C trl Alt F6 to switch to the character virtual terminal, and use C trl Alt F7 to switch to the graphical interface.
Local login and logout
Login: Enter the user name (such as root) and password (pwd) on the login terminal. Logout: The user can enter the logout command on the current login terminal or use shortcut keys.
Use ssh to log in to the remote Linux system in the Linux environment. The ssh command under Linux is the client program of OpenSSH. To log in to a remote Linux system, you must ensure that the OpenSSH server is started on the remote Linux system.
The command format to use the ssh command to log in to the remote O pe nSSH server is: $ ssh username on the remote host@IP address or FQDN of the remote host
Entering the character CentOS interface can be entered from the system run level
Linux system runs on a designated run level at any time, and the programs and services of different run levels are different, and the work to be completed and the purpose to be achieved are different. Centos has set up run levels as shown in the following table, and the system can switch between these run levels to complete different tasks. Run level description
0 All processes will be terminated, the machine will stop in an orderly manner, and the system will be at this run level when shutting down
1 Single user mode. For system maintenance, only a few processes are running, and all services are not started
2 Multi-user mode. Same as run level 3, except that the Network File System (NFS) service is not started
3 Multi-user mode. Allows multiple users to log in to the system, which is the default startup level of the system
4 Leave it to user-defined runlevels
5 Multi-user mode, and run X-Window after the system starts, giving a graphical login window
6 All processes are terminated and the system is restarted
1. If the system enters the character login CentOS interface after startup, it means that the system's default run level is 3; if the system enters the graphical login CentOS interface after startup, it means the system's default run level is 5.
2. If the user has started the character CentOS interface and wants to enter the graphical CentOS interface, he can use the following command:
$ startx &
Run-level viewing and switching
Users can use the following command to view the runlevel runlevel of the current system. Users can use the following command to switch the runlevel init [0123456Ss]. That is, the init command is followed by a parameter. This parameter is the runlevel code of the runlevel to be switched to. ,like:
Use the init 0 command to switch to run level 0, that is, shut down
Use the init 1 command to switch to run level 1, that is, enter single-user running mode
Use the init 6 command to switch to run level 6, that is, restart
You can also use the te linit command. In CentOS, the te linit command is a symbolic link to the init command.
Let’s look at an example of using runle ve l and init commands:
# # Display the current running level of the system
# runlevel
N 3
# # The current running level of the system is "3" and there is no previous running level (indicated by "N")
# init 2
# # After executing the "init 2" command, the corresponding stop and start service information will be displayed in the system console
# runlevel
3 2
# # The current running level of the system is "2", the last running level was "3", the running level conversion was successful
You can also use the shutdown and restart commands to enter the character CentOS interface
The shutdown and restart of the system are actually switching the run level. This time you can use the init command to shut down and restart. The init command is used to shut down or restart immediately. However, in a multi-user system, if you want to send a shutdown warning message to users so that each user can complete their work and log out, you must use shutdown. , halt and reboot commands
make.
In a multi-user environment, the shutdown command is usually used to shut down and restart the system. The shutdown command can shut down the system in a relatively safe way. All users logged in to the system will be notified that the system will be shut down, and new login operations will be blocked; at the same time, all processes will also be notified that the system will be shut down, so Some programs, such as vi, will be able to save user-edited files and exit immediately.
The format of the shutdown command is: shutdown [parameter] time [warning-message]
Among them: time: Set how long it takes to execute the shutdown command. You can use the following three formats:
hh:mm: Specify the absolute time, hh is used to specify the hour, m m is used to specify the minute
m: Specify the relative time, m is a number, the unit is minutes
now: Do it immediately, equivalent to 0
warning-message: used to set warning messages sent to users
Commonly used parameters for CentOS interface switching are as follows:
-t sec: How many seconds to delay between sending warning information and deleting information before notifying init to perform run-level switching
-k: Does not actually shut down the system, just sends a warning message to each user
-r: Restart the system after shutting down
-h: Stop the system after shutdown
-f: No need to check the disk with fsck after reboot
-F: Force fsck to check the disk after reboot
For example:
# # Warn all users that the system will restart in 5 minutes
# shutdown –r 5 “System will be reboot in 5 minites, Please save your work.”
# # Shut down the system immediately
# shutdown –h now
# # Reboot the system immediately and force fsck to check the disk after reboot
# shutdown –h -F now
The above is the detailed content of How to use character interface and window mode in CentOS. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Backup and Recovery Policy of GitLab under CentOS System In order to ensure data security and recoverability, GitLab on CentOS provides a variety of backup methods. This article will introduce several common backup methods, configuration parameters and recovery processes in detail to help you establish a complete GitLab backup and recovery strategy. 1. Manual backup Use the gitlab-rakegitlab:backup:create command to execute manual backup. This command backs up key information such as GitLab repository, database, users, user groups, keys, and permissions. The default backup file is stored in the /var/opt/gitlab/backups directory. You can modify /etc/gitlab

Improve HDFS performance on CentOS: A comprehensive optimization guide to optimize HDFS (Hadoop distributed file system) on CentOS requires comprehensive consideration of hardware, system configuration and network settings. This article provides a series of optimization strategies to help you improve HDFS performance. 1. Hardware upgrade and selection resource expansion: Increase the CPU, memory and storage capacity of the server as much as possible. High-performance hardware: adopts high-performance network cards and switches to improve network throughput. 2. System configuration fine-tuning kernel parameter adjustment: Modify /etc/sysctl.conf file to optimize kernel parameters such as TCP connection number, file handle number and memory management. For example, adjust TCP connection status and buffer size

CentOS will be shut down in 2024 because its upstream distribution, RHEL 8, has been shut down. This shutdown will affect the CentOS 8 system, preventing it from continuing to receive updates. Users should plan for migration, and recommended options include CentOS Stream, AlmaLinux, and Rocky Linux to keep the system safe and stable.

Complete Guide to Checking HDFS Configuration in CentOS Systems This article will guide you how to effectively check the configuration and running status of HDFS on CentOS systems. The following steps will help you fully understand the setup and operation of HDFS. Verify Hadoop environment variable: First, make sure the Hadoop environment variable is set correctly. In the terminal, execute the following command to verify that Hadoop is installed and configured correctly: hadoopversion Check HDFS configuration file: The core configuration file of HDFS is located in the /etc/hadoop/conf/ directory, where core-site.xml and hdfs-site.xml are crucial. use

The CentOS shutdown command is shutdown, and the syntax is shutdown [Options] Time [Information]. Options include: -h Stop the system immediately; -P Turn off the power after shutdown; -r restart; -t Waiting time. Times can be specified as immediate (now), minutes ( minutes), or a specific time (hh:mm). Added information can be displayed in system messages.

Steps to configure IP address in CentOS: View the current network configuration: ip addr Edit the network configuration file: sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0 Change IP address: Edit IPADDR= Line changes the subnet mask and gateway (optional): Edit NETMASK= and GATEWAY= Lines Restart the network service: sudo systemctl restart network verification IP address: ip addr

Common problems and solutions for Hadoop Distributed File System (HDFS) configuration under CentOS When building a HadoopHDFS cluster on CentOS, some common misconfigurations may lead to performance degradation, data loss and even the cluster cannot start. This article summarizes these common problems and their solutions to help you avoid these pitfalls and ensure the stability and efficient operation of your HDFS cluster. Rack-aware configuration error: Problem: Rack-aware information is not configured correctly, resulting in uneven distribution of data block replicas and increasing network load. Solution: Double check the rack-aware configuration in the hdfs-site.xml file and use hdfsdfsadmin-printTopo

Detailed explanation of MongoDB efficient backup strategy under CentOS system This article will introduce in detail the various strategies for implementing MongoDB backup on CentOS system to ensure data security and business continuity. We will cover manual backups, timed backups, automated script backups, and backup methods in Docker container environments, and provide best practices for backup file management. Manual backup: Use the mongodump command to perform manual full backup, for example: mongodump-hlocalhost:27017-u username-p password-d database name-o/backup directory This command will export the data and metadata of the specified database to the specified backup directory.
