How To Check Laptop Battery Status In Terminal on Ubuntu without 3rd party tools

You can check your laptop battery status and its level in your terminal application without any third party tools. For this you need to use the upower command in Ubuntu. Upower is a simple command line system-wide power management tool. It is pre-installed with your Ubuntu OS. In this article we will see how to view battery details in terminal.For more details about upower click here.

 

Check Laptop Battery Status in Linux:

To show the battery status in your terminal application using Upower, open your terminal app (ctrl+alt+t) and run this upower command.

upower -i `upower -e | grep 'BAT'`

It will show the all possible details about your battery. If you want to show just the battey state and the percentage, then run this command.

upower -i $(upower -e | grep '/battery') | grep --color=never -E "state|to\ full|to\ empty|percentage"

You can also use this to show the current state.

upower -i $(upower -e | grep 'BAT') | grep -E "state|to\ full|percentage" | awk '/perc/{print $2}'

If you know the native path, then you can use the below command to show all details in your linux terminal.

upower -i /org/freedesktop/UPower/devices/battery_BAT1

If the above command not work then run this command.

upower -i /org/freedesktop/UPower/devices/battery_BAT0

For the complete usage details please run this command in terminal.

man upower

That’s all. In this method you can view your battery details in your teminal application without any other apps.

Also Read:  D-Spy D-Bus Explorer

Watch Video:

If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



Leave a Reply