This post was originally published on go2linux.org, a Linux blog I ran from 2007 to 2011. The domain is no longer mine, but I am the original author. I am republishing it here on garron.me with corrections and improvements.

Linux console brings acpi to us to check the status our Laptop battery, right from the command line.

First of all install the acpi package

sudo apt-get install acpi

To check the state of the charge of battery

acpi

The output could be something like this.

Battery 1: discharging, 44%, 00:18:48 remaining

To check the battery temperature

acpi -t

And the output could be

Battery 1: discharging, 37%, 00:15:59 remaining
Thermal 1: ok, 49.0 degrees C

if you need it in Farenheit

acpi -t -f

To check the AC power status

acpi -a 

The output could be:

Battery 1: discharging, 30%, 00:13:31 remaining
AC Adapter 1: off-line

You can check all the status together

acpi -V

The output will be:

Battery 1: discharging, 27%, 00:11:29 remaining
Thermal 1: ok, 50.0 degrees C
AC Adapter 1: off-line