Linux has the following shutdown and restart commands: shutdown, reboot, halt, and poweroff. What are the differences between them? Shutdown-the recommended command shutdown is the most common and secure command for shutdown and restart. it will call fsck to check the disk before shutdown.
Linux has the following shutdown and restart commands: shutdown, reboot, halt, and poweroff. What are the differences between them?
Shutdown-the recommended command shutdown is the most common and secure command for shutdown and restart. it will call fsck to check the disk before shutdown, among them,-h and-r are the most common parameters:
-H: Stop system service and shut down-r: Stop system service and restart
The following are examples:
Shutdown-h now -- immediate shutdown-h -- to shutdown, if this time is less than the current time, then shutdown-h + 10 -- shutdown automatically after 10 minutes-r now -- restart shutdown-r + 30 'The System Will Reboot in 30 mins' -- restart and and send notifications to other online users.
Reboot indicates immediate restart, equivalent to shutdown-r now
Poweroffpoweroff indicates immediate shutdown. The effect is equivalent to shutdown-h now. it is not recommended in multi-user mode (Run Level 3.
Halt does not care about the current system conditions, hardware shutdown is generally not recommended