"Pick" Linux shutdown, halt and reboot commands detailed

Source: Internet
Author: User

When you restart the Linux system and write the information in memory to the hard disk, you should use the () command to implement

    • #shutdown-R Now
    • #halt
    • #reboot
    • #init3

Correct answer: A

In the Linux command, reboot is restarted,shutdown-r now stops and restarts, saying that both of them are the same, in fact there is a certain difference .

The Shutdown command can safely shut down or restart the Linux system, prompting a warning message to all logged-in users on the system before the system shuts down. The command also allows the user to specify a time parameter, which can be either an exact time or a time period from now on.

The exact time format is hh:mm, which represents hours and minutes, and the time period is represented by the number of + and minutes. After the system executes the command, data synchronization is done automatically.

General format of the command: shutdown [options] [TIME] [warning message]

The meanings of the options in the command are:

-K does not really shut down and just sends a warning message to all users

-Restart immediately after R shutdown

-H does not restart after shutdown

-F Fast Shutdown Restart when fsck is skipped

-N Fast shutdown without init program

-C Cancel an already running shutdown

Specifically, this command is only available to Superuser.

Example 1, the system shuts down after 10 minutes and restarts immediately: # Shutdown–r +10

Example 2, the system shuts down immediately and does not restart: # shutdown–h now

Halt is the simplest shutdown command, which is actually called the shutdown-h command . When halt executes, the application process is killed and the kernel is stopped after the file system write operation is complete.

Some of the parameters of the halt command are as follows:

[-f] forced shutdown or restart without calling shutdown

[-i] turn off all network interfaces before shutting down or restarting

[-p] Call Poweroff when shutdown, this option is the default option

reboot work in a similar way to halt, and its role is to reboot, while Halt is shutdown. The parameters are similar to halt. The reboot command restarts the system by removing all processes, rather than terminating them smoothly. Therefore, using the reboot command can quickly shut down the system, but if there are other users working on the system, it will cause data loss. So the use of the reboot command is mostly in single-user mode .

Init is the ancestor of all processes whose process number is always 1. Init is used to switch the operating level of the system, and the job of switching is done immediately. The init 0 command is used to immediately switch the system RunLevel to 0, which is shutdown, and the init 6 command is used to switch the system RunLevel to 6, which is a reboot

"Pick" Linux shutdown, halt and reboot commands detailed

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.