Home >System Tutorial >LINUX >What are the Linux system restart commands?

What are the Linux system restart commands?

下次还敢
下次还敢Original
2024-04-12 12:45:14691browse

There are several common commands to restart the Linux system: 1. reboot to restart the system; 2. systemctl reboot to use the systemd service manager to restart; 3. init 6 to restart at run level 6; 4. shutdown -r to shut down and restart the system. Automatically restart; 5. poweroff -r shuts down and automatically restarts.

What are the Linux system restart commands?

Linux system restart command

In the Linux system, there are several commonly used commands that can be used to restart the system.

1. reboot command:

The reboot command is the most commonly used reboot command. It will reload the kernel and reboot the system.

<code class="bash">reboot</code>

2. systemctl reboot command:

The systemctl reboot command uses the systemd service manager to restart the system. It provides some additional options, such as specifying the target runlevel or startup mode.

<code class="bash">sudo systemctl reboot</code>

3. init 6 command:

The init 6 command puts the system into run level 6, which will cause the system to restart.

<code class="bash">sudo init 6</code>

4. shutdown -r command:

shutdown -r command will shut down the system and automatically restart it.

<code class="bash">sudo shutdown -r now</code>

5. poweroff -r command:

The poweroff -r command will shut down the system and automatically restart it, similar to shutdown -r.

<code class="bash">sudo poweroff -r</code>

Note:

  • Be sure to save any unsaved changes before running the restart command.
  • If the system encounters a problem and cannot restart, you can use the "force" option to force a restart. For example:
<code class="bash">sudo shutdown -r now -f</code>

The above is the detailed content of What are the Linux system restart commands?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn