Home> System Tutorial> LINUX> body text

Linux restart command list

WBOY
Release: 2024-02-22 14:30:05
Original
1294 people have browsed it

Linux, as an open source operating system, is widely used in servers and personal computers. In the process of using the Linux system, you often encounter situations where you need to restart the system, such as software installation, system updates, etc. So, what are the restart commands in Linux? This article will introduce you to the detailed instructions and specific code examples of the Linux restart command.

  1. reboot command

The reboot command is the most basic restart command, it will restart the system immediately. When using the reboot command, you do not need to add any parameters.

Specific code examples:

reboot
Copy after login
  1. shutdown command

The shutdown command is a command used to shut down the system. It can also be used to restart the system. If you need to restart the system, you can use the parameter -r.

Specific code examples:

reboot -r
Copy after login
  1. init command

The init command is used to initialize the system and can also be used to restart the system. Use parameter 6 to implement the function of restarting the system.

Specific code examples:

init 6
Copy after login
  1. systemctl command

The systemctl command is a tool used to manage systemd services. It can control the start and stop of the system. and reload. Use the systemctl reboot command to reboot the system.

Specific code examples:

systemctl reboot
Copy after login
  1. telinit command

The telinit command is also a command used to initialize and control the system. It can be used to restart the system. Use parameter 6 to implement the function of restarting the system.

Specific code example:

telinit 6
Copy after login
  1. shutdown now command

The shutdown now command is a command used to shut down the system immediately, and can also be used to restart the system . If you need to restart the system, you can add the parameter -r.

Specific code example:

shutdown -r now
Copy after login
  1. reboot command (by triggering an event)

Thereboot command can also trigger an event to implement the system restart function. You can use the echo command to add the string reboot to a file in the /sys directory to trigger a system restart.

Specific code examples:

echo "reboot" > /sys/kernel/debug/kprobe_events
Copy after login

Summary:

In Linux, there are a variety of commands to choose from to restart the system. Use these commands to flexibly manage and maintain the system according to actual needs. Whether it is a server or a personal computer, it is very important to understand and master these restart commands. I hope this article can be helpful to everyone when using Linux systems.

The above is the detailed content of Linux restart command list. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!