What is linux shutdown command

What is linux shutdown command

Linux is a free to use and free dissemination of class Uix operating system, is a POSIX and UNIX-based multi-user, multi-tasking, multi-threading and multi-CPU support for the operating system. So what linux shutdown command? Here I will introduce the linux shutdown command, and quickly look at it.

In some common linux shutdown / restart command has shutdown, halt, reboot, and init, they can achieve the purpose of restarting the system, but the internal workings of each command is different.

Linux centos restart command:

1、reboot

2, shutdown -r now reboot immediately (root users)

3, shutdown -r 10 10 minutes and automatically restart (root users)

4, shutdown -r 20:35 to 20:35 at the time when the restart (root users)

If the restart is set by the shutdown command, you can use the command shutdown -c cancel the restart.

Linux centos shutdown command:

1, halt immediately shut down.

2, poweroff immediately shut down.

3, shutdown -h now shutdown immediately (root user).

4, shutdown -h 10 10 minutes after the automatic shutdown.

If the shutdown is set by the shutdown command, you can use the command shutdown -c cancel the restart.

linux shutdown command to restart the command _Li

1、shutdown

shutdown command to shut down the system safely. Some users will use a direct way to cut off the power supply to shut down linux, which is very dangerous. Because different linux and windows, its many processes running in the background, so the forced shutdown process may result in data loss, so that the system is in an unstable state, even in some systems may damage the hardware.

And using the shutdown command before the system shutdown, the system administrator will inform all users logged on the system will be shut down. And login instructions will be frozen, that new users can not log on. Direct shut down or delay some time before shutdown is possible, may also restart. This is caused by all processes (process) will receive a signal (signal) system served the decision. This allows programs such as vi like have time to save the current document being edited, and image processing messages (mail) and news (news) program, you can leave, and so normally.

Its job is to perform shutdown transmission signal (Signal) to the init process, asking it to change runlevel. Runlevel 0 is used to stop (halt), runlevel 6 is used to re-activate (reboot) system, and runlevel 1 is to be used to put the system into state management work can be carried out. This is the default, assuming no no -h -r parameter to the shutdown. To understand what had been done in stop motion (halt) or reboot (reboot) process, we can see these runlevels relevant in this file / etc / inittab Lane.

shutdown parameters:

[-T] before changing to another runlevel, tells init how long after the shutdown.

[-R] to restart the calculator.

[-K] does not really shutdown, only to send warning signals to each enrollee (login).

[-H] Power off (HALT) after shutdown.

[-N] do not init, but themselves off. Do not encourage the use of this option, and the consequences of this option is often not always what you expect to receive.

[-C] cancel current process to cancel the shutdown process is currently being executed. So this option of course is no time parameter, but you can enter a message to explain, and this information will be sent to each user.

[-F] ignored fsck on reboot calculator (reboot).

[-F] fsck forced upon reboot calculator (reboot).

[-Time] set-off time (the shutdown) before.

2, halt-- easiest shutdown command

In fact, halt is to call shutdown -h. When the halt execution, kill the application process, the implementation of sync system call, file system write operation will stop after the completion of the kernel.

Parameter Description:

[-N] prevent the sync system call, it is used after repairing the fsck with root partition, to prevent the core cover superblock repaired with the old version of the superblock (superblock).

[-W] is not a real restart or shut down, just write wtmp (/ var / log / wtmp) record.

[-D] do not write wtmp record (already included in the option [-n] in).

[-F] do not call shutdown forced shutdown or restart.

Before [-i] shutdown (or restart), turn off all network interfaces.

[-P] This option is the default option. It is to call poweroff shutdown.

3、reboot

Reboot process work almost like halt, but it is caused by a host reboot, and halt is shut down, its parameters and halt almost the same.

4、init

init is the ancestor of all processes, its process number is always 1, so init will send a TERM signal to terminate all user processes ﹑ daemons. shutdown is the use of this mechanism. init run level defines eight (runlevel), init 0 to shutdown, init 1 to restart. Another telinit init command to change the operation level, such system can telinit -iS single-user mode, and not to use the shutdown information and latency.

About linux shutdown command what is on here, we want to help!

Published 66 original articles · won praise 126 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_44762986/article/details/104903983