Should now be in hardware forum section; maybe a list of too many poweroff commands can be considered a tip
Hello,
What is the recommended way to power off the computer from command line or script?
I have been using "xfce4-session-logout --halt", but I'm confused about the meaning of "halt".
- xfce4-session-logout --halt
systemctl poweroff
sudo poweroff
sudo shutdown -P now
others?
systemctl poweroff is appealing because its meaning seems clear, but I think systemctl is from systemd, so although it works in MX, it is not available in antiX. poweroff itself requires sudo so it's not good in a script.
Code: Select all
shutdown --help
shutdown: you must be root to do that!
Usage: shutdown [-akrhPHfFnc] [-t sec] time [warning message]
...
-h: halt after shutdown.
-P: halt action is to turn off power.
-H: halt action is to just halt.
...
halt --help
...
-p: power down the system (if possible, otherwise halt).
Thanks in advance.
P.S. xfce4-session-logout --halt has always worked on an HP laptop with MX-17 x64. On an old MSI netbook running MX 17.1_386, occasionally the computer winds up unresponsive but still on.
https://askubuntu.com/questions/771166/ ... e-terminal