When you are finished, it is not a good way to turn off the power directly. This may cause the updated files to be corrupted or even corrupt the file system directory structure. Linux has a number of secure shutdown and restart systems, which are outlined in this section.
Terminate or shut down the system
The init command allows you to modify the current runlevel, and for the shutdown system, the RunLevel value is 0, and here's an example:
[Root@bigboy tmp]# Init 0
Fedora also uses the shutdown command to accomplish the same function. You often need to confirm that the shutdown command is being executed, and you can cancel the execution of the shutdown command by using the-y switch. The-h switch indicates that the system is immediately forced to stop running, and the first parameter confirms how long it waits to execute the command after the start of the program, where the example is 0 minutes. You can also specify a time of day to turn off the system and see the man page for details. Another useful feature is that the shutdown command notifies the consumer that the system is about to close.
[Root@bigboy tmp]# shutdown-hy 0Broadcast message from root (pts/0) (Sat modified 6 13:15:27]: The system is on System Halt now! [Root@bigboy tmp]#
Reboot the system
You can change the RunLevel 6 reboot system immediately through the init command.
[Root@bigboy tmp]# Init 6
The reboot command has the same functionality and sends a warning message to all users.
[Root@bigboy tmp]# rebootbroadcast message from root (pts/0) (Sat modified 6 12:39:31): "System is on down for reboot now! [Root@bigboy tmp]#
A better way to restart the system is to use the shutdown-r switch and to specify a restart delay time, in this case, 10 minutes.
[Root@bigboy root]# shutdown-ry 10Broadcast message from root (pts/0) (Sat modified 6 13:26:39]: The system is on Reboot in minutes! Broadcast message from root (pts/0) (Sat modified 6 13:27:39): The system was on down for reboot in 9 minutes!......... Broadcast message from root (pts/0) (Sat modified 6 13:36:39): "System is on" for reboot now!
Enter Single user mode
Some tasks need to force you to quit all users, End http://www.aliyun.com/zixun/aggregation/2595.html "> third-party applications and disconnect from the network so that you can enter the system as a separate system administrator through the VGA console. A typical task is to add a new hard disk or to maintain a failure for the startup process. Another reason to use it is to restore your root password.
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.