This content originally appeared on David Walsh Blog and was authored by David Walsh
I’m a big fan of having as much information as I can get within the command line. I couldn’t go without knowing which git branch I’m on, for example. Another important piece of information I like having is my current battery percentage.
To get the current battery level from command line, you can run:
pmset -g batt | grep -Eo "\d+%"
Since I get lost in command line for hours at a time, having the percentage present saves me the labor of shifting my eyes outside of shell. What information do you like having in your command line?
The post How to Get Mac Battery Level from Command Line appeared first on David Walsh Blog.
This content originally appeared on David Walsh Blog and was authored by David Walsh

David Walsh | Sciencx (2023-04-10T17:09:59+00:00) How to Get Mac Battery Level from Command Line. Retrieved from https://www.scien.cx/2023/04/10/how-to-get-mac-battery-level-from-command-line/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.