How to Use Shutdown, Poweroff, Halt, and Reboot Commands in Linux

In this article, we’ll explain the difference between the shutdown, poweroff, halt and reboot commands in Linux. We’ll clarify what each command actually does when executed, along with the available options.

If you’re diving into Linux server administration, these are some of the important Linux commands you need to fully understand for effective and reliable server administration.

Tip: Most shutdown-related commands require sudo if you’re not logged in as root.

Shutdown Command

The shutdown command schedules a time for the system to be powered down, which can be used to halt, power off, or reboot the machine.

You may specify a time string (usually “now” or “hh:mm“) as the first argument. Additionally, you can include a wall message to notify all logged-in users before the system goes down.

Important: If a time argument is used, the system creates the /run/nologin file 5 minutes before shutdown, which prevents new user logins as the system prepares to go down.

Examples of shutdown commands:

shutdown               # Schedule a shutdown
shutdown now           # Shutdown immediately
shutdown 13:20         # Shutdown at 1:20 PM
shutdown -p now        # Power off the machine
shutdown -H now        # Halt the machine
shutdown -r 09:35      # Reboot at 9:35 AM

To cancel a pending shutdown, simply type the command below:

shutdown -c

Shutdown Options Overview:

  • -r: Reboot after shutdown.
  • -h: Halt or power off (system decides).
  • -H: Halt the system.
  • -P: Power off the system.
  • -c: Cancel a running shutdown.
  • -k: Only send warning messages (no shutdown).

Correction Note: A common mistake is using shutdown -p, which is invalid. The correct option to power off is shutdown -P.

Halt Command

The halt command instructs the system to stop all CPU functions. In most cases, it leaves the system powered on, which is useful for low-level maintenance. However, depending on the system configuration, it may completely shut the system down.

Below are examples of halt commands:

halt                  # Halt the machine
halt -p               # Power off the machine
halt --reboot         # Reboot the machine

Poweroff Command

The poweroff command sends an ACPI signal to power down the system.

The following are examples of poweroff commands:

poweroff              # Power off the machine
poweroff --halt       # Halt the machine
poweroff --reboot     # Reboot the machine

Reboot Command

The reboot command instructs the system to restart.

reboot                # Reboot the machine
reboot --halt         # Halt the machine
reboot -p             # Power off the machine

Compatibility Note for Modern Systems

If you’re using a modern Linux distribution that uses systemd (such as Ubuntu, Debian, Fedora, Arch, etc.), it’s recommended to use the equivalent systemctl commands for shutdown, reboot, and halt operations.

These commands are more aligned with the system’s service manager and provide better consistency:

sudo systemctl poweroff     # Power off the system
sudo systemctl reboot       # Reboot the system
sudo systemctl halt         # Halt the system

These alternatives work reliably and are considered best practice on systemd-based systems.

Summary

Understanding the behavior of these system control commands is crucial for Linux server administration, especially in a multi-user environment.

Here’s a quick recap:

Command Description
shutdown Schedule halt, reboot, or poweroff
halt Stop CPU functions (may not power off)
poweroff Send an ACPI signal to power down
reboot Restart the system

That’s all! With these commands, you’ll be better equipped to manage Linux systems reliably. Got additional tips or experiences to share? Drop them in the comments section below!

Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

15 Comments

Leave a Reply
  1. You need to correct the text. I wanted to power off a server and used halt -p, since shutdown -p does not work — the correct option is shutdown -P.

    The following are the options for the shutdown command in Linux:

    -r: Requests that the system be rebooted after it has been brought down.

    -h: Requests that the system be either halted or powered off after it has been brought down, with the choice left up to the system.

    -H: Requests that the system be halted after it has been brought down.

    -P: Requests that the system be powered off after it has been brought down.

    -c: Cancels a running shutdown. TIME is not specified with this option; the first argument is the MESSAGE.

    -k: Only sends out the warning messages and disables logins — does not actually bring the system down.

    Reply
  2. Some of y’all are imbecile, there is a reason for having all 3 commands as they are similar but not the same. For instance, the shutdown command will also write a shutdown script. Perhaps, you just want to do low-level maintenance, halt will be a suitable command to use as it will stop all running process and stop the CPU as well.

    You will probably remember halt quicker than Shutdown -H and as for reboot, self explanatory. Easier to remember as opposed to shutdown -r., etc.

    Reply
  3. I would like to shutdown and poweroff machine. I have seen things like “/usr/sbin/shutdown -h +0 && /usr/sbin/poweroff” However, the poweroff command kills the machine prior to allowing programs to execute shutdown scripts.

    I do not wish to simply run poweroff, because it does not execute program shutdown scripts and simply halts all processes. Is there a way to get a graceful shutdown AND power down the machine?

    Reply
    • @Mickechen

      There is really no difference, we explained this in their descriptions and with the example commands(they all work nearly in the same way, they may be used to perform related functionalities using particular options.)

      Reply
  4. So, basically “shutdown” command is all you need, safely speaking. :) I mean it does everything from halt, reboot, shutdown etc. that too whenever I want it to.

    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.