Get the exact Battery percentage on your Mac with Terminal

If you’re not really happy with the battery percentage which shows up in the menu bar, just like me, then here’s how to get the batter percentage (with a two decimal accuracy or even more with simple tweaks) from the Terminal for Mac.

I was originally a Hackintosh guy, before completely adopting to the Macintosh ecosystem. Back then, I was using GeekTool to show all the system information on the desktop. While that helped me judge my battery performance, after moving to MacBook Pro, genuinely, I was not able to get the exact battery percentage in a jiffy.

But thanks to the Terminal on Mac. One of the most powerful tool I’ve ever used on a Mac, has a way to do this. Just fire-up Terminal on Mac, and type the following command:

ioreg -l | grep -i capacity | tr 'n' ' | ' | awk '{printf("%.2f%%", $10/$5 * 100)}'

This would result in a better battery percentage with exact reading like 88.22 percentage and such. You can definitely tweak the calculation in the Terminal Command which you used above to get even more precise reading. Here’s a screenshot for your reference.

Update: Well; I just made a quick video explaining this:

Hope this helps. You can also find other interesting tutorial on Mac here on Geek Center.

Subscribe to 4CAST

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 23 other subscribers