The shutdown command under the Linux system is used to safely shut down/restart the computer

Source: Internet
Author: User

The shutdown command under the Linux system is used to safely shut down/Restart the computer, it can not only conveniently implement the timer shutdown, but also can be determined by the user when the relevant parameters of the shutdown. When executing the shutdown command, the system sends a screen display to each terminal (user), prompting the shutdown operation. Timed shutdown requires only a simple parameter, which can be a countdown or an exact time.

Command format
1 shutdown [选项] [时间] [消息]

and have the following options:

-K do not perform any shutdown operation, only send warning message to all users

-R Restart the computer

-H shutdown and power off completely

-F Fast Shutdown and skip fsck at restart

-N Fast shutdown without init program

-C Cancel the pre-timer shutdown

Real-World Application examples

Turn off the machine now

Shutdown-h now

Restart now

Shutdown-r now

Note that now cannot be omitted here, and is considered a special use.

Timer shutdown

If there are other commands to perform after 5 minutes of scheduled shutdown, or if you want to place a timed shutdown command in the background:

Shutdown-h +5 &

Then press ENTER several times to continue using the terminal to perform other operations. If you want to terminate the 5-minute shutdown performed above, execute:

Shutdown-c

Can.

If the shutdown is only scheduled for 5 minutes and no other command is executed, the direct:

Shutdown-h +5

At this point, if you want to cancel the timer shutdown, press CTRL + C to force the termination of the command.

To shut down the computer at 20:13:

Shutdown-h 20:13

Note: Only users with super administrative privileges can use this command, and ordinary users do not have permission to execute the command. If a normal user executes the command, you may be prompted

1 bash: shutdown : command not found .

This occurs because of an environment variable problem with an ordinary user that prevents the shutdown program from being found properly. If you use the "su" command, be aware that the ENV environment variable is also switched to the root account, otherwise it may still be problematic.

The shutdown command under the Linux system is used to safely shut down/restart the computer

Related Article

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.