HOWTO · Linux

How to Shut Down a Linux Machine from the Terminal

Use the Linux shutdown command to power off now, schedule a shutdown, notify users, reboot, or cancel a pending shutdown.

On this page

Use the shutdown command to power off a Linux machine now or schedule it for later. You can also use it to reboot or cancel a pending shutdown. Save your work before running an immediate shutdown or reboot; these commands affect the whole machine.

Understanding the shutdown Command

The general form is shutdown [OPTION] [TIME] [MESSAGE]. TIME can be now, a delay such as +10, or a clock time such as 23:30. Use -r to reboot, and -c to cancel a pending shutdown. A message is optional. On many systems, the command requires administrator privileges, so prefix it with sudo when needed; privilege setup and time interpretation can differ by system.

Shut Down a Linux System Immediately

To shut down now, run sudo shutdown now in a terminal. If your account does not use sudo, use the system’s configured administrative method. Save open files and stop important tasks first. This command affects the machine, and the exact shutdown handling depends on the system configuration.

Schedule a Shutdown

For a shutdown ten minutes from now, use sudo shutdown +10. The number is a relative delay in minutes. To request a clock time, use sudo shutdown 23:30; the interpretation of clock times can vary between implementations, so check the local shutdown manual if timing is critical. Scheduled actions may also be affected by system policy or another administrator.

Send a Message Before Shutdown

Append a quoted message after the time to include a notice with a scheduled shutdown, for example: sudo shutdown +10 "System maintenance in 10 minutes; please save your work." The message is intended to notify users through the system’s shutdown mechanism. Which sessions receive it depends on the system and their configuration, so use a separate communication channel when everyone must be reached.

Reboot a Linux System

Use sudo shutdown -r now to reboot immediately, or sudo shutdown -r +10 to schedule a reboot after ten minutes. The -r option requests a restart instead of powering off. Save work before an immediate reboot, just as you would before an immediate shutdown.

Cancel a Scheduled Shutdown

If a shutdown is still pending, run sudo shutdown -c to cancel it. The -c option cancels a scheduled shutdown; it cannot undo a shutdown that has already completed. Cancellation may require the same administrative privileges as scheduling the action.