Linux shutdown is simple

Source: Internet
Author: User

The correct way to shut down Linux is simple. We all know that we need to shut down without using a computer and protect the computer. But in windows, we are very familiar with shutdown; however, the program that shuts down properly in Linux is not familiar to netizens. Now let's reveal how to shut down the system! 1 prepare 1.1 observe system usage status before shutdown 1.2 notify online users of shutdown time 2 shut down Command 2.1 sync2.2 shutdown2.3 reboot2.4 halt2.5 poweroff3 execute level 3.1 levels 3.2 levels switch 1 prepare 1.1 observe system usage before shutdown status Online: who network status: netstat-a Program executed in The background: ps-aux1.2 notifies online users of shutdown Time + 2 "The machine will shutdown" # shutdown after 2 minutes, notify the online user 2 to shut down the command 2.1 sync to write data not written to the hard disk in the memory to the hard disk 2.2 shutdownshutdown now # shutdown immediately + 2 # shutdown after 2 minutes shutdown # shutdown at + 2 "The machine will shutdown" # shut down after 2 minutes, and Notify the online user to restart 2.3 reboot. After adding a parameter, the user can implement halt. The connection from poweroff2.4 halt to reboot is equivalent to the link from shutdown-h 2.5 poweroff to reboot, equivalent to halt 3 execution level 3.1 classification run level 0: shutdown run level 3: plain text mode run level 5: including graphic interface mode run level 6: restart 3.2 Level switch init 0 # Switch to level 0, that is, shutdown attached: shutdown, halt, poweroff difference Answer-text mb-10 code shutdown: Make the system shut down, refer to the existing explanation: "The command safely shuts down the system. It is very dangerous for some users to disable linux by directly disconnecting the power supply. Because linux and windows are different, many processes are running in the background, therefore, force shutdown may lead to data loss in the process, making the system unstable, or even damaging hardware in some systems.

When the shutdown command is used before the system is shut down, the system administrator notifies all logged-on users that the system will be shut down. The login command is frozen, meaning that new users cannot log on again. It is possible to directly shut down or shut down after a delay of a certain period of time, and may be restarted. This is determined by the signal that all processes receive from the system [signal. This allows programs such as vi to have time to store the files being edited, while programs such as mail and news can leave normally"
In addition, shutdown will execute the scripts under/etc/rc0.d/, that is, it will execute the runlevel 0 script. Halt does not. Poweroff: turning off the system power. poweroff is just the soft link of halt. The halt command is executed. The halt command can be understood as follows: halt calls shutdown-h. When halt is executed, the application process is killed and the sync system call is executed. After the file system write operation is completed, the kernel is stopped. The shutdown method in linux is very simple, but pay attention to some minor details, that is, whether the opened program is closed, to ensure the security of the computer after the shutdown!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.