On Rocky Linux, shut down the system immediately with sudo shutdown now. To schedule a shutdown, use sudo shutdown +10 for ten minutes from now, or sudo shutdown 22:30 for a specified time. Save your work first: a shutdown ends running sessions and can interrupt services.
What the shutdown command does
Rocky Linux is an enterprise Linux distribution that uses systemd to manage the operating system and its services. The shutdown command requests an orderly change in system state. For a normal shutdown, it warns users when applicable, stops services, unmounts filesystems as the system permits, and then powers off the machine. This is different from simply cutting power, which can leave pending writes incomplete.
The command generally requires administrator privileges. Run it as root or prefix it with sudo; without sufficient permission, it will fail rather than shut down the machine. The exact experience can vary with system configuration, active user sessions, and whether the machine is physical, virtual, or managed by an external platform.
Common shutdown examples
Use these forms in a terminal, adjusting the time and message to suit your situation:
sudo shutdown now— begin shutdown immediately.sudo shutdown +5— schedule shutdown in five minutes.sudo shutdown 23:00— schedule shutdown for 11 p.m. in the system’s local time.sudo shutdown -h now— explicitly request a halt; on a typical modern system, this powers the machine off.sudo shutdown -r now— restart instead of powering off.sudo shutdown +10 "Maintenance starts soon; please save your work"— schedule the shutdown and send a warning message to logged-in users.
For a scheduled shutdown, +10 means ten minutes from the time the command is run, not a clock time. A value such as 22:30 is interpreted as a time of day. Check the machine’s clock and time zone if the schedule matters. In a remote shell, quote a message with spaces so the shell passes it as one argument.
Choosing between shutdown, poweroff, and reboot
Use shutdown when you want a clear, optionally scheduled shutdown or restart, especially on a shared system where advance notice is helpful. Other systemd commands are also available:
sudo systemctl poweroffrequests that the system power off.sudo systemctl rebootrequests a restart.sudo systemctl halthalts the operating system; depending on the hardware and configuration, halting may not remove power.
For everyday use, shutdown now and systemctl poweroff are both conventional choices for powering off. The word “halt” is sometimes misunderstood: it does not always mean that electricity is physically disconnected. If the goal is to restart, choose a reboot command rather than powering off and assuming the machine will start again automatically.
Canceling a scheduled shutdown
If you set a future shutdown and need to stop it, run sudo shutdown -c before it begins. The cancellation option applies to a shutdown scheduled through the shutdown command; it does not undo a shutdown already in progress or cancel an unrelated job managed by another tool. If other users were warned, tell them the plan has changed, since a cancellation message or notice may not reach everyone in every configuration.
Before canceling, verify that you are acting on the intended host, particularly when several terminals or remote sessions are open. A scheduled time may be easy to confuse with a command issued on a different server.
Safety and troubleshooting
Before shutting down a server or workstation, consider what depends on it. Save files, close important applications, notify users, and check whether backups, updates, data transfers, or maintenance tasks are running. On a production system, follow its change-control and service procedures; a syntactically correct command can still cause an outage if issued at the wrong time.
- Permission denied: use
sudoif your account is authorized, or ask an administrator. Do not try to bypass access controls. - It shut down immediately: check whether you used
nowrather than a delay such as+10. Read the complete command before pressing Enter. - It did not power off: inspect the displayed error and system logs, and check the machine’s power-management or virtualization settings. A halted system and a powered-off system are not necessarily the same thing.
- A remote connection dropped: that is expected when the remote host shuts down. Ensure you have a way to access the machine again, such as a console or management interface.
A shutdown is not a substitute for repairing filesystem or hardware problems. Avoid forcing power off as a routine workaround for a command that appears slow; first determine whether services are still stopping or storage activity is in progress.
Frequently Asked Questions
What is the command to shut down Rocky Linux immediately?
Run sudo shutdown now. You can also use sudo systemctl poweroff to request that systemd power off the machine.
How do I shut down Rocky Linux after 10 minutes?
Run sudo shutdown +10. This schedules shutdown ten minutes after the command is issued; add a quoted warning message if other logged-in users should be notified.
How do I restart Rocky Linux from the terminal?
Use sudo shutdown -r now or sudo systemctl reboot. Both request a restart rather than a power-off.
How do I cancel a Rocky Linux shutdown?
For a shutdown scheduled with shutdown, run sudo shutdown -c before the scheduled time. It cannot reverse a shutdown that has already started.
Does shutdown -h turn off the computer?-h requests a halt. On many current Rocky Linux systems this results in power-off, but the exact behavior can depend on the system and its configuration. Use systemctl poweroff when you specifically want to request power-off.