[Getting started with Linux] Linux shutdown command Summary

Source: Internet
Author: User

The correct method should be used to shut down Linux.

Windows is a single-user, "fake" task, so even if your computer is shut down, it will not affect others. However, in Linux, because every program is executed in the background, many people may work on your host at the same time behind the screen that you don't see. Otherwise, the file system may be damaged. Therefore, under normal circumstances, pay attention to the following things When shutting down:

(1) view the system usage status.

To see who is online, you can use the who command. To view the online status of the network, run the netstat-a command. The program running in the background can execute the PS-Aux command.

(2) Notify online users of the shutdown time

In this case, you can use the shutdown command.


Shutdown command:

Syntax: shutdown [-T seconds] [-arkhncff] Time Warning Message (single quotes)

-T: The following description indicates shutdown after several seconds.

-K: only a warning message is sent if the instance is not shut down.

-R: restart after the system service is stopped.

-H: Shut down immediately after the system service is stopped.

-F: force The fsck disk check to be skipped after the instance is shut down and started.

-F: After the system is restarted, force the fsck disk check.

-C: cancels the content of the shutdown command.


In addition, the restart and shutdown Commands include reboot, halt, and poweroff. In fact, the same job is done by default.

Halt calls shutdown first, while shutdown calls halt at last. However, shutdown can be stopped only after the service is disabled based on the services already started. However, halt can perform special hardware shutdown functions in the current system.


In addition, there is also a shutdown command that is INIT 0

Init is a command to switch the execution level. There are 7 execution levels in Linux, and the following four levels are important:

Run level 0: Shutdown

Run level 3: Command Line-only mode

Run level 5: graphic interface mode

Run level 6: restart

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.