| Tutorial details | |
|---|---|
| Difficulty level | Easy |
| Root privileges | No |
| Requirements | Linux terminal |
| Category | System Management |
| OS compatibility | AlmaLinux • Alpine • Amazon Linux • Arch • CentOS • Debian • Fedora • Linux • Mint • openSUSE • Pop!_OS • RHEL • Rocky • Stream • SUSE • Ubuntu |
| Est. reading time | 2 minutes |
- Open the terminal application.
- List the current device paths using the upower command:
$ upower --enumerate
Note down the battery path:/org/freedesktop/UPower/devices/line_power_AC /org/freedesktop/UPower/devices/battery_BAT0 /org/freedesktop/UPower/devices/mouse_dev_CD_27_F1_E6_00_B3 /org/freedesktop/UPower/devices/mouse_hidpp_battery_10 /org/freedesktop/UPower/devices/DisplayDevice
- Say your device path is battery_BAT0 as follows from the --enumerate option:
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0
This will list all of the power source information on your system, including your battery health status in Linux. - You can also use acpi command to print battery information in Linux. For example:
$ acpi -b
That is all.
Say hello to the inxi command
Prerequisite
By default, inxi command may not be installed on your system. Hence, use the apk command on Alpine Linux, dnf command/yum command on RHEL & co, apt command/apt-get command on Debian, Ubuntu & co, zypper command on SUSE/OpenSUSE, pacman command on Arch Linux to install the inxi.
You can also try the inxi command which is a command line system information tool made for console users. Try installing it first and then pass the -B or --battery option to see the system battery data, charge, condition at the CLI. The syntax is:By default, inxi command may not be installed on your system. Hence, use the apk command on Alpine Linux, dnf command/yum command on RHEL & co, apt command/apt-get command on Debian, Ubuntu & co, zypper command on SUSE/OpenSUSE, pacman command on Arch Linux to install the inxi.
$ inxi --battery
$ inxi -BOutputs:
Battery: ID-1: BAT0 charge: 40.6 Wh condition: 46.7/50.5 Wh (93%)
Summing up
I hope this brief tutorial can assist you in obtaining crucial information on how to check your laptop’s battery health in Linux through CLI. For more information see the following manual pages using the help command or man command:
$ man upower
$ man acpi
See also
- FreeBSD Laptop Find Out Battery Life Status Command
- FreeBSD Display Laptop Battery Charge Status
- How do I enable laptop mode to improve Linux laptop battery life?
- Download of the day: PowerTOP ~ Save and Extend Linux Laptop Battery
- How to shutdown FreeBSD laptop when running out of battery power
- upower command
🥺 Was this helpful? Please add a comment to show your appreciation or feedback.
hi,
I’m using this command
cat /sys/class/power_supply/BAT0/status /sys/class/power_supply/BAT0/capacity
thx for enriching my knowledge
As always there is a way with inxi too:
omg so easy to follow! thanks!
Good job. Thanks.
Thank you so much. I was looking for a way to check my battery charge on my laptop. I’m using a Window Manager which doesn’t give me a battery monitor by default. acpi is perfect for what I really need. Great job!!! :-)
very usefull
Useful and straight to the point, thank you!
Excellent
Great. Thanks.
This article was very help full and to the point.
Very helpful, thanks!
Very useful, thanks :)