first, the role of shutdown restart command
Believe that for people who have access to the computer, especially for Windows systems, if the long-time use without a restart, there will be a little bit of the feeling of lag. But when the whole system is restarted, it feels like it's gone again, and the Windows system resets the entire service after rebooting, just like resetting the factory settings, and maybe restarting is the way it works. Also in Linux, shutdown Restart is also necessary, Linux server, often encounter server restart shutdown, may need to maintain the system, the new system on-line and so on. So for example, shutdown, reboot, halt commands are useful, this is to learn Linux must learn the command.
second, the common shutdown restart command
(1)shutdown option time: Performs an action at a specified number of times and requires a login password if it is a non-root user. Where option is optional as follows:
-H: Shutdown
-R: Restart
-C: Cancel the previous shutdown command
(2) Other shutdown commands:
Halt: Shutdown, only the root user can use.
Poweroff: Shutdown, non-root users need to enter the login password.
Init 0: Shutdown, non-root users need to enter a login password.
(3) Other restart commands:
Reboot: Reboot, non-root user needs to enter login password.
Init 6: Restart, non-root users need to enter a login password.
Three, the effect demonstration
(1) Use the Shutdown command to perform a shutdown operation immediately, the Linux command is shown below, 3-1, which shows that Linux is shutting down.
1 shutdown-h now
Figure 3-1
(2) Use the shutdown command to immediately perform a restart shutdown operation, the Linux command is shown below, 3-2, which shows that Linux is rebooting.
1 shutdown-r now
Figure 3-2
Finally, the commands for other shutdown restarts are not demonstrated. So many commands to shut down how to choose, I personally recommend the shutdown command. Because the Shutdow command can specify a time to perform an action, and the command is more secure, it saves information about the service in progress and then performs an action.
Linux Basics-Shutdown Restart command shutdown, reboot, etc.