Linux shutdown Command: Schedule a Shutdown or Restart
shutdown schedules a system power-off or restart immediately or at a specified time. It is useful for giving server users time to prepare and for canceling scheduled tasks if necessary.
What is the shutdown command?
In the systemd implementation, the default action is power-off, and if the time is omitted, it usually executes after 1 minute. now means immediately, +10 means after 10 minutes, and -r means restart. A scheduled shutdown can be canceled before execution with -c.
Basic syntax
sudo shutdown [option] [time] [message]
The installed implementation and options may vary depending on the distribution. Check the description for your current system with man shutdown.
Examples
Schedule shutdown in 10 minutes
Gives users time to finish their work and schedules the shutdown.
sudo shutdown +10 'Shutting down for maintenance in 10 minutes'
Schedule restart in 10 minutes
If a restart is needed, specify -r.
sudo shutdown -r +10 'Restarting the server in 10 minutes'
Cancel Reservation
Cancel before the reserved time and notify the user of the change.
sudo shutdown -c
Flow to check reservations and cancellations
shutdown can schedule a shutdown or reboot for later. The following are commands to schedule a reboot in 10 minutes and to cancel it, and should not be run on a production server for testing.
sudo shutdown -r +10 sudo shutdown -c
When scheduling, a message notifying other logged-in users of the planned shutdown time may be displayed. The output text varies depending on the distribution and session, so do not expect a fixed string.
-r is for reboot, -h is for shutdown. To cancel a scheduled shutdown, run shutdown -c before the reboot starts. Even after cancellation, a separate automation may reschedule the reboot, so in a real production environment, check the change management records and service status together.
Main Options and Format
| Options/Format | Description |
|---|---|
now |
Execute immediately. |
+N |
Execute after N minutes. |
-r |
Restart instead of shutting down. |
-P |
Specify shutdown. |
-c |
Cancel a pending shutdown reservation. |
--show |
Display the reservation status on supported systemd versions. |
Precautions when using
The example will actually shut down or restart the server, so do not run it carelessly for learning purposes. Review the target tasks, users, services, and scheduled times, and prepare a means to access the console. shutdown -c only applies to scheduled tasks that have not yet been executed. Options and default behavior may differ depending on the implementation, so check the help for your current system.
Frequently Asked Questions
Can a scheduled shutdown be canceled?
You can cancel it by running sudo shutdown -c before the scheduled time. If the shutdown process is already in progress, cancellation cannot be guaranteed.
Official Documentation
The exact behavior of options and implementation differences can be found in the official documentation on shutdown.









