Linux shutdown Command with Examples
Linux shutdown Command with Examples
com/kb/linux-shutdown-command
All users and system administrators should know how to shut down an operating system safely. Linux has a shutd
own command to help turn off the machine.
The command offers several options when shutting down a Linux system, such as scheduling at a specific time,
shutting down immediately, or broadcasting a unique message to all users before the shutdown.
This guide will show you how to use the Linux shutdown command with examples.
Prerequisites
• Access to the command line/terminal.
• Root or sudo privileges.
Note: To reboot instead of shutting down the system, refer to How to Restart or Reboot Linux
Server from Command Line.
Option Description
-H
--halt Stops the system by halting all CPU functions.
Note: Use the --help option or man command to see more information about the command and its
options.
The output shows the scheduled shutdown time. The sections below show advanced usage.
sudo shutdown +5 "Shutdown in 5 minutes. Please save all your work." Copy
The command schedules a shutdown in 5 minutes, informs all users, and shows the provided message in their
terminal.
The command does not show any output. The message shows to all logged-in users, but the system continues running.
Use this option to notify users about upcoming maintenance or to test a broadcast message.
Note: Another way to broadcast messages to users in Linux is via the wall command.
The command doesn't show any output. To inform other users, add a broadcast message while cancelling:
The command stops the operating system and all processes without powering off the machine.
Conclusion
This guide showed all the basic shutdown commands every Linux user should know. The command is a safe way to
shut down your system and inform all users about scheduled shutdowns.
For other Linux commands, see our comprehensive lists of Linux commands all users should know.