It is important to check up on your laptop's battery often, after all, your battery is what makes your laptop portable. When new, batteries run longer, but over time, it may not be the case. If not looked after properly, your battery may drain faster due to poor usage.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform several Ubuntu related tasks.
In this context, we shall look into how to use Ubuntu 20.04 to create detailed battery usage reports.
How to View the battery report using the Ubuntu UI ?
You can view your battery report through the UI using Power Statistics. This a very helpful tool that lets you see how much power you use, along with the different trends
The Power Statistics tool comes installed with most Linux distributions, if you don’t have it, you can install it using Ubuntu Software.
i. To install it using the gnome-power-manager package using the command:
sudo apt-get install gnome-power-manager
You can look for the Power Statistics tool using the Applications Menu.
ii. Search for Power Statistics.
iii. Click the Power Statistics icon. This will take you to the tool.
iv. Click on Laptop Battery to view details.
To view battery history, switch to the History tab. You can view different graphs here by selecting the graph type and data length.
The Statistics tab shows graphs for charge profile, charge accuracy, discharge profile, and discharge accuracy.
How to view the battery report using the Ubuntu Command Line ?
1.You can use upower.
To do this, execute the command below:
$ upower -i `upower -e | grep 'BAT'`
The command shows all the battery details including the model, vendor, serial number, voltage, state, and so on.
Another command that shows similar results is:
upower -i /org/freedesktop/UPower/devices/battery_BAT0
To learn more about upower, use:
This will take you to the upower manual where you can view all the different options and their descriptions.
2. You can also use acpi
Another command that you can use is the acpi command. You may need to install it first. The command for installing acpi is:
sudo apt-get install acpi
To view battery details, run
To view the details on a battery charge, use:
To check the cooling information of your battery, use:
You can check if AC power is connected using:
To learn more about acpi, use:
This will take you to the acpi manual where you can view all the different options and their descriptions.
3. You can use TLP
Another tool is TLP. It is free and open-source. To download TLP, use:
sudo apt install tlp
To view battery related information, use:
sudo tlp-stat –b
To view more information, use:
sudo tlp-stat –s
About Sysfs File system
The sysfs file system provides information on kernel modules, devices, and other kernel components.
To view battery information, run:
[Need urgent assistance with Ubuntu Software Installation and Configuration? We are available to help you. ]