I'm familiar with and use shutdown
in Linux, and typically just do
> shutdown -h now
But is there a way to stop shutdown from happening, say if I aim to shutdown 10 minutes from now and then in 5 minutes' time I discover I really don't want to shut down?
To cancel a shutdown, use the -c (cancel) option. Although you don't get any notification that your shutdown has been canceled, your logged in users do get notified. If you don't provide a time string a shutdown will be scheduled for one minute from now.
Enter the following command: shutdown -a . This command will cancel the scheduled shutdown for one time. You'll have to repeat this process if you want to cancel other scheduled shutdowns. Click OK (in the Run window) or ↵ Enter (in Command Prompt or PowerShell).
Linux system restart To reboot Linux using the command line: To reboot the Linux system from a terminal session, sign in or “su”/”sudo” to the “root” account. Then type “ sudo reboot ” to reboot the box. Wait for some time and the Linux server will reboot itself.
To shutdown Linux using the command line: To shutdown the Linux system open a terminal application. Then type “ sudo shutdown -n now ” to shutdown the box.
shutdown -c
is "cancel shutdown" on reasonably recent shutdown
s.
The syntax also supports shutdown -c <message>
for announcement purposes, so that's handy if other people use the machine.
You can use ps
to find the shutdown process and abort it, for example with ps|grep shutdown
.
Alternate and less eyeball-intensive versions of this:
pkill shutdown killall shutdown kill `cat /var/run/shutdown.pid`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With