Linux Command: Restart: Reboot or Shutdown

 
How to turn off or reboot the popular Linux versions: If you ever get lost on the Linux console of a server, PC, tablet, TV, media player, radio, router or any other Linux-based device, you can usually reboot the system with the "reboot" command.

Aim of this article

HowTo: Linux computer
shutdown or reboot

Effort

Reading time: approx. 4 Minutes

Prerequisite

Linux Device, Server or PC
The "shutdown" command can be used to shut down or reboot the system. The console can be called, depending on the device, via the connected screen or via telnet or putty from another computer over the network.

in 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

positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

Publication: 2022-07-13 from Bernhard | Übersetzung Deutsch |🔔 | Comments:0

Linux CronJobs - scheduled tasks | Debian crontab [explained] | Linux | Convert date: Unix Timestamp

Top articles in this section


Fan control Linux Debian: Fancontrol

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.


Linux folder used space - Bash TreeSize

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.


Debian or Ubuntu kernel update or change- current kernel

The currently available Linux kernel has the version: 6.8.7 (found: 2024-04-17). 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:

Questions / Comments


By continuing to browse the site, you agree to our use of cookies. More Details