Get the App
SLTechnology News&Howtos  ›  Servers  › 

There are several ways for linux to shut down the system

Shulou Source: shulou.com Published: 2022-06-02 21:50:11 09月22日 Update

How many ways can linux shut down the system? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Shutdown-h now shuts down immediately

Shutdown-r now restart immediately

Linux command: shutdown

Function description: system shutdown instruction.

Grammar: shutdown [- efFhknr] [- t seconds] [time] [warning message]

Additional note: the shutdown instruction can close all programs and restart or shut down the computer according to the needs of the user.

Parameters:

-c when the "shutdown-h 11:50" instruction is executed, the shutdown instruction can be interrupted simply by pressing the + key.

-f fsck (disk maintenance) is not performed on restart.

-F executes fsck when restarting.

-h shut down the system.

-k only sends information to all users, but does not actually turn it off.

-n does not call the init program to shut down, but by the shutdown itself.

-r restart after shutdown.

-t how many seconds to delay between sending a warning message and deleting a message.

[time] set how long it takes to execute the shutdown instruction.

[warning message] the information to be sent to all logged-in users.

The difference between shutdown, Halt, init and reboot:

When shutdown is called, it sends a signal (signal) to the init program, asking it to change the runlevel, depending on the parameters (close or restart).

Both halt and reboot are links to a command from shutdown. Halt is equivalent to shutdown-h now, that is, shutdown; reboot is equivalent to shutdown-r now, which restarts the system.

As the first program of the Linux system, Init has several runlevel, such as 0-off 1-single user mode 3-character interface 5-graphical interface 6-restart, so using Init for shutdown or restart is similar to shutdown and more direct than shutdown (no need to send a signal).

There are several answers to questions about the method of shutting down the linux system. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Tags: System information instruction program method time user question signal command more interface help solution easy almost easy in between that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Microsoft Huawei vpn Linux