Know status and health battery in command-line

To see your battery infos you can use acpi if you have it or directly see system files.

Upower command

In both case you can use upower command to get some usefull infos:

1
upower -i /org/freedesktop/UPower/devices/battery_BAT0

Example output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
native-path: BAT0
vendor: ASUSTeK
model: N56--52
power supply: yes
updated: ven. 01 avril 2016 08:58:27 CEST (99 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: fully-charged
warning-level: none
energy: 41,162 Wh
energy-empty: 0 Wh
energy-full: 43,054 Wh
energy-full-design: 57,2 Wh
energy-rate: 0 W
voltage: 12,377 V
percentage: 95%
capacity: 75,2692%
technology: lithium-ion
icon-name: 'battery-full-charged-symbolic'

With acpi

Many distributions don't use it so if you want to install it you can do:

1
sudo zypper in acpi

OR

1
sudo yum install acpi && sudo yum install acpitool

OR

1
sudo apt-get install acpi && sudo apt-get install acpitool

To check is you have it installed:

1
acpi -V

You can see battery health:

1
cat /proc/acpi/battery/BAT0/info

and the battery status:

1
cat /proc/acpi/battery/BAT0/state

OR

1
acpi

You can also display ac adpter information:

1
acpi -a

You can show thermal information:

1
acpi -t

OR

1
cat /proc/acpi/thermal_zone/THM/temperature

Without acpi

Without acpi you will need to browse /sys/class/power_supply/BAT0 directory and display files that are inside.

Share