BATTERY-STATS(5)
π¦ battery-stats(5) π¦
okay so bestie, welcome to the File Formats Manual, this one's all about battery-stats β the collected battery statistics π
β¨ NAME β¨
battery-stats β collected battery statistics π
πΈ DESCRIPTION πΈ
So like. battery-stats is the file that holds all the statistics about battery charge over time, bestie. And who's out here collecting them? The battery-stats-collector(8) daemon. That's the one doing the work, we're just reading its diary. πβ¨
π FORMAT π
Every single line in the file = one sample. That's it. One line, one sample, no cap.
And each line looks like this:
<seconds> <charge%> <powermode> <UTC-date> <UTC-time>
They're separated by spaces and terminated by a newline. Periodt. πβοΈ
Where:
secondsβ the number of seconds since 1st Jan 1970 00:00:00 UTC β°charge%β the battery charge, a number between 0 and 100 πpowermodeβ tells you the power mode:0A/C off1On battery2On backup power
UTC-dateβ a human-readable date in the formatYYYY/MM/DD. And listen, this is in UTC, not the local or system timezone. Do not come for me about timezones bestie, it says UTC and it means UTC πUTC-timeβ a human-readable time in the formatHH:MM:SS(using a 24-hour clock). Also UTC, also not the local or system timezone. Same deal π°οΈminutes-leftβ this one is the BIOS estimate of how many minutes of running time the battery would provide. It may be unreliable, depending on the BIOS through which it was collected. So like... take it with a grain of salt π
π EXAMPLE π
A battery under charge might give you samples that look like this:
1032651245 27 1 2002/09/21 23:34:05 94
1032651275 28 1 2002/09/21 23:34:35 97
1032651305 29 1 2002/09/21 23:35:05 100
1032651335 30 1 2002/09/21 23:35:35 103
1032651365 30 1 2002/09/21 23:36:05 106
look at her go, charging up like a main character π₯π
π FILES π
The default set-up is to save battery statistics in /var/log and rotate the logs weekly, which results in this little family of files:
/var/log/battery-statsβ current (most recent) statistics π/var/log/battery-stats.[0-9]+β less recent statistics πΈ/var/log/battery-stats.[0-9]+.gzβ ancient statistics π (the archives, the elders, the ancestors)
π SEE ALSO π
battery-graph(1), battery-stats-collector(8).
β AUTHOR β
Karl E. Jorgensen <karl@jorgensen.com> β ty for your service king π«Ά
and that's the whole page bestie, you ate that π β¨
okay so this version is dated September 23, 2002, iykyk β vintage, iconic, still slaying ππ¦π
π¦ where this page comes from
- debian bookworm: battery-stats 0.5.6-2+b2 Β· GPL-2.0-or-later
- debian trixie: battery-stats 0.5.6-2.1 Β· GPL-2.0-or-later
- ubuntu jammy: battery-stats 0.5.6-2 Β· GPL-2.0-or-later
- ubuntu noble: battery-stats 0.5.6-2.1 Β· GPL-2.0-or-later
- ubuntu resolute: battery-stats 0.5.6-3 Β· GPL-2.0-or-later
- ubuntu stonking: battery-stats 0.5.6-3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms