linux linux shutdown command shutdown command summary summary

linux shutdown command summary

 

Common linux shutdown command has: shutdown, halt, poweroff, init; restart command has: reboot. The following paper describes the difference between the specific use and the shutdown of some commonly used commands and a variety shutdown command.

First look at some of the more common linux shutdown command

Shutdown command:

1, halt immediately shut 2, poweroff immediately shut 3, shutdown -h now immediately shut down (root user) 4, shutdown -h automatic shutdown if the shutdown command is set off by 10 10 minutes, then, can be canceled with the shutdown command -C restart

Restart command:

1, reboot 2, shutdown -r now immediately restart (root users) 3, shutdown -r 10 10 minutes and automatically restart (root user)   . 4, -R & lt 20:35 to 20:35 when the shutdown at reboot time (root users) is set to restart if the shutdown command, you can use the command shutdown -c cancel restart

Let us look at the differences and their usage between these specific shutdown of linux command

1.shutdown safe shutdown command

For the shutdown command, it is recommended everyone a safe command to complete the shutdown or restart or by blending parameter -h -r of. But you can use this command in linux system only those with root privileges. So, although we recommend using this command, but this command it is really not very easy: I want to use this command? Go get root access it. shutdown shutdown is executed, it is to send a signal to the init, asking it to change the operating level, in order to shut down. Shutdown or restart it is the actual level of adjustment, so we can directly adjust the operating level init to shut down or reboot. When you use this command, shutdown or restart the machine immediately. It also requires root privileges.

So why is safely shutdown command to shut down the system do?

Some users will actually use directly cut off the power supply to shut down linux, which is very dangerous. Because linux and windows different from its many processes running in the background, so the forced shutdown process may result in data loss of the system 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, there may be restarted. This is the will of all processes [process] receive the delivery system of signal [signal] decision.

Its job is to perform shutdown signal [signal] to send the init process, asking it to change runlevel. runlevel 0] is used to stop [halt, runlevel 6 is used to re-activate the system reboot], and runlevel 1 is to be used to bring the system into a state management can be performed, which is the default. Assuming no -h nor -r parameter to the shutdown. To understand the shutdown or reboot [halt] [reboot] the course of action to do what? You 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] [halt after shutdown power off]. [-n] but do not have their own init to shut down. 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] fsck ignored when restarting the calculator] [reboot.   [-F] fsck forced upon reboot calculator] [reboot. [-time] [off setting time before shutdown].       2.halt easiest shutdown command

When using the shutdown command to halt, the actual call is shutdown -h. Will kill the application process when halt execution, execution sync system call after the file system write operation is complete will stop the kernel.

halt parameters:

[-N] prevent the sync system call, it is used after repairing the fsck with root partition, to prevent the old version of the kernel superblock] [superblock coverage patched superblock. [-W] is not a real restart or shut down, just write wtmp [/ var / log / wtmp] record. [-D] [do not write wtmp record is included in the options [-n] in]. [-F] do not call shutdown forced shutdown or restart. [-I] [before shutdown or restart] down all network interfaces. [-P] This option is the default option. It is to call poweroff shutdown.

3.poweroff common shutdown command

For poweroff, online say it is linked to the halt command, basic usage and halt almost, there is not much to say.

4.init

init process is the ancestor of all, he is one of the programs Linux operating system indispensable. Its process number is always 1, so init will send a TERM signal to terminate all user processes, daemons, and so on. shutdown is the use of this mechanism. init run level defines eight (runlevel), init 0 to shutdown, init 1 to restart.

5.reboot restart command

Reboot process work almost like halt. However, it is caused by a host reboot, and halt is shut down. It's almost the same parameters and halt.

Common linux shutdown command has: shutdown, halt, poweroff, init; restart command has: reboot. The following paper describes the difference between the specific use and the shutdown of some commonly used commands and a variety shutdown command.

First look at some of the more common linux shutdown command

Shutdown command:

1, halt immediately shut 2, poweroff immediately shut 3, shutdown -h now immediately shut down (root user) 4, shutdown -h automatic shutdown if the shutdown command is set off by 10 10 minutes, then, can be canceled with the shutdown command -C restart

Restart command:

1, reboot 2, shutdown -r now immediately restart (root users) 3, shutdown -r 10 10 minutes and automatically restart (root user)   . 4, -R & lt 20:35 to 20:35 when the shutdown at reboot time (root users) is set to restart if the shutdown command, you can use the command shutdown -c cancel restart

Let us look at the differences and their usage between these specific shutdown of linux command

1.shutdown safe shutdown command

For the shutdown command, it is recommended everyone a safe command to complete the shutdown or restart or by blending parameter -h -r of. But you can use this command in linux system only those with root privileges. So, although we recommend using this command, but this command it is really not very easy: I want to use this command? Go get root access it. shutdown shutdown is executed, it is to send a signal to the init, asking it to change the operating level, in order to shut down. Shutdown or restart it is the actual level of adjustment, so we can directly adjust the operating level init to shut down or reboot. When you use this command, shutdown or restart the machine immediately. It also requires root privileges.

So why is safely shutdown command to shut down the system do?

Some users will actually use directly cut off the power supply to shut down linux, which is very dangerous. Because linux and windows different from its many processes running in the background, so the forced shutdown process may result in data loss of the system 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, there may be restarted. This is the will of all processes [process] receive the delivery system of signal [signal] decision.

Its job is to perform shutdown signal [signal] to send the init process, asking it to change runlevel. runlevel 0] is used to stop [halt, runlevel 6 is used to re-activate the system reboot], and runlevel 1 is to be used to bring the system into a state management can be performed, which is the default. Assuming no -h nor -r parameter to the shutdown. To understand the shutdown or reboot [halt] [reboot] the course of action to do what? You 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] [halt after shutdown power off]. [-n] but do not have their own init to shut down. 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] fsck ignored when restarting the calculator] [reboot.   [-F] fsck forced upon reboot calculator] [reboot. [-time] [off setting time before shutdown].       2.halt easiest shutdown command

When using the shutdown command to halt, the actual call is shutdown -h. Will kill the application process when halt execution, execution sync system call after the file system write operation is complete will stop the kernel.

halt parameters:

[-N] prevent the sync system call, it is used after repairing the fsck with root partition, to prevent the old version of the kernel superblock] [superblock coverage patched superblock. [-W] is not a real restart or shut down, just write wtmp [/ var / log / wtmp] record. [-D] [do not write wtmp record is included in the options [-n] in]. [-F] do not call shutdown forced shutdown or restart. [-I] [before shutdown or restart] down all network interfaces. [-P] This option is the default option. It is to call poweroff shutdown.

3.poweroff common shutdown command

For poweroff, online say it is linked to the halt command, basic usage and halt almost, there is not much to say.

4.init

init process is the ancestor of all, he is one of the programs Linux operating system indispensable. Its process number is always 1, so init will send a TERM signal to terminate all user processes, daemons, and so on. shutdown is the use of this mechanism. init run level defines eight (runlevel), init 0 to shutdown, init 1 to restart.

5.reboot restart command

Reboot process work almost like halt. However, it is caused by a host reboot, and halt is shut down. It's almost the same parameters and halt.

Guess you like

Origin www.cnblogs.com/chen1970/p/11084799.html