1. shutdown command (root permission required)
Usage: shutdown [OPTION]... TIME [MESSAGE]
OPTION: OPTION
TIME: TIME
MESSAGE: warning MESSAGE sent to all users
Options:
-R: restart the system after the system service is stopped.
-H: shut down the system immediately after the service is stopped.
-H: shut down the system immediately after the service is stopped (that is,-h)
-P: immediately shut down the system after the service is stopped (that is,-h)
-C: cancels an ongoing shutdown process.
-K: only sending warning messages, not actually shutting down
Example:
Shutdown-r now restart now
Shutdown-h now shut down immediately
Shutdown-h 'I will shutdown' system shut down at today. If the current time is after, shutdown again at the next day and send the I wil shutdown message
Shutdown-h + 30 system shutdown after 30 minutes
II. Shutdown command halt
Age: halt [OPTION]...
-N: do not execute sync before shutdown or restart (data synchronization is written to the disk)
-F: shutdown or restart without calling shutdown.
-P: This option is the default option, that is, poweroff is called during shutdown.
-W: not a real restart or shutdown, but a wtmp (/var/log/wtmp) record.
III. Shutdown command poweroff
Same as halt
IV. Switch execution level init
Switch execution level
Init 0: Shutdown
Init 6: Restart
V. Restart command reboot
Same as halt
The preceding commands can be viewed by man, for example:
Man shutdown