Forcing Linux To Shutdown Or Reboot

[cc lang=’bash’ line_numbers=’false’]shutdown -r NOW[/cc] [cc lang=’bash’ line_numbers=’false’]halt[/cc] [cc lang=’bash’ line_numbers=’false’]reboot[/cc] not working for you?

To force a shutdown:

[cc lang=’bash’ line_numbers=’false’]echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger[/cc]

And for a reboot:

[cc lang=’bash’ line_numbers=’false’]echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger[/cc]

Thanks to Nasser Heidari for the tip.

Tagged with:
Posted in Command Line Tricks, Servers, Tech Blog

Leave a Reply

Your email address will not be published.

*