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:
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
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
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.
0x05. Best Regards
Teknik Informatika [Information Engineering]
Jurusan Ilmu Komputer [Computer Science Dept.]
Fakultas MIPA [Faculty of Mathematics and Natural Sciences]
Universitas Udayana [Udayana University]