X synchronize data to the instructions on the hard disk: Sync
X customary shutdown instruction: shutdown
x reboot, Shutdown: Reboot, Halt, Poweroff
"Data synchronously writes to disk: Sync"
All data must be read into the memory before it can be processed by the CPU, but often the data needs to be written back to the hard disk (for example, the stored action). Because the speed of the hard disk is too slow (relative to memory), if you often let the data in memory and hard disk write/read back and forth, the system performance is not too good.
Therefore, in the Linux system, in order to speed up the data read speed, so in the default case, some already loaded in memory of the data will not be directly written back to the hard disk, but the first temporary memory, so that if a data is rewritten by you repeatedly, then because he has not been written to the hard disk, So it can be read directly from memory, and it must be quite fast on speed.
Abnormal shutdown (e.g. power outage or accidentally kicked to power), because the data has not been written to the hard disk, wow! So it will cause the update of the data is not normal this time need to sync this command for data write action! Enter sync directly under the text interface, then the data that has not been updated in memory will be written to the hard drive! Therefore, it is best to perform a few more times before the system shuts down or restarts
In fact, sync can also be used by ordinary accounts only the average account user's updated hard drive data only has its own data, not like root can update the entire system of data
"Customary shutdown command: Shutdown"
Shutdown can achieve the following tasks:
X can freely choose the shutdown mode: is to shut down, restart or enter the single operation mode can be;
X can set the shutdown time: it can be set to shut down immediately, or set a specific time to shut down the machine.
X can customize the shutdown message: You can send your own messages to the online user before you shut down the computer.
X can issue only warning messages:
X you can choose whether you want fsck to check the file system.
Options and Parameters:
-T sec: the number of seconds after-T, meaning "shutdown after a few seconds"
K: Don't really shut down, just send a warning message out!
-R: Reboot after the service of the system is stopped (common)
-H: Shuts down the system immediately after the service is stopped. Common
-N: Shut down directly with shutdown function without the INIT program
-F: A disk check that forces a bypass of fsck after shutting down and powering on
-F: Force a disk check for fsck after the system restarts
-C: Cancels the contents of the shutdown instruction already in progress.
Time: This is the parameter that must be added! Specify when the system shuts down
Examples of several time parameters
[[email protected] ~]# shutdown-h now shuts down, where it corresponds to a state of 0
[[email protected] ~]# shutdown-h 20:25 system shutdown in today's 20:25 session, if this command is issued at 21:25, then the genius shut down the machine
[[email protected] ~]# shutdown-h +10 system automatically shuts down after 10 minutes
[[email protected] ~]# Shutdown-r now system restarts immediately
[[email protected] ~]# shutdown-r +30 ' The system will reboot ' in another 30 minutes, and the following message is displayed to all online users
[[email protected] ~]# shutdown-k Now ' This system would reboot ' only issue warning letter parameters! The system does not shut down! Scare People!
"Reboot, Shutdown: Reboot, halt, Poweroff"
"Toggle Execution Level: Init
The mode of operation of the system is divided into plain text (run level 3) and graphics interface mode (Run Level 5).
In addition to these two modes, is there any other mode? In fact, Linux has a total of seven levels of execution,
X Run Level 0: shutdown
X Run Level 3: Plain text mode
X Run Level 5: Contains graphics interface mode
X Run Level 6: Reboot
You can also use the following instructions to shut down the machine:
[[Email protected] ~]# init 0
Linux Proper shutdown method