Ubuntu – How to check the battery’s status via the terminal
batterycommand line
I would like a command that displays the battery status in the terminal.
Best Answer
The below command outputs a lot status and statistical information about the battery. The /org/... path can be found with the command upower -e (--enumerate).
The acpi -b error you have reported most probably indicate an ACPI type issue.
ACPI is an open-standard for device and power-management.
Some laptops (most googled that I found were Acer) incorrectly report its battery details to Ubuntu. I'm not sure of your laptop type and model - nor its BIOS version.
Sometimes you need to compile your own kernel with a fixed DSDT table.
Sometimes you need to upgrade your BIOS to the very latest offered by your manufacturer.
If you decide on the latter action you should remember that updating the BIOS of a motherboard or laptop is always a risky operation, because if something goes wrong, the risk of irreparably damaging the hardware is very high.
You will need to follow the instructions for BIOS updates from your manufacturer.
Best Answer
The below command outputs a lot status and statistical information about the battery. The
/org/...
path can be found with the commandupower -e
(--enumerate
).Example output:
You could use tools like grep to get just the information you want from all that output.
One simple way: piping the above command into
outputs:
If you would often like to run that command, then you could make a Bash alias for the whole command. Example:
Add that to the end of your .bashrc file, and you can type 'bat' any time, in the terminal.
There is also a
upower -d
(--dump
) command that shows information for all available power resources such as laptop batteries, external mice, etc.