What is the Linux Shutdown Command? With Examples

What is the Linux Shutdown Command? With Examples
Published on Jan 8, 2025 Updated on Nov 7, 2025

The shutdown command powers off or reboots a Linux system, depending on how it is invoked. You can power off, reboot a system, or schedule a specific time for any of these operations.

Since this is a privileged command, only the root or a sudo user can run it. In this article, we will dive into the functionality of the shutdown command, exploring its syntax and various options, so you can effectively manage your Linux system's power state.

#What is the shutdown command in Linux

The shutdown command is a command that lets you effectively shut down a Linux system. It offers a range of options for powering off your system. You can bring down your system immediately or schedule a shutdown for a specific time or after some minutes.

During shutdown, the command switches the system to runlevel 0, which triggers the system to power off. The command gracefully halts all running processes, logs out currently logged-in users, and unmounts filesystems.

#Prerequisites

To follow along, ensure you have the following:

Access to a Linux system. Any Linux system will do fine since the shutdown command is distribution-agnostic.

A sudo user configured on the system.

Deploy and scale your projects with Cherry Servers' cost-efficient dedicated or virtual servers. Get seamless scaling, hourly pricing, and premium 24/7 support.

#Syntax

The shutdown command takes the following syntax:

shutdown [OPTIONS]

#Shut down a Linux system immediately

To shut down a Linux system immediately, use the shutdown command with the now option:

sudo shutdown now

#Schedule system shutdown

There are two distinct approaches to scheduling a system shutdown. You can schedule shutdown after m minutes. This is known as the relative format.

For example, to shut down a system after 5 minutes, run the command:

sudo shutdown +5

shutdown-linux-system-after-m-minutes

On your terminal, you will see a notification showing the expected shutdown time with your current time as a reference point.

You can also schedule shutdown using the absolute time format, where you specify the exact time the system powers off in hh:mm format. The absolute shutdown command takes the syntax:

sudo shutdown hh:mm

For example, to poweroff the system at 3:45 am, run the command:

sudo shutdown 03:45

shutdown-linux-system-at-specific-time

#Display a custom message

You can broadcast a custom message notifying all logged-in users of an impending shutdown. This is usually done out of courtesy to alert users of a scheduled downtime. It gives them time to wrap up their work gracefully before the system goes down.

To do so, run the shutdown command as shown.

sudo shutdown hh:mm “message”

Where: hh:mm: is the time in 24-hr format message: is the string of the message to be displayed

For example, to shut down the system at 1:00 am and broadcast the message "System maintenance" run the command:

sudo shutdown 01:00 "System maintenance"

shutdown-linux-system-at-a-schduled-time

#Cancel scheduled shutdown

To abort or cancel a scheduled system shutdown, pass the -c switch to the shutdown command as follows.

sudo shutdown -c

cancel-shutdown-in-a-linux-system

To make it more meaningful, you can add a message to provide a descriptive reason for the cancellation.

sudo shutdown -c "Aborting system maintenance"

shutdown-a-linux-system-at-specific-time-and-print-message

#Reboot the system

In addition to powering off a system, the' shutdown' command allows you to restart the system. For example, to carry out an immediate reboot run:

sudo shutdown -r now

You can also schedule a reboot with the -r option. The command below reboots the system at 2 am.

sudo shutdown -r 2:00

reboot-linux-system-a-specific-time-with-shutdown-command

In addition, you can schedule a reboot after +m minutes, where m is the number of minutes. For example, to reboot your system after 30 minutes, run the command:

sudo shutdown -r +30

reboot-linux-system-after-30-minutes-shutdown-command

Also read: Top 20 Linux Network Commands

#Conclusion

You have learned how to use the shutdown command to power off and reboot the system. With the knowledge acquired, you can effectively bring down a Linux system immediately or at a scheduled time. Additionally, you can reboot and schedule system restarts at your convenience. Refer to the man pages for more information.

Cloud VPS Hosting

Starting at just $3.24 / month, get virtual servers with top-tier performance.

Share this article

Related Articles

Published on Mar 17, 2026 Updated on Mar 18, 2026

How to Install Claude Code on Ubuntu 24.04

Learn how to install Claude Code on Ubuntu 24.04 and unlock AI-powered coding, automation, and Git workflows to boost developer productivity.

Read More
Published on Mar 12, 2026 Updated on Mar 13, 2026

How to Install n8n on Ubuntu 24.04 Using Docker

Learn how to self-host n8n on Ubuntu 24.04 with Docker, PostgreSQL, and Caddy for secure, automated workflows. Get full control with Cherry Servers.

Read More
Published on Mar 8, 2026 Updated on Mar 9, 2026

Linux Tee Command Explained: Syntax, Examples & Use Cases

Learn the Linux tee command with practical examples. Save command output to files while displaying it in the terminal for logging, automation, and DevOps workflows.

Read More
No results found for ""
Recent Searches
Navigate
Go
ESC
Exit
We use cookies to ensure seamless user experience for our website. Required cookies - technical, functional and analytical - are set automatically. Please accept the use of targeted cookies to ensure the best marketing experience for your user journey. You may revoke your consent at any time through our Cookie Policy.
build: 2be8c3add.1729