How to Schedule a Shutdown on Linux

To schedule a one-time Linux power-off, run sudo shutdown --poweroff +30 to shut down in 30 minutes, or use a future 24-hour clock time such as 23:00. Cancel a pending shutdown with sudo shutdown -c. These commands use administrator privileges and apply to the machine where you run them.

Check the system clock first

A clock-time shutdown follows the computer’s local system clock. Before scheduling one, check the current time with date. On a systemd-based distribution, timedatectl also shows the configured time zone and whether the clock is synchronized. Save open work and consider other users or services: a shutdown ends sessions and interrupts programs running on that computer.

Choose a one-time shutdown time

Power off after a countdown

Open a terminal and enter the number of minutes from now after the plus sign. For example, this schedules a power-off in half an hour:

sudo shutdown --poweroff +30
Linux terminal example showing sudo shutdown --poweroff +30 beside a 30-minute countdown
Use a plus sign and a number of minutes to schedule a countdown.

Use +5 for five minutes or +90 for an hour and a half. To power off immediately, use sudo shutdown --poweroff now. The --poweroff option makes the intended action explicit. The command can also send a warning message to logged-in users:

sudo shutdown --poweroff +30 "This computer will power off in 30 minutes. Save your work."

On systemd, a timed shutdown warns users and prevents new logins shortly before the system goes down. On a shared workstation or remote server, give people enough notice and check that no important task is still running.

Power off at a clock time

To schedule a shutdown for 11 p.m. today, enter the time using a 24-hour clock:

sudo shutdown --poweroff 23:00
Linux terminal example showing sudo shutdown --poweroff 23:00 next to an analog clock
Enter a future time in 24-hour format, using the computer’s local clock.

The time is interpreted using the computer’s local clock, not UTC. If the time you enter has already passed today, the system may shut down immediately; it does not necessarily mean “tomorrow at that time.” Check date first, and use a countdown when you mean a duration from now. A clock-time command schedules one pending action, not a daily repeating rule.

Cancel or inspect the pending action

If plans change, cancel the scheduled shutdown before its deadline:

sudo shutdown -c
Linux terminal example showing sudo shutdown -c beside a red cancel symbol
The -c option cancels a pending timed shutdown.

On systemd version 250 or later, sudo shutdown --show displays the pending action and its scheduled time. That option is not available on every distribution or older release, so use -c to cancel and check your terminal’s help page if an option is rejected. The standard shutdown options and time formats are documented in the systemd shutdown manual.

Use rtcwake when you want sleep and an automatic wake

shutdown powers the machine off; it does not turn it back on later. If your goal is to suspend the computer and resume after eight hours, rtcwake can set an alarm and enter suspend-to-RAM:

sudo rtcwake --mode mem --seconds 28800
Linux terminal example showing sudo rtcwake --mode mem --seconds 28800 with night and sunrise symbols
This command requests suspend-to-RAM and an RTC wake alarm eight hours later.

This command suspends the computer immediately; it is not a scheduled power-off. The mem mode keeps the session in memory and still uses some power. Whether the system wakes at the requested time depends on the kernel, firmware, and real-time-clock hardware. If you need a full power-off with an attempted timed wake, sudo rtcwake --mode off --seconds 28800 requests that mode, but support varies by computer. Read the rtcwake manual and test the behavior before relying on it.

For a recurring shutdown

A command such as shutdown 23:00 creates a one-time shutdown. For a repeating schedule, create and enable a systemd timer that starts a power-off service at the desired calendar time. Timer units use calendar expressions and have options for handling missed runs; see the systemd timer documentation. Review the timer carefully before enabling it, especially on a shared or remote machine.

Quick troubleshooting

  • The computer shuts down immediately: Recheck the clock and time zone. A clock time that has already passed may be treated as due now. Use +30 for a 30-minute countdown.
  • The command asks for a password or fails with a permission error: Run it with an account authorized to use sudo. Do not leave out the privilege escalation on systems that require it.
  • The computer does not wake after rtcwake: The device may not support the requested suspend state or RTC alarm. Check firmware settings and the manual for your distribution and hardware.

For a single planned power-off, sudo shutdown --poweroff +minutes or sudo shutdown --poweroff HH:MM is the simplest approach. Use sudo shutdown -c if you need to cancel it.

Leave a Comment

How to Record Speaker Output on Linux with Audacity

How to Record Speaker Output on Linux with Audacity

Capture Linux desktop audio in Audacity by routing its recording stream to your output device’s monitor source. Follow PulseAudio and PipeWire steps, export tips, and fixes for silent tracks.

How to Use Dropbox on Linux: Install and Sync Your Files

How to Use Dropbox on Linux: Install and Sync Your Files

Install Dropbox on Linux from the official package, sign in, sync a local folder, manage selective sync, and check status from the command line.

How to Install Inkscape on Linux: Ubuntu, Fedora, Arch, and More

How to Install Inkscape on Linux: Ubuntu, Fedora, Arch, and More

Install Inkscape from your Linux distribution’s repositories, the Ubuntu stable PPA, Snap, or Flathub, with current commands and notes for choosing a package source.

How to Find and Remove Duplicate Files on Linux With FSlint

How to Find and Remove Duplicate Files on Linux With FSlint

Use FSlint to scan selected Linux folders, review duplicate groups, and safely delete redundant files or learn when hard-link merging is appropriate.

How to Install SABnzbd on Linux and Configure It

How to Install SABnzbd on Linux and Configure It

Install SABnzbd on Ubuntu or Debian, or run it in Docker on another Linux host. Then open the web interface and configure your provider and download folders.

How to Install the Paper GTK Theme on Linux

How to Install the Paper GTK Theme on Linux

Install the Paper GTK theme from supported Linux repositories, enable it for GTK apps in GNOME Tweaks, and see what the legacy theme can and cannot change.

How to Install and Set Up Plex on OpenMediaVault with Compose

How to Install and Set Up Plex on OpenMediaVault with Compose

The old OpenMediaVault Plex plugin is archived. Set up Plex on OMV 8 with OMV-Extras, the Compose plugin, persistent storage, and Plex’s official container.

How to Clean and Speed Up Ubuntu Safely

How to Clean and Speed Up Ubuntu Safely

Clean and speed up Ubuntu with safe APT cleanup, storage checks, and startup controls that help free space and troubleshoot a sluggish desktop.

How to Install the Hiri Email Client on Linux

How to Install the Hiri Email Client on Linux

Install Hiri on Linux with its Snap package or official tarball, add a desktop launcher, and check supported accounts plus a warning about Hiri’s old Snap release.

How to Get System Specifications for a Linux PC

How to Get System Specifications for a Linux PC

Use Fastfetch and built-in Linux commands to check your distro, kernel, CPU, memory, graphics, storage, and connected devices, then save a clear report.