System Grab Bag

View all TLDR pages from Linux (or from all pages)

systemd-ac-power

Report whether the computer is connected to an external power source. More information: https://www.freedesktop.org/software/systemd/man/systemd-ac-power.html.
  • Silently check and return a 0 status code when running on AC power, and a non-zero code otherwise:
    systemd-ac-power
  • Additionally print yes or no to stdout:
    systemd-ac-power --verbose

License and Disclaimer

The content on this page is copyright © 2014—present the tldr-pages team and contributors.
This page is used with permission under Creative Commons Attribution 4.0 International License.

While we do attempt to make sure content is accurate, there isn't a warranty of any kind.