:: Check your Laptop Battery Status From the Terminal ::

0x01. Introduction

Sometimes, we have no graphical user interface installed on our laptop, but we have to check out the laptop battery status. Using ‘acpi’ command, we can check the laptop battery status instantly.

0.02. ACPI command line

We can check our laptop battery status from the terminal or console, using ‘acpi’ command. With Ubuntu, we have to install ‘acpi’ first by type command in your terminal :

$ sudo apt-get install acpi

Here are few basic command that frequently use to check laptop battery status.

1. Command to check the state of the charge of battery:
$ acpi

The output could be something like this:
Battery 1: discharging, 90%, 02:00:09 remaining

We can compare the percentage and the remaining time. If you have big number for the percentage, but you only have few minutes for the remaining time, that’s mean you have to find another new battery.

2. Command to check the battery temperature:
$ acpi -t

represent the battery temperature in Fahrenheit:
$ acpi -t -f

3. Command to check the AC Power Status
$ acpi -a

4. Command to check all status (verbose all) :
$ acpi -V

Another command tool that we can use is ‘acpitool’. Make sure that we have ‘acpitool’ installed. We can install ‘acpitool’ by command:

$ sudo apt-get install acpitool

Commands that we can use to check laptop battery status:

1. Command to show information about the laptop battery status
$ acpitool

2. Command to show detailed information about the laptop battery status
$ acpitool -B

We can combine with verbose option ‘v’ for show more verbose output when something is not found.

3. Command to show information about AC Power.
$ acpitool -a

or we can use command below for simple check laptop battery status:

$ cat /proc/acpi/battery/BAT0/state

and for detailed information about battery

$ cat /proc/acpi/battery/BAT0/info

0x03. Conclution
By using ‘acpi’ command line, or ‘acpitool’, or open ‘/proc/acpi/battery/BAT0/info’, we can check the laptop battery status. I hope this can useful or solve your problem, need your suggestion for the future work for this website.

0x04. References

1. http://www.go2linux.org/laptop-battery-status-with-linux-console-command-acpi
2. http://www.columbia.edu/~ariel/acpi/acpi_howto.txt
3. http://ubuntuforums.org/archive/index.php/t-475801.html

0x05. Best Regards

Ari Mogi
Teknik Informatika [Information Engineering]
Jurusan Ilmu Komputer [Computer Science Dept.]
Fakultas MIPA [Faculty of Mathematics and Natural Sciences]
Universitas Udayana [Udayana University]

2 thoughts on “:: Check your Laptop Battery Status From the Terminal ::

  1. Pingback: Linux Check Laptop battery status from Console / Terminal « Walking in Light with Christ (Faith, Computing, Diary, Journal, whatever)

Comments are closed.