How to check laptop battery status in Ubuntu terminal without third party tools

You can check the battery status and level of your laptop in the Terminal application without using any third party tools. This requires using the upower command on Ubuntu. Upower is a simple command line system-wide power management tool. It is pre-installed on Ubuntu OS. This article will show you how to view battery details in the terminal.For more information on upower click here.

Check the battery status of your laptop in Linux.

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

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

How to check laptop battery status in Ubuntu terminal without third party tools

It will display all possible details about your battery. Run this command if you only want to view the battery status and percentage.

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

How to check laptop battery status in Ubuntu terminal without third party tools

You can also use it to display the current status.

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

If you know the native path, you can use the following command to display all details in your Linux terminal:

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

If the above command does not work, run this command.

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

Run this command in a terminal for usage details.

man upower

that’s all. This way, you can view the battery details in the Terminal application without using any other app.

If you like this article, please subscribe to us Youtube channel. You can also stay connected with us twitter And Facebook.

Recommended Recommendation: How to Install MOC Music Player on Ubuntu-Command Line Music Player
It’s a sequel.
.

Sidebar