Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the shutdown, poweroff, halt and reboot commands in Linux

Shulou Source: shulou.com Published: 2022-06-01 06:34:19 09月18日 Update

This article will explain in detail how to use the shutdown, poweroff, halt and reboot commands in Linux. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Shutdown command

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

You can specify a time string (usually now or hours / minutes with hh:mm) as the * parameter. You can also set up a broadcast message to be sent to all logged-in users before the system shuts down.

Important: if the time parameter is used, the / run/nologin file will be created 5 minutes before the system shuts down. To make sure no one can log in again.

Example of the shutdown command:

# shutdown # shutdown now # shutdown 13:20 # shutdown-p now # shut down the machine # shutdown-H now # stop the machine # shutdown-r09now 35 # restart the machine in 09:35am

To cancel the impending shutdown, simply enter the following command:

# shutdown-c

Halt command

Halt notifies the hardware to stop all CPU functions, but still keeps the power on. You can use it to keep the system in a low-level maintenance state.

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

# halt # stop the machine # halt-p # shut down the machine # halt-- reboot # restart the machine

Poweroff command

Poweroff sends an ACPI signal to notify the system to shut down.

The following is an example of the poweroff command:

# poweroff # shut down the machine # poweroff-halt # stop the machine # poweroff-reboot # restart the machine

Reboot command

Reboot notifies the system to restart.

# reboot # restart the machine # reboot-- halt # stop the machine # reboot-p # shut down the machine. This is the end of the article on "how to use shutdown, poweroff, halt and reboot commands in Linux". I hope the above content can be helpful to you, so that you can learn more knowledge, if you think the article is good. Please share it for more people to see.

Tags: Machines commands systems times examples articles parameters more login good practical important creative signals messages content functions characters strings hours Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia Shulou Technology vpn Redmi