Master Linux’s halt Command: Options, Syntax, and Practical Examples
The article explains how the Linux halt command shuts down a running system, details its syntax and run‑level behavior, lists all available options with meanings, and provides concrete examples demonstrating usage such as powering off with -p or shutting down without logging to /var/log/wtmp.
halt: Shut Down the System
Function Description
The halt command is used to shut down a running Linux operating system; on production servers it should be used with caution.
halt first checks the system runlevel; if the runlevel is 0 or 6 it shuts down directly, otherwise it invokes shutdown.
Command Syntax
halt [options]Option Meanings
-w : Writes only a shutdown record to /var/log/wtmp without actually rebooting or powering off.
-n : Does not sync disks before shutting down.
-d : Shuts down without writing a record to /var/log/wtmp.
-f : Forces shutdown regardless of the current runlevel, bypassing shutdown.
-i : Turns off all network interfaces before shutting down.
-p : Calls poweroff (default) to turn off the power.
--verbose : Prints more detailed messages during reboot, useful for debugging shutdown issues.
Reference Examples
Example 1: Use the -p option to power off the system, equivalent to the poweroff command. [root@linuxcool ~]# halt -p Example 2: Shut down the system without leaving a record.
[root@linuxcool ~]# halt -dSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
