Home > Article > Operation and Maintenance > how to shut down linux
Several ways to shut down the system in Linux:
shutdown -h now Shut down immediately (recommended learning: linux operation and maintenance)
shutdown -r now Restart immediately
Linux command: shutdown
Function description: System shutdown command.
Syntax: shutdown [-efFhknr][-t seconds][time][warning message]
Supplementary instructions: shutdown command can Close all programs and restart or shut down the computer according to user needs.
Parameters:
-c When executing the "shutdown -h 11:50" command, just press the key to interrupt the shutdown command.
-f Does not perform fsck (disk maintenance) when restarting.
-F Execute fsck when restarting.
-h Shut down the system.
-k Just sends information to all users, but does not actually shut down the computer.
-n Does not call the init program to shut down, but shutdown itself.
-r Restart after shutdown.
-t
[Time] Set the time after which the shutdown command will be executed.
[Warning message] Message to be sent to all logged in users.
The difference between shutdown, Halt, init and reboot:
When shutdown is called, a signal will be sent to the init program, requiring it to change the runlevel. The details will be based on Determined by parameters (shut down or restart).
halt and reboot are both links to a certain command of shutdown. Halt is equivalent to shutdown -h now, which means shutdown; reboot is equivalent to shutdown -r now, which is to restart the system.
Init, as the first program of the Linux system, has multiple runlevels (runlevels), such as 0 - shutdown 1 - single user mode 3 - character interface 5 - graphical interface 6 - restart, so use Init to shut down Or the restart operation is similar to shutdown, and more direct than shutdown (no need to send a signal).
The above is the detailed content of how to shut down linux. For more information, please follow other related articles on the PHP Chinese website!