Linux Laptop: Display Battery Status And Thermal Temperature From Command Line

by on July 7, 2010 · 4 comments· last updated at July 7, 2010

How do I find out out details about my Linux Laptops temperature, battery status and other information from command prompt?

The information regarding your battery status and acpi is stored in /proc and /sys file system. The easiest way to read this information is using acpi command as follows (note acpi may not be installed by default so use apt-get or yum command to install the same):
$ acpi -V
Sample outputs:

Battery 0: Full, 100%
Battery 0: design capacity 8400 mAh, last full capacity 8044 mAh = 95%
Adapter 0: on-line
Thermal 0: ok, 53.5 degrees C
Thermal 0: trip point 0 switches to mode critical at temperature 107.0 degrees C
Cooling 0: LCD 0 of 15
Cooling 1: Processor 0 of 10
Cooling 2: Processor 0 of 10
Cooling 3: Processor 0 of 10
Cooling 4: Processor 0 of 10
Cooling 5: Processor 0 of 10
Cooling 6: Processor 0 of 10
Cooling 7: Processor 0 of 10

You can browse the same data by visiting /proc/acpi/ directory:
$ cd /proc/acpi/
$ ls -l

Sample outputs:

dr-xr-xr-x  3 root root 0 2010-07-07 14:29 ac_adapter
dr-xr-xr-x  3 root root 0 2010-07-07 14:29 battery
dr-xr-xr-x  5 root root 0 2010-07-07 14:29 button
-r--------  1 root root 0 2010-07-07 14:29 dsdt
dr-xr-xr-x  3 root root 0 2010-07-07 14:29 embedded_controller
-r--------  1 root root 0 2010-07-07 13:14 event
-r--------  1 root root 0 2010-07-07 14:29 fadt
dr-xr-xr-x  2 root root 0 2010-07-07 14:29 fan
-r--r--r--  1 root root 0 2010-07-07 14:29 info
dr-xr-xr-x  2 root root 0 2010-07-07 14:29 power_resource
dr-xr-xr-x 10 root root 0 2010-07-07 14:29 processor
-rw-r--r--  1 root root 0 2010-07-07 14:29 sleep
dr-xr-xr-x  3 root root 0 2010-07-07 14:29 thermal_zone
dr-xr-xr-x  3 root root 0 2010-07-07 13:14 video
-rw-r--r--  1 root root 0 2010-07-07 14:29 wakeup

OR
$ cat /proc/acpi/thermal_zone/THM/temperature
Sample outputs:

temperature:             55 C

GUI Tool

gnome-power-statistics is the gui program for the gnome power management infrastructure. It allows users to visualize the power consumption of laptop hardware. Type the following command to view stats or click on GUI power icon located on right side:
$ gnome-power-statistics
Sample outputs:

Fig.01: Linux Battery Monitor / Stats GUI App

Fig.01: Linux Battery Monitor / Stats GUI App

How Do I Get CPU Temperature Data?

How Do I Read Hard Disk Temperature?



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 4 comments… read them below or add one }

1 rambo July 9, 2010 at 2:31 pm

how do i know the remaining battery in hours

Reply

2 Ahmed Mekki August 15, 2010 at 4:48 am

rambo:
when your power adapter off
you will have some thing like that
———————————————————-
root@null:/home/null# acpi -V
Battery 0: Discharging, 93%, 03:27:15 remaining
Battery 0: design capacity 2251 mAh, last full capacity 2251 mAh = 100%
Adapter 0: off-line
———————————————————
this will show you the remaining by hour .
the example in this tutorials show it as power adapter on.
thank you

Reply

3 Al B. September 10, 2010 at 3:07 am

another command “ibam”

Reply

4 Spoom December 20, 2010 at 8:12 pm

Thanks, the information is much appreciated.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: