# phpman > man > ON_AC_POWER(1)

> **TLDR:** A simple utility which tests if a computer is running on line power.
>
- Test if a computer is running on line power:
  `on_ac_power`

*Source: tldr-pages*

---

[ON_AC_POWER(1)](https://www.chedong.com/phpMan.php/man/ONACPOWER/1/markdown)                         General Commands Manual                        [ON_AC_POWER(1)](https://www.chedong.com/phpMan.php/man/ONACPOWER/1/markdown)



## NAME
       on_ac_power - test whether computer is running on AC power

## SYNOPSIS
       **on**___**ac**___**power**

## DESCRIPTION
       **on**___**ac**___**power**  checks whether the system is running on abundant power (such as AC mains, an USB
       charger, etc), as opposed to battery power.

## OPTIONS
       None.

## EXIT STATUS
### 0 (true)
### 1 (false)
### 255 (false)

## CAVEATS
       The vast majority of desktops and servers have no power sensors, thus they  return  255  "un‐
       known"; for most purposes you'd want to consider this answer to imply mains power — note that
       255 evaluates as false for the shell.

       This program currently provides only information known to the kernel; it doesn't (yet?) query
       userspace daemons such as nut which may provide further information.

## AUTHOR
       This  manual  page was written by Steve Dodd <<steved@loth.demon.co.uk>>, was updated by Thomas
       Hood then by Adam Borowski.



                                            12 March 2018                             [ON_AC_POWER(1)](https://www.chedong.com/phpMan.php/man/ONACPOWER/1/markdown)
