What are the shutdown commands for Linux systems? Liangxu Tutorial Network has the answers for you! Friends who are familiar with Linux should know that the shutdown commands we often use in Linux systems are: shutdown, halt, poweroff, init; the restart commands are: reboot. The following article mainly introduces some commonly used shutdown commands as well as the differences and specific uses of various shutdown commands. The following are some of the more commonly used shutdown commands 1. Halt shuts down the computer immediately 2. Poweroff: shut down the computer immediately 3. shutdown -h now shuts down immediately (used by root user) 4. shutdown -h 10 automatically shuts down after 10 minutes Note: If the shutdown command is used to set the shutdown, you can use the shutdown -c command to cancel the restart. Restart command: shutdown -r now Restart immediately (for root user) shutdown -r 10 Automatically restart after 10 minutes (for root user) shutdown -r 20:35 Restart at 20:35 (used by root user) Note: If the restart is set by the shutdown command, you can cancel the restart with the shutdown -c command. Next, let's follow the editor of Liangxu Tutorial Network to look at the differences between these specific shutdown commands in Linux and their respective uses. 1.shutdown safe shutdown command As for the shutdown command, it is a safe command recommended by everyone. It can be used with the -h or -r parameter to complete shutdown or restart. However, in Linux systems, only those with root privileges can use this command. So, although everyone recommends using this command, it is really not very convenient to use: Do you want to use this command? Get root privileges first. Shutdown executes shutdown by sending a signal to init, asking it to change the running level to shut down the computer. Shutting down or restarting is actually adjusting the run level, so we can also use init to directly adjust the run level to shut down or restart. When this command is used, the machine is shut down or restarted immediately. It also requires root privileges. So why is the shutdown command said to shut down the system safely? In practice, some users will shut down Linux by directly cutting off the power supply, which is very dangerous. Because Linux is different from Windows, it has many processes running in the background, so forced shutdown may cause process data loss and put the system in an unstable state. In some systems, it may even damage hardware devices. By using the shutdown command before shutting down the system, the system administrator will notify all logged-in users that the system is about to shut down. And the login command will be frozen, that is, new users can no longer log in. It is possible to shut down the computer directly or delay it for a certain period of time, or it may be restarted. This is determined by the fact that all processes will receive signals sent by the system. shutdown parameter description:
2.halt The simplest shutdown commandWhen you use the halt command to shut down the computer, what is actually called is shutdown -h. When halt is executed, the application process will be killed, and the kernel will be stopped after the sync system call is executed and the file system write operation is completed. halt Parameter Description:
3.poweroff Common shutdown commandsAs for poweroff, the Internet says it is a link to the halt command, and its basic usage is similar to halt, so I won’t go into details here. 4.initInit is the ancestor of all processes and is one of the indispensable programs in Linux system operation. Its process number is always 1, so sending the TERM signal to init will terminate all user processes, daemons, etc. shutdown uses this mechanism. init defines 8 runlevels, init 0 is shutdown, init 1 is restart. 5. reboot commandThe working process of reboot is almost the same as halt. However, it causes the host to restart, while halt causes the host to shut down. Its parameters are similar to halt. The above is the detailed content of the differences and usage of the Linux system shutdown commands. For more information about the differences and usage of the Linux system shutdown commands, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: MySQL transaction autocommit automatic commit operation
>>: HTML table markup tutorial (38): Border color attribute of the header BORDERCOLOR
radio-and-checkbox Pure CSS to achieve radio and ...
Create a user: create user 'oukele'@'...
echarts word cloud is an extension of echarts htt...
query_cache_limit query_cache_limit specifies the...
We can use the scp command of Linux (scp cannot b...
Table of contents background What is tablespace f...
You may often see some HTML with data attributes. ...
Note: The basic directory path for software insta...
Description: Limit the number of lines of text di...
Table of contents Inheritance ES5 prototype inher...
View system help help contents mysql> help con...
1. Introduction A few days ago, a development col...
Query Rewrite Plugin As of MySQL 5.7.6, MySQL Ser...
Table of contents 1. Operator 1.1 Arithmetic oper...
This article shares the encapsulation code of Jav...