LinuxCommandLibrary

halt

Stop the system

TLDR

Halt the system

$ halt
copy

Power off the system (same as poweroff)
$ halt [[-p|--poweroff]]
copy

Reboot the system (same as reboot)
$ halt --reboot
copy

Halt immediately without contacting the system manager
$ halt [[-f|--force]]
copy

Write the wtmp shutdown entry without halting the system
$ halt [[-w|--wtmp-only]]
copy

SYNOPSIS

halt [OPTION...] [COMMAND]

PARAMETERS

-d, --disklog[=ID]
    Log shutdown to disk with optional ID.

-f, --force
    Force immediate halt; skip shutdown.

-i, --interactive
    Confirm with all processes before halting.

-n, --no-wall
    Suppress broadcast message to users.

-p, --poweroff
    Power off system (default behavior often).

-q, --quiet
    Suppress non-essential messages.

-w, --wtmp-only
    Dry-run: log to wtmp without halting.

-h
    Equivalent to --halt --no-wall.

--help
    Display help and exit.

--version
    Show version information and exit.

DESCRIPTION

The halt command immediately stops all system processes and halts the CPU, effectively shutting down the machine. It invokes shutdown(8) with the now argument unless forced otherwise, ensuring a clean shutdown by syncing filesystems, killing processes, and unmounting filesystems. Designed for superuser use, it prevents data loss compared to abrupt power cuts.

In modern Linux distributions using util-linux, halt typically powers off the hardware if supported (via ACPI), distinguishing it from true CPU halt in legacy systems. Options allow customization, such as forcing halt without shutdown sequence (-f), dry-run logging (-w), or interactive confirmation (-i). It's crucial for safe system termination in servers or desktops, avoiding filesystem corruption.

Commonly symlinked or aliased with poweroff, but halt focuses on stopping execution rather than guaranteed power cut. Always run as root; misuse can lead to data loss on unclean shutdowns.

CAVEATS

Requires root privileges. Irreversible; risks data loss if filesystems unsynced. Avoid on multi-user systems without warning.

BEHAVIOR NOTES

halt calls shutdown -h now by default. Use -f for kernel-level halt without init involvement.

SYSTEMD CONTEXT

In systemd systems, emulates systemctl halt or poweroff, respecting inhibitors.

HISTORY

Introduced in early Unix (1970s) for CPU halt. Integrated into Linux via util-linux (1990s); evolved to poweroff by default with ACPI support post-2000.

SEE ALSO

Copied to clipboard