Linux systems should be used by a relatively small number of people, or many people are not very familiar with Linux systems. The halt command is used to shut down the running Linux operating system. The halt command will first detect the system's runlevel. If the runlevel is 0 or 6, the system will be shut down. Otherwise, shutdown will be called to shut down the system. I don't know how to use the halt command to learn with Xiaobian!
following steps:
Title: halt
usage rights: the system administrator
use: halt [-n] [-w ] [-d] [-f] [-i] [-p]
Description: If the system's runlevel is 0 or 6, then shut down the system, otherwise use the shutdown command (plus the -h parameter) Replace
Parameters:
-n : Do not write the memory data back to the hard disk before shutting down
-w : It doesn't really shut down, just put The record is written to the /var/log/wtmp file
-d : Do not write the record to the /var/log/wtmp file (-n this parameter contains -d) -f : Force shutdown, no Call shutdown This command
-i : Stop all network related devices before shutting down
-p : When shutting down, do the power off action by default
Example:
halt -p Turn off the power after turning off the system.
halt -d Shuts down the system, but leaves no records.
Linux common shutdown command and its difference:
Under Linux, some common shutdown/restart commands are shutdown, halt, reboot, and init, all of which can achieve the purpose of restarting the system, but The internal working process of each command is different. Through the introduction of this article, I hope that you can use various shutdown commands more flexibly.
1.shutdown
The shutdown command safely shuts down the system.
Some users will shut down Linux by directly disconnecting the power supply, which is very dangerous. Because linux and windows are different, there are many processes running in the background, so forcible shutdown may result in data loss of the process, making the system unstable, and even in some systems, the hardware device will be damaged.
Using the shutdown command before the system shuts down, the system administrator will notify all logged-in users that the system will be shut down. And the login command will be frozen, ie the new user can no longer log in. It is possible to shut down directly or delay the system for a certain period of time. It may also be
. This is determined by all the processes that receive the signal from the system. This allows programs like vi to have time to store documents that are currently being edited, while programs like mail and news can leave normally.
shutdown to perform its job is to send a signal to the init program, asking it to change the runlevel. Runlevel 0 is used to stop [halt], runlevel 6 is used to reactivate the [reboot] system, and runlevel 1 is used to get the system into a state where management can be performed; this is preset, assuming no -h There is also no -r parameter for shutdown. To find out what actions have been taken during a halt or reboot, you can see these runlevels related information in this file /etc/inittab.
shutdown Parameter Description:
[-t] Tells init how long to shut down before changing to other runlevels.
[-r] Restart the calculator.
[-k] does not really shut down, just send a warning signal to each login [login].
[-h] Turn off the power [halt] after shutting down.
[-n] Instead of init, shut yourself down. This option is discouraged and the consequences of this option are often not always what you expect.
[-c] cancel current process Cancel the shutdown program currently being executed. So of course this option has no time parameters, but you can enter a message for explanation, and this information will be sent to each user.
[-f] Ignore fsck when restarting the calculator [reboot].
[-F] Force fsck when restarting the calculator [reboot].
[-time] Set the time before shutdown [shutdown].
2.halt—-The simplest shutdown command
In fact, halt is to call shutdown -h. When halt is executed, the application process is killed, the sync system call is executed, and the kernel system stops when the file system write operation is completed.
Parameter Description:
[-n] Prevents the sync system call. It is used to fix the root partition with fsck to prevent the kernel from overwriting the old version of the superblock. Super block.
[-w] It's not really a reboot or shutdown, just write a wtmp[/var/log/wtmp] record.
[-d] Do not write wtmp records [included in option [-n]].
[-f] Force shutdown or restart without calling shutdown.
[-i] Turn off all network interfaces before shutting down (or restarting).
[-p] This option is the default option. It is to call poweroff when shutting down.
3.reboot
The working process of reboot is almost the same as that of halt, but it causes the host to restart, and halt is shutdown. Its parameters are similar to those of halt.
4.init
Init is the ancestor of all 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 is to use this mechanism. Init defines 8 runlevels, init 0 is shutdown, and init1 is restart. About init can be a long story, and will not be described here. In addition, the telinit command can change the running level of init. For example, telinit -iS can make the system enter single-user mode, and can not get the information and waiting time when using shutdown.
About the use of the Linux system halt command parameters will be introduced to you in detail; if you do not know the halt command parameters, do not know how to use, it is necessary to look at the above content what!
I believe everyone has played League of Legends (LOL), which is definitely not familiar to many peop
Now many users are used to using thumbnails to view some images or files, but when
Some MAC users installed WinXP system on their own computers, found that the Bootcamp driver package
Although the minimum installation requirement for Win7 system is 1GB memory, when t
How to open the VXP file of WinXP system? How to open a VCF file
Prompt for missing Svchost.exe when starting the system
Coup to deal with Win XP LAN access failure
WinXP can't delete video files How to deal with
Counting Windows Optimizer's 4 Application Tips
What is the BIOS of the xp system and how much is it?
How WinXP changes file association program
How to close the WinXP system Microsoft Device Health Assistant?
System tutorial to give you XP speed
Windows registry is unlocked by three measures
How does WinXP establish a local connection? WinXP to establish a local connection solution
Win10 system windows hello flash back how to do
Sending and Receiving Other Emails
How to prevent Windows10 software is automatically installed in
How does the winXP system use the registry to speed up the window startup?
Win7 system running Ansys prompts to stop working
Notebook Windows system can't start
Downloading attachments for outlook.com on Win8.1 is very slow often <10k
Win8 set up automatic networking method
Xiaomi notebook guess: equipped with Win10 system, two-in-one design