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

What is the command for Linux to shut down and restart?

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

The main content of this article is to explain "what is the command for Linux shutdown and restart". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the command for Linux shutdown and restart"?

1. Shutdown command

It can be used to safely shut down the system, however, when shutting down the system, all logged-in users will be notified that the system is about to shut down, and all instructions will be frozen, that is, all new users can no longer log in. Using this command will cause immediate shutdown or restart and delay shutdown or restart for a period of time. (note: only superusers can use this command)

Command syntax format:

Shutdown [option] [time] [warning]

The meaning of each option in this command is described:

-k: just send a warning message to the user

-r: restart the system after shutting down

-h: do not restart the system after shutting down

-f: quickly shut down the system, but without disk detection when rebooting the system (during the experiment, it was found that the system entered the bios interface, but nothing could be done)

-n: shut down the system quickly, but not through the init program

-c: interrupt and shut down the system (did not find out exactly how to experiment)

2. Halt command

To use the halt command is to call the "shutdown-h" command to shut down the system

Command syntax format

Halt [options]

-w: not really shutting down the system, just writing "wtmp" (/ var/log/wtmp) records

-d: do not write "wtmp"

-f: instead of calling "shutdown", it forces the shutdown

-I: shut down all network uo interfaces before shutting down or rebooting the system

-p: this option is the default and "power off" is called when the system is shut down

3. Reboot command

The reboot command works like the halt command, but reboot causes the host to restart. All its parameters are similar to "halt".

4. Init command

The above content is the full description of the easy command of Linux shutdown and restart shared by the editor. I hope you will like it.

The init command uses the run level of the system to control the system. It is the ancestor of all system processes, and its process number is always 1, so sending a "TERM" signal to init will terminate all user processes, daemons, and so on. "shutdown" uses this mechanism. Init 0 shuts down the system and init 1 restarts the system.

At this point, I believe that everyone on the "Linux shutdown restart command is what" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Development

Wechat

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

12
Report