Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the commonly used shutdown / restart commands in ​ linux

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article is about the shutdown/restart commands commonly used in linux. Xiao Bian thinks it is quite practical, so share it for everyone to make a reference. Let's follow the editor and have a look.

The most common shutdown/restart commands in Linux are shutdown, reboot, init, halt, and poweroff. They all work to restart the system, but the internal workings of each command are different.

1. Shutdown command

The shutdown command is the most common and safest shutdown and restart command. It calls fsck to check the disk before shutdown, where-h and-r are the most common parameters:

● -h: Stop system service and shut down

● -r: Restart after stopping system service

Examples:

shutdown -h now --shutdown immediately shutdown -h 10:53 --shutdown until 10:53, if this time is less than the current time, then to the next day shutdown -h +10 --10 minutes automatic shutdown shutdown -r now --restart immediately shutdown -r +30 'The System Will Reboot in 30 Mins' - -Restart after 30 minutes and send notification to other online users

2. Reboot command

reboot indicates an immediate restart, which is equivalent to shutdown -r now.

3. The init command

Init is the ancestor of all processes, and its process number is always 1, so sending the $TERM signal to init will terminate all user processes, daemons, etc. Shutdown uses this mechanism. init defines eight runlevels, init 0 for shutdown and init 1 for restart.

4. halt command

The halt command is the simplest shutdown command, which is essentially a call to shutdown -h. Halt execution, regardless of the current system status, hardware shutdown; kill application process, execute sync system call, file system write operation will stop the kernel.

5, poweroff command

poweroff means shutdown immediately, the effect is equivalent to shutdown -h now, not recommended in multi-user mode (Run Level 3).

Thank you for reading! What are the commonly used shutdown/restart commands in linux to share here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge. If you think the article is good, you can share it so that more people can see it!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report