Linux Shutdown system command shutdown
Shutdown, reboot the system
Linux is a multiuser, multitasking system that can cause user data loss in the system if the system is not properly shut down or restarted. The possibility is that the user is performing a key operation or operation, etc., if the system is not prompted to shut down the user will be too late to save the current data, resulting in data loss. Therefore, you should master the correct way to shut down and restart the system to avoid data loss.
Turn off the system command shutdown
The shutdown command is the most commonly used shutdown system command, not only to shut down the system immediately, but also to shut down the system at a specified time.
(1) Shut down the system after 1 minutes:
# shutdown-h 1
Because administrator privileges are required to shut down and reboot the system, you should shut down and restart the system commands as root as shutdown.
Shut down the system now:
# shutdown-h Now
(2) A specified time to shut down the system:
# shutdown-h 15:30
When the root user issues a shutdown directive, other users in the system can receive the following prompt:
The system is going down for system halt in 2 minutes!
If you get this hint, the user should immediately stop the job in progress, save the necessary data, and then exit the system.
(3) The shutdown command can also be used to reboot the system:
# shutdown-r 2
The system will reboot in 2 minutes.
If more than one user is using the system, you should use the shutdown command when shutting down the system and use the method of delaying shutdown to avoid data loss.