I need to restart from the root command line
250,776
Solution 1
shutdown -r now
would do restart.
shutdown -h now
will halt/shutdown the system.
In Ubuntu's case, you can use reboot
or halt
, etc. They all invoke the shutdown
command.
man reboot
may help.
Solution 2
For shutting down:
sudo poweroff
(It immediately stops all the processes and shuts down the computer.)
For restarting:
sudo reboot
Edit: Once you are already running as a root you needn't type sudo.
See here for more options:
http://www.cyberciti.biz/faq/howto-reboot-linux/
http://www.cyberciti.biz/faq/howto-reboot-linux/
http://archive.oreilly.com/linux/cmd/cmd.csp?path=p/poweroff
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I need help restarting/shutting down from the root command line, any commands I could use? I don't like hard resetting
-
Rinzwind over 9 years"poweroff" works too to shutdown w/o reboot ;)
-
Byte Commander over 9 yearsThe OP mentioned that he is already inside a root shell, so no
sudo
is required. Otherwise your answer is ok, except that you could add a bit additional explanations what those commands do... (because it appeared in the Low-Quality review queue because of its length)