Showing Power Information For Devices On Linux

If you want to know the power levels of a device on a Linux system. Then you can use the upower command. This command (and the underlying daemon) is available on most Linux systems, including Debian, Ubuntu, Fedora, Arch, and even MacOs.

To see the available devices use the -e, or --enumerate flag.

This will show output like this.

$ upower --enumerate
/org/freedesktop/UPower/devices/battery_BAT0
/org/freedesktop/UPower/devices/line_power_AC
/org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001
/org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o002
/org/freedesktop/UPower/devices/mouse_hidpp_battery_1
/org/freedesktop/UPower/devices/DisplayDevice

To see the state of a device use the -i or --show-info flag, passing in the full name of the device you want to see the power status of.

This will produce output a bit like the following (depending on your system).

$ upower --show-info /org/freedesktop/UPower/devices/battery_BAT0 
  native-path:          BAT0
  vendor:               LGC
  model:                5B10W13905
  serial:               2984
  power supply:         yes
  updated:              Sun 06 Apr 2025 22:02:16 BST (52 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               fully-charged
    warning-level:       none
    energy:              38.66 Wh
    energy-empty:        0 Wh
    energy-full:         38.66 Wh
    energy-full-design:  50.5 Wh
    energy-rate:         2.782 W
    voltage:             12.834 V
    charge-cycles:       325
    percentage:          100%
    capacity:            76.5545%
    technology:          lithium-polymer
    icon-name:          'battery-full-charged-symbolic'

You can also dump everything available for all devices by using the -d or --dump flag.

$ upower --dump 

This creates quite a bit of output.

For an all in one command that will show you the current battery status you can use the following.

upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage"

This will go through the available devices, look for a device that contains the word "BAT" and print out the state and percentage charge of the device. Ultimately, this will print something like this.

    state:               fully-charged
    percentage:          100%

Add new comment

The content of this field is kept private and will not be shown publicly.