Linux basics-shutdown and restart commands such as shutdown and reboot, shutdownreboot

Source: Internet
Author: User

Linux basics-shutdown and restart commands such as shutdown and reboot, shutdownreboot
I. Functions of the shutdown and restart command

I believe that people who have been in touch with computers, especially for windows systems, will feel a little stuck if they have been using it for a long time without restarting. However, after the entire system is restarted, it seems that the system is no longer running. After the restart, the windows system will reset the entire service, just like restoring the factory settings. Maybe the restart is just like this. In Linux, it is also necessary to shut down and restart the server. in Linux, it is often caused by restart and shutdown of the server, maintenance of the system, and launch of a new system. For example, shutdown, reboot, and halt commands can be used. This is a command that must be learned in Linux.

2. Common shutdown and restart commands

(1) shutdown option time: perform an operation at the specified time. If the user is not a root user, enter the logon password. The options are as follows:

-H: Shutdown

-R: restart

-C: cancel the previous shutdown command.

(2) Other shutdown commands:

Halt: Shut down. It can only be used by the root user.

Poweroff: Shut down. Non-root users need to enter the logon password.

Init 0: Shut down. Non-root users need to enter the logon password.

(3) other restart commands:

Reboot: restart. Non-root users need to enter the logon password.

Init 6: restart. Non-root users need to enter the logon password.

Iii. effect demonstration

(1) Use the shutdown command to immediately perform the shutdown operation. The Linux Command is as follows, as shown in Figure 3-1. The figure shows that Linux is shutting down.

 

1 shutdown -h now

  

  

Figure 3-1

(2) Use the shutdown command to immediately restart and shut down. The Linux Command is as follows, as shown in Figure 3-2. The figure shows that Linux is restarting.

 

1 shutdown -r now

  

Figure 3-2

 

Finally, other commands for shutdown and restart will not be demonstrated. I personally recommend the shutdown command for how to select so many shutdown commands. Because the shutdow command can be used to execute an operation at a specified time, and the command is relatively secure and secure, it will save the information about the ongoing service and then execute an operation.

 

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.