In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what are the differences between linux shutdown commands, I hope you will gain something after reading this article, let's discuss it together!
The difference between the linux shutdown command: 1, the shutdown command is used to safely shut down the Linux system; 2, halt is the simplest shutdown command, which actually calls the [shutdown-h] command; 3, the function of reboot is to restart; 4. Init is the ancestor of all processes, and its process number is always 1.
The difference between the linux shutdown command:
1 、 shutdown
The shutdown command is used to safely shut down the Linux system. Some users will turn off the Linux by directly disconnecting the power supply, which is very dangerous. Because Linux is different from Windows, there are many processes running in the background, so forced shutdown may cause the data loss of the process, make the system in an unstable state, and even damage the hardware equipment.
When you execute the shutdown command, the system notifies all logged-in users that the system is about to shut down, and the login instruction is frozen, that is, new users can no longer log in to the system. Use the shutdown command to shut down the system directly, delay shutting down the system for a specified time, or restart it. Delaying the shutdown of the system at a specified time allows users time to save files that are currently being processed and to close open programs.
Some of the parameters of the shutdown command are as follows:
[- t] specify how long to shut down the system
[- r] restart system
[- k] doesn't really turn it off, just sends a warning signal to each logged-in user.
[- h] shut down the system (halt)
The essence of the shutdown command is to send a signal (signal) to the init program, requiring it to switch the running level of the system (Runlevel). The running levels of the system include:
0: shut down the system
1: single-user mode, if you execute directly without specifying the-h or-r parameters for the shutdown command, it will be switched to this run level by default
2: multi-user mode (NFS is not supported)
3: multi-user mode (supports NFS), which is commonly used.
5: multi-user mode (GUI mode)
6: restart the system
2 、 halt
Halt is the simplest shutdown command, which actually invokes the shutdown-h command. When halt is executed, the application process is killed, and the kernel is stopped after the file system write operation is complete.
Some of the parameters of the halt command are as follows:
[- f] forced shutdown or restart without calling shutdown
[- I] turn off all network interfaces before shutting down or restarting
[- p] call poweroff when shutting down, which is the default option
3 、 reboot
Reboot works like halt in that it restarts, while halt shuts down. Its parameters are also similar to halt.
4 、 init
Init is the ancestor of all processes, and its process number is always 1. Init is used to switch the running level of the system, and the switching is done immediately. The init 0 command is used to immediately switch the system runlevel to 0, that is, shutdown, and the init 6 command is used to switch the system runlevel to 6, that is, to restart.
After reading this article, I believe you have a certain understanding of "what are the differences between linux shutdown commands". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for your reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.