Linux shutdown on a terminal

Source: Internet
Author: User
Shut down Linux on a terminal-general Linux technology-Linux technology and application information. For details, refer to the following section. Shutdown-h now shut down immediately
Shutdown-r now restart now

Linux Command: shutdown

Function Description: system shutdown command.
Syntax: shutdown [-efFhknr] [-t seconds] [time] [Warning Information]
Note: The shutdown command can shut down all programs and restart or shut down the program as needed.

Parameters:
-C when executing the "shutdown-h 11: 50" command, you only need to press the + key to interrupt the command for shutdown.
-F does not execute fsck (Disk maintenance) when the instance is restarted ).
-F: Execute fsck when restarting.
-H: Shut down the system.
-K only sends information to all users, but does not actually shut down.
-N does not call the init program to shut down, but is implemented by shutdown itself.
-Re-start after r shutdown.
-T <秒数> The number of seconds between sending the warning message and deleting the message.
[Time] How long will the shutdown command be executed.
[Warning Information] information to be sent to all login users.

Reboot quick restart (skip the sync process, that is, synchronize)

Startup level (0 ~ 6) at/etc/inittab:
Detailed explanation of each running level:
0 indicates that the machine is shut down. (Do not set this level)
1 is the single-user mode, just like the security mode in Win9x.
2: multi-user mode, but not supported by NFS.
3 is a complete multi-user mode, which is a standard operation level.
4. Generally, you can use it to do things in some special cases. For example, you can switch to this mode to make some settings when the battery of your laptop is exhausted.
5 is X11, And it enters the X Window System.
6. Restart the init 6 server. (Do not set this level)

Differences between shutdown, Halt, init, and reboot:
When the shutdown is called, it sends a signal (signal) to the init program and requires it to change the runlevel. The specific parameter determines (close or restart ).

Both halt and reboot are links to a shutdown command. halt is equivalent to shutdown-h now, that is, shutdown; reboot is equivalent to shutdown-r now, which is used to restart the system.

As the first program in Linux, Init has multiple runlevels, such as 0-Close 1-Single User Mode 3-character interface 5-graphic interface 6-restart, therefore, the use of Init for shutdown or restart operations is similar to shutdown, and more direct than shutdown (do not need to send a signal ).
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.