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, we know the correct method for shutting down Linux is simple. if we don't use a computer, we need to shut down 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, force shutdown may lead to data loss in the process? Make the system unstable? In some systems, hardware is damaged.

And use the shutdown command before the system is shut down? The system administrator notifies all logged-on users that the system will be disabled. And the login command will be frozen? That is, new users cannot log on again. Is it possible to directly shut down or wait for a certain period of time to shut down? It may also be restarted. This is determined by the signal that all processes receive from the system [signal. Does this allow programs like vi to have time to store the files currently being edited? Programs like 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? Killing an application process? Execute sync system call? After the file system writes, 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!
Related Article

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.