Linux shutdown and restart commands

Source: Internet
Author: User

In linux, shutdown and restart systems include shutdown, halt, reboot, and init. For them, their internal work processes are different.

1. shutdown command

It can be used to safely shut down the system. However, when the system is shut down, it will notify all logged-on users that the system will be shut down and all commands will be frozen, that is to say, all new users cannot log on again. Using this command will immediately shut down or restart and shut down or restart after a delay of some time. (Note: Only super users can use this command)

Command syntax format:

Shutdown [Option] [time] [Warning Information]

Description of the options in this command:

-K: only sends a warning message to the user.

-R: Shut down the system and restart the system.

-H: Do not restart the system after the system is shut down

-F: Quickly shut down the system, but does not perform disk detection when the system is restarted (during the experiment, the system enters the bios interface, but cannot perform any operations)

-N: Quickly shut down the system without the init program.

-C: Shut down the system. (no experiment is found)

2. halt command

The halt command calls the "shutdown-h" command to close the system.

Command syntax format;

Halt [Option]

-W: Not really shut down the system, but write "wtmp" (/var/log/wtmp) records.

-D: Do not write "wtmp"

-F: Disable it forcibly instead of calling "shutdown ".

-I: Disable all network uo interfaces before shutting down the system or restarting the system.

-P: This option is the default option. When the system is shut down, "power off" is called"

3. reboot Command

The reboot command is similar to the halt command, but reboot causes host restart. All its parameters are similar to "halt.

4. init command

The init command uses the system's running level control system. It is the ancestor of all system processes, and its Process number is always 1. Therefore, sending a "TERM" signal to init will terminate all user processes and daemon processes, "shutdown" means this mechanism is used. Init 0 is used to shut down the system, and init 1 is used to restart the system.

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.