What are the shutdown commands in the linux system
1. Shutdown command
The shutdown command is used to safely shut down the Linux system.
When the shutdown command is executed, all logged-in users are notified that the system is about to shut down, and the login instruction is frozen, that is, new users can no longer log in to the system. Using the shutdown command, you can shut down the system directly, delay it for a specified time, or restart it. Delaying the shutdown of the system at a specified time allows users time to save files that are currently being processed and to close open programs.
Some of the parameters of the shutdown command are as follows:
[- t] specify how long to shut down the system
[- r] restart system
[- k] doesn't really turn it off, just sends a warning signal to each logged-in user.
[- h] shut down the system (halt)
2. Halt command
Halt is the simplest shutdown command, which actually invokes the shutdown-h command. When halt is executed, the application process is killed, and the kernel is stopped after the file system write operation is complete.
Some of the parameters of the halt command are as follows:
[- f] forced shutdown or restart without calling shutdown
[- I] turn off all network interfaces before shutting down or restarting
[- p] call poweroff when shutting down, which is the default option
3. Reboot command
Reboot works like halt in that it restarts, while halt shuts down. Its parameters are also similar to halt.
4. Init command
Init is the ancestor of all processes, and its process number is always 1. Init is used to switch the running level of the system, and the switching is done immediately. The init 0 command is used to immediately switch the system runlevel to 0, that is, shutdown, and the init 6 command is used to switch the system runlevel to 6, that is, to restart.
These are the details of what is the difference between the shutdown commands in the linux system. Please pay more attention to other related articles!