Originally Posted by RaviTezu
$sudo init 0 to shutdown
$sudo init 6 to reboot
Note: You should have the required privileges to run those commands.
It's always recommended to use shutdown
command instead of init
to shutdown or reboot a system.
is allowed command for a normal user, whereas init
can be executed by super user only.
is safe and interactive and it can be executed with a message to logged in users, whereas init is not interactive.
is basically used to switch between different run-levels, but not a primary option for shutdown or reboot.