Linux Shutdown restart command

Source: Internet
Author: User

Linux system shutdown Restart common commands:

1) Synchronize the data to the instructions on the hard disk: Sync

2) The usual shutdown instruction: shutdown

3) reboot, Shutdown: Reboot, Halt, Poweroff


Here is a detailed description of the role of the above directive:

Sync:

All the data has to be read into memory.can be processed by the CPU, but often the data needs to be written back to the hard drive (e.g., stored). The speed of the hard drive is too slow (relative to memory), if you often let the data in memory not hard disk write/read out, the system performance will not be too good. Therefore, in the Linux system, in order to add corporate data read speed, so in the case of obituary, some already loaded in memory of the data will be directly written back to the hard disk, but first in memory, so that if a data is rewritten by you repeatedly, then the He has not been written to the hard drive, so it can be read directly from memory, the speed must be corporate on a considerable number! , it also causes some confusion, that is, if your system is not properly shut down due to special circumstances (such as power outages or careless kicks to power), because the data has not been written to the hard disk, wow! So it will cause the data update is not normal ! How is that going to be held? This is the time to sync this led order to import the writing of the line data! Enter sync directly under the text interface, and the data that has not been updated in memory will be written to the hard drive! Therefore, this led order before the system shutdown ring restart , the path is important Oh! It's best to do it several times! Although the current Shutdown/reboot/halt and so on led order are already in the shutdown before Import line sync This tool call, however, do more times always more reassuring point.

$ syncNote:sync can be used by a general account, but the average account user's updated hard drive data is only their own data, and root can update the entire system's data.
Shutdown:syntax rule: shutdown [-t (sec)] [-ARKHNCF] time [warning message]

the time parameter is the parameter that must be loaded!!!

< Span style= "font-size:12pt" > For example: Shutdown-h now   shutdown immediately;

< Span style= "font-size:12pt" > Shutdown-h 20:25   20:25 shut down;

< Span style= "font-size:12pt" >shutdown-h +10   shut down in 10 minutes;

< Span style= "font-size:12pt" >shutdown-r now   restart immediately;

< Span style= "font-size:12pt" > Shutdown-r +30 ' would reboot ' 30 minutes after reboot and display "'ll reboot" message to online users

< Span style= "font-size:12pt" > shutdown-k now ' will reboot ' send only "will reboot" message to online users with warning, not back to real shutdown!

Reboot,halt,poweroffto restart the shutdown task, these instructions are to complete the same work, however, shutdown can be based on their own services to shut down the service after a successive shutdown, halt can ignore the current system conditions, direct hardware shutdown special functions.
Toggle Execution Level: init The mode of operation of the system is divided into plain text (run Level 3) and figure Shape interface mode (Run Level 5). In addition to these two modes, is there any other mode? In fact, there are seven levels of implementation of Linux, seven run Level 0: Shutdown
run level 3: Plain text mode
 run Level 6: Restart So how do you switch between the modes? You can use the Init led order to deal with it! In other words, if you want to shut down, you can also use the following led order to shut down the shutdown-h now and Poweroff: $ init 0:



Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux Shutdown restart command

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.