Linux poweroff Command

The Linux poweroff command closes out the filesystem, shuts down the system, and poweroff it. Because this command immediately stops all processes, it should be run only in single-user mode. If the system is not in runlevel 0 or 6, poweroff calls shutdown -h, then performs a poweroff.

poweroff Command options

Below shown are the most commonly used options with the poweroff command.

Option Remark
-d Suppress writing to /var/log/wtmp.
-f Call reboot or halt and not shutdown, even when shutdown would normally be called. This option is used to force a hard halt or reboot.
-h Place hard drives in standby mode before halt or poweroff.
-i Shut down network interfaces before reboot.
-n Suppress normal call to sync.
-w Suppress normal execution; simply write to /var/log/wtmp.

poweroff command examples 1. To shutdown the machine:

# poweroff

2. To forcefully shutdown the machine:

# poweroff -f
# poweroff --force

3. To instructs the halt command to instead behave as poweroff:

# poweroff -p
# poweroff --poweroff

4. Do not shutdown but make an entry into wtmp file:

# poweroff -w
# poweroff --wtmp-only

5. Set to the verbose mode:

# poweroff --verbose