Linux Shutdown restart command
Today we introduce the shutdown Restart commands commonly used in Linux systems-shutdown, Halt, reboot, Poweroff, and init.
Shutdown command
Shut down the system in a secure manner or restart the system. It prompts a warning message to all logged-in users on the system before the system shuts down. The command also allows the user to specify a time parameter, which can be either an exact time or a time period from now on.
Command format
shutdown [OPTION] ... Time [MESSAGE]
the time parameter can be formatted in a number of ways. First, it can be an absolute time in the hh:mm format, where HH refers to the hour (one to two digits) and MM refers to the minute (two digits). The second type is the +m format, where m refers to the number of minutes to wait. Now is the alias of +0.
Parameter description
-R |
Rebooting the system |
-H |
System shutdown |
-H |
The feeling is shut down. |
-P |
Or the system shuts down |
-C |
Cancel an in-progress shutdown operation |
-K |
Only warning messages and no login are issued and will not be shut down |
On the role of-H and –P, hope English good friends to distinguish the difference between
-H requests that the system was halted after it had been brought down.
-P requests that the system was powered off after it had been brought down.
Halt, reboot, Poweroff command
Halt is called Shutdown-h. When the halt executes, the application process is killed, the sync system is called, and the kernel is stopped after the file system write operation is complete.
Reboot works almost like halt, but it triggers a host reboot, and Halt is shut down.
Poweroff is also used to shut down the system.
Command format
Halt [OPTION] ...
Reboot [OPTION] ...
Poweroff [OPTION] ...
Parameter description
-F,--Force |
Do not call shutdown (8), enforce command |
-P,--Poweroff |
Perform power-down operation when shutting down the system |
-W,--wtmp-only |
Does not really restart or shut down, but simply writes the shutdown information to the/var/log/wtmp file |
--verbose |
Output more detailed information when restarting for debug shutdown |
As a rookie of Linux, the internal principle is not very clear, I hope you bo friends a lot of advice ah.
Shutdown command
Init 0
These are described in the commands for shutting down and restarting. Or that old saying, I hope you give some more advice ah, whether it is typesetting, knowledge points, or experience can be.
Brief analysis of Linux shutdown restart command