I understand that -p stands for power off.

The man page says:

-p, --poweroff

       Power-off the machine, regardless of which one of the three
       commands is invoked.

But exactly what does it do in reboot?

When tried both reboot and reboot -p in a RHEL 7 machine, I failed to find any appreciable difference.

  • A related question is unix.stackexchange.com/questions/195898 . – JdeBP Aug 21 '17 at 18:23
  • @JdeBP An excellent resource. And a must read. However, it does not answer my question. – Masroor Aug 22 '17 at 0:17
  • 1
    Which is why it is a question comment rather than an answer and is talking about related rather than duplicate questions. – JdeBP Aug 22 '17 at 7:57

The documentation is wrong. As others have pointed out: halt, reboot and poweroff are all symlinked to systemctl. That program first looks at the name it was invoked from and sets the action it is going to take (one of halt, reboot or poweroff). It then parses its arguments one by one to see if any of them override the default. However, looking at the source code, a poweroff option can not override anything when the current action is reboot.

reboot --halt --poweroff will power off the machine though, because when systemctl parses the final argument the current action is set to halt (from the previous argument).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.