How Linux shuts down properly

Source: Internet
Author: User

In fact, most of the Linux domain is used on the server, rarely encountered the shutdown operation. After all, running a service on the server is endless, unless in exceptional circumstances, the last resort will be turned off.

Linux is different from Windows, under Linux, because every program (or service) is executed in the background, so there may be quite a few people working on your console at the same time behind the screen you can't see, such as browsing the web, sending letters, sending files by FTP, etc. If you just press the power switch to shut down, other people's data may be interrupted! That would be a headache! In addition, the biggest problem is that if the shutdown is not normal, it can cause file system damage (because it is too late to write data back to the file, so some service files will be problematic!) )。

If you are shutting down, you must ensure that no other users are online in the current system. Can releaseWho this directive, and if > Look at the background execution of the program can execute Ps-aux This command. Use these instructions to let you know a little about the current state of the host! (these commands will be mentioned in a later section, so just understand!)

* Sync synchronizes data from memory to the hard disk.
* shutdown shutdown instructions, you can see the help document with man shutdown. For example, you can run the following command to shut down:
* shutdown-h ' This command tells you that the computer will shut down after 10 minutes and will be displayed in the current screen of the logged-on user.
* shutdown-h now shut down immediately
* shutdown-h 20:25 The system will shut down 20:25 today
* shutdown -H +10 shut down after 10 minutes
* shutdown-r now system restarts
* shutdown-r +10 system 10 minutes after restart
*< Strong>reboot is the restart, equivalent to Shutdown-r now
* halt shutdown system, equivalent to Shutdown-h now and Poweroff

In conclusion, command to shut down has shutdown-h now, Halt, Poweroff and init 0, the command to restart the system has Shutdown-r now, reboot, Init 6.

How Linux shuts down properly

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.