shutdown is the traditional command for halting, powering off, or rebooting the system. It supports scheduling and a message broadcast to logged-in users, features cron jobs and sysadmins have long relied on.
sudo shutdown -h now # halt immediately
sudo shutdown -P +5 # power off in 5 minutes
sudo shutdown -r 23:00 # reboot at 23:00
sudo shutdown -c # cancel a pending shutdown
sudo shutdown -k +10 "Maintenance" # send warning only, no actual shutdown
On systemd systems shutdown delegates to systemctl poweroff / systemctl reboot, so its behaviour is consistent with the rest of the service-manager ecosystem.
Discussed in:
- Chapter 13: System Services and systemd — systemctl: Controlling Units