After executing the command shutdown -h 10 'System will shutdown in 10 minitus, please save your file!!!', the system tells everyone that this machine will shut down in ten minutes! And the information will be displayed repeatedly on the user's screen! Within 10 minutes, the system administrator can enter shutdown -c to cancel this shutdown command. As shown below
If you do not add any parameters when executing the shutdown command, after executing the shutdown command directly, the system will shut down after 1 minute by default!
shutdown -h now Shut down immediately, equivalent to shutdown -h 0
shutdown -h 23:00 The system shuts down at 23:00. If this command is executed at 23:00, the system will shut down at 23:00 the next day
shutdown -h 10 The system will automatically shut down after ten minutes
shutdown -r now The system will restart immediately
shutdown -r 10 'Warning!!! The system will reboot in 10 minitues' The system will reboot in ten minutes and display the following warning information to all logging in users
The reboot command can play the same role as shutdown -r. It is recommended to execute the data writing command sync several times before executing the reboot command to ensure that the data is written to the disk synchronously.
The above is the detailed content of Example: Example of using the shutdown command to shut down CentOS. For more information, please follow other related articles on the PHP Chinese website!