Linux operating systems utilize the Advanced Configuration and Power Interface (ACPI) daemon to deliver essential battery information. This feature is available in most Linux distributions, ensuring users can easily access battery-related data. The battery information is stored within the /sys filesystem, a location that can be navigated from the command line, or you can use dedicated tools such as acpi and upower.
By accessing the /sys filesystem, or by using command-line tools such as upower or acpi, you can quickly and efficiently view your battery information in Linux.
$ ls /sys/class/power_supply/BAT0/ alarm charge_full_design device present technology voltage_now capacity charge_now manufacturer serial_number type capacity_level current_now model_name status uevent charge_full cycle_count power subsystem voltage_min_design
$ cat /sys/class/power_supply/BAT0/capacity 100
$ upower -i /org/freedesktop/UPower/devices/battery_BAT0 native-path: BAT0 vendor: Samsung SDI model: DELL TXF9M6C serial: 34075 power supply: yes updated: Fri 05 Jul 2019 11:27:48 AM +08 (91 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: fully-charged warning-level: none energy: 54.0968 Wh energy-empty: 0 Wh energy-full: 54.0968 Wh energy-full-design: 61.9932 Wh energy-rate: 0 W voltage: 8.504 V percentage: 100% capacity: 87.2625% technology: lithium-polymer icon-name: 'battery-full-charged-symbolic'
$ sudo apt update && sudo apt install --assume-yes acpi #Ubuntu and Debian
$ acpi Battery 0: Full, 100%
$ acpi --battery --details Battery 0: Full, 100% Battery 0: design capacity 8157 mAh, last full capacity 7118 mAh = 87%
Comment anonymously. Login not required.