Linux command
halt 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Halt
halt
Power off
halt -p
Reboot
halt --reboot
Example
halt -f
Example
halt -w
说明
halt instructs the system to stop all processes and halt the CPU. On modern systems with systemd, halt is a symlink to systemctl and triggers a proper shutdown sequence. The difference between halt, poweroff, and reboot: - halt - Stops the CPU but may leave power on - poweroff - Stops the CPU and powers off the machine - reboot - Restarts the machine In practice, most systems treat halt and poweroff similarly, powering off the machine.
参数
- -p, --poweroff
- Power off the machine (equivalent to poweroff)
- --reboot
- Reboot the machine (equivalent to reboot)
- --halt
- Halt the machine, regardless of which command is invoked
- -f, --force
- Force immediate halt without contacting the init system
- -w, --wtmp-only
- Only write wtmp record, don't actually halt
- -d, --no-wtmp
- Don't write wtmp record
- --no-wall
- Don't send wall message before halt
FAQ
What is the halt command used for?
halt instructs the system to stop all processes and halt the CPU. On modern systems with systemd, halt is a symlink to systemctl and triggers a proper shutdown sequence. The difference between halt, poweroff, and reboot: - halt - Stops the CPU but may leave power on - poweroff - Stops the CPU and powers off the machine - reboot - Restarts the machine In practice, most systems treat halt and poweroff similarly, powering off the machine.
How do I run a basic halt example?
Run `halt` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --poweroff do in halt?
Power off the machine (equivalent to poweroff)