Linux shutdown commands include shutdown command, halt command, poweroff command and reboot command. Detailed introduction: 1. The shutdown command is used to shut down the system. When using this command, you can choose to shut down immediately or shut down after a specified time; 2. The halt command is used to shut down the system and stop all processes. Compared with the shutdown command, the halt command does not Cleaning work during the shutdown process will be performed, so it may take longer to complete the shutdown; 3. Poweroff command, etc.
In Linux systems, the commonly used shutdown commands include the following:
1. Shutdown command: The shutdown command is used to shut down the system. When using this command, you can choose to shut down immediately or shut down after a specified time. For example, use the following command to shut down immediately:
sudo shutdown -h now
Or, use the following command to shut down after 5 minutes:
sudo shutdown -h +5
2. Halt command: The halt command is used to shut down the system and stop all processes. Compared with the shutdown command, the halt command does not perform cleanup during the shutdown process, so it may take longer to complete the shutdown. Use the following command to shut down immediately:
sudo halt
3. Poweroff command: The poweroff command is used to shut down the system and disconnect the power supply. Similar to the halt command, the poweroff command does not perform cleanup during the shutdown process, so it may take longer to complete the shutdown. Use the following command to shut down immediately:
sudo poweroff
Recommended related reading:
[shoudongurl]What is the Linux shutdown command[/shoudongurl]
[shoudongurl]What are the shutdown and restart commands for Linux[/shoudongurl]
[shoudongurl]What are the shutdown commands for Linux[/shoudongurl]
[shoudongurl]How to implement linux shutdown and restart function in php[/shoudongurl]
4. Reboot command: The reboot command is used to restart the system. Use the following command to restart the system:
sudo reboot
The above are common shutdown commands in Linux systems. It should be noted that using these commands requires sufficient permissions, so you may need to use sudo or execute these commands as the root user. In addition, when executing shutdown commands such as shutdown, halt, and poweroff, the system will send notifications to all users so that users can save their work and prepare for shutdown.
The above is the detailed content of Linux shutdown command. For more information, please follow other related articles on the PHP Chinese website!