Linux Command: Restart: Reboot or Shutdown
Aim of this article
HowTo: Linux computershutdown or reboot
Effort
Reading time: approx. 4 MinutesPrerequisite
Linux Device, Server or PCin short:
Action | Command |
---|---|
reboot | reboot |
Shutdown | shutdown |
Terminal
Start the terminal:
or connect from a terminal to another computer over the network using SSH:
ssh user@192.168.1.xx
Restart command
A Linux computer or a device with Linux installed can usually be restarted with the help of the following command:
reboot
Alternatively, the reboot also works via this command
shutdown -r 0
or
init 6
If there are not enough rights for restarting or shutting down, either a password prompt will appear:
or the following or a similar error:
shutdown: administrator rights ("root" rights) required
Here helps with Ubuntu, for example, the "sudo" command, so:
sudo shutdown -r 0
sudo reboot
or
sudo init 6
Shutdown command
Switch off or shut down goes with the command
shutdown -h 0
oder
init 0
Ubuntu, maybe:
sudo shutdown -h 0
or
sudo init 0
Reboot command details
reboot --help
Call: reboot [OPTION]...
Restart the system.
Options:
-n, --no-sync don't sync before reboot or halt
-f, --force force reboot or halt, don't call shutdown(8)
-p, --poweroff switch off the power when called as halt
-w, --wtmp-only don't actually reboot or halt, just write wtmp
record
-q, --quiet reduce output to errors only
-v, --verbose increase output to include informational messages
--help display this help and exit
--version output version information and exit
This command is intended to instruct the kernel to reboot or shutdown the system.
or shutdown; if it is called without the -f option, or if the system is in any
the system is in a runlevel other than 0 or 6, it will execute
execute /sbin/shutdown.
Shutdown command details
~ $ shutdown --help
Call: shutdown [OPTION]... ZEIT [NACHRICHT]
Shut down the system.
Options:
-r reboot after shutdown
-h halt or power off after shutdown
-H halt after shutdown (implies -h)
-P power off after shutdown (implies -h)
-c cancel a running shutdown
-k only send warnings, don't shutdown
-q, --quiet reduce output to errors only
-v, --verbose increase output to include informational messages
--help display this help and exit
--version output version information and exit
crontab Reboot : automatic reboot
For an automatic reboot at specific times, see: Linux crontab Reboot

{{percentage}} % positive

THANK YOU for your review!
Top articles in this section
The currently available Linux kernel has the version: 6.5.5 (found: 2023-09-23). Source: www.kernel.org. The Linux distributions, as an example Debian or Ubuntu used new kernel versions only with some delay, accordingly the used kernel versions are usually somewhat older. Which kernel is active on a Linux system can be read out with the following command:
After I installed a fan in my NAS, it always ran at top speed. In the BIOS I could set the speed, but the automatic mode did not work properly. Using the service fancontrol the speed of the fan can be linked to any sensor and any threshold and controlled automatically.
To find out which folder needs how much space, the command “du” can be used on Debian. For an even better overview there is the commandline tool ncdu, which can analyze all folders similar to TreeSize.