Home >Operation and Maintenance >Linux Operation and Maintenance >What is the linux system shutdown command?

What is the linux system shutdown command?

青灯夜游
青灯夜游Original
2021-03-19 16:44:0249467browse

Linux system shutdown command: 1. "shutdown -h now" or "shutdown -p now"; 2. "halt" or "halt -p"; 3. "poweroff" or "poweroff --halt "; 4. "reboot -p".

What is the linux system shutdown command?

#The operating environment of this tutorial: Red Hat Enterprise Linux 6.1 system, Dell G3 computer.

GOIP Normally, when you want to shut down or restart your machine, you would run one of the following commands:

shutdown command

shutdown will schedule a time for the system to shut down. It can be used to stop, shut down, and restart the machine.

You can specify a time string (usually now or hh:mm to specify hours/minutes) as the first parameter. Additionally, you can set up a broadcast message to be sent to all logged in users before the system is shut down.

Important: If the time parameter is used, the /run/nologin file will be created 5 minutes before the system is shut down. to ensure that no one can log in anymore.

shutdown command example:

# shutdown
# shutdown now
# shutdown 13:20  
# shutdown -p now  ### 关闭机器
# shutdown -H now  ### 停止机器      
# shutdown -r09:35 ### 在 09:35am 重启机器

To cancel an upcoming shutdown, just enter the following command:

# shutdown -c

halt command

halt tells the hardware to stop all CPU functions, but still keep power on. You can use it to keep your system in a low-maintenance state.

Note that in some cases it will shut down the system completely. The following is an example of the halt command:

# halt             ### 立刻关机
# halt -p          ### 关闭机器
# halt --reboot    ### 重启机器

poweroff command

poweroff will send an ACPI signal to notify the system to shut down.

The following is an example of the poweroff command:

# poweroff           ### 关闭机器
# poweroff --halt    ### 停止机器
# poweroff --reboot  ### 重启机器

reboot command

reboot notifies the system to restart.

# reboot           ### 重启机器
# reboot --halt    ### 停止机器
# reboot -p        ### 关闭机器

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What is the linux system shutdown command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn