Correct shutdown method in Linux 1 prepare 1.1 Observe System Usage Status 1.2 notify online users of shutdown time 2 shutdown command 2.1 sync2.2 shutdown2.3 reboot2.4 halt2.5 poweroff3 execute level 3.1 level division 3.2 Level switch 1 shutdown before prepare 1.1 to observe who is using the system online: who network status: netstat-a Program executed in The background: ps-aux1.2 notifies online users of shutdown Time + 2 "The machine will shutdown" # shutdown after 2 minutes, notify the online user 2 to shut down the command 2.1 sync to write data not written to the hard disk in the memory to the hard disk 2.2 shutdownshutdown now # shutdown immediately + 2 # shutdown after 2 minutes shutdown # shutdown at + 2 "The machine will shutdown" # Shut down after 2 minutes, and notify the online user to restart 2.3 reboot. After adding a parameter, halt can be implemented. poweroff2.4 halt points to the reboot link, which is equivalent to the shutdown-h 2.5 poweroff point to the reboot link, equivalent to halt 3 execution level 3.1 classification run level 0: shutdown run level 3: plain text mode run level 5: including graphic interface mode run level 6: restart 3.2 Level switch init 0 # Switch to level 0, that is, shutdown attached: shutdown, halt, poweroff difference Answer-text mb-10 code shutdown: Make the system shut down, refer to the existing explanation: "The command safely shuts down the system. It is very dangerous for some users to disable linux by directly disconnecting the power supply. Different from windows, linux runs many processes in the background, therefore, force shutdown may lead to data loss in the process, making the system unstable, or even damaging hardware in some systems. When the shutdown command is used before the system is shut down, the system administrator notifies all logged-on users that the system will be shut down. The login command is frozen, meaning that new users cannot log on again. It is possible to shut down directly or wait for a certain period of time to restart. This is determined by the signal that all processes receive from the system [signal. This allows programs like vi to have time to store the files being edited, while programs like mail and news can leave normally. "shutdown will run the script in/etc/rc0.d, that is to say, the runlevel 0 script will be executed. Halt does not. Poweroff: turning off the system power. poweroff is just the soft link of halt. The halt command is executed. The halt command can be understood as follows: halt calls shutdown-h. When halt is executed, the application process is killed and the sync system call is executed. After the file system write operation is completed, the kernel is stopped.