Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Which command can shut down or restart the Linux computer

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "which command can be used to shut down or restart the Linux computer". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

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.

Reboot quick restart (skip the sync process, that is, synchronization)

Startup level (0x6), located at / etc/inittab:

A detailed explanation of each operational level:

0 means shutdown and the machine shuts down. (never set to this level)

1 is a single-user mode, similar to the security mode under Win9x.

2 is multi-user mode, but there is no NFS support.

3 is a complete multi-user mode, which is the standard running level.

4 generally not, it can be used to do some things in some special cases. For example, when the laptop battery runs out, you can switch to this mode to make some settings.

5 is X11, which is in the X Window system.

6 to restart, the machine running init 6 will restart. (never set to this level)

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).

This is the end of the content of "which command can shut down or restart the Linux computer". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report