Help for this page

Select Code to Download


  1. or download this
    $ cat /proc/acpi/battery/BAT0/info
    present:                 yes
    ...
    serial number:           49233 2011/02/25
    battery type:            LIon
    OEM info:                Hewlett-Packard
    
  2. or download this
    $ cat /proc/acpi/battery/*/* | grep capacity:
    design capacity:         5144 mAh
    last full capacity:      5144 mAh
    remaining capacity:      5144 mAh
    $
    
  3. or download this
    $ perl -MDP -e'while(<>){/^(.*)\s+capacity:\s*((\d+).*)/ and$i{$1}=[$2
    +,$3]}print"$_: $i{$_}[0], "for keys%i;printf"%5.1f%%\n",100*$i{remain
    +ing}[1]/$i{design}[1]' /proc/acpi/battery/*/*
    remaining: 5144 mAh, design: 5144 mAh, last full: 5144 mAh, 100.0%