Skip to content

Instantly share code, notes, and snippets.

@fahadysf
Last active June 30, 2022 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fahadysf/951f904c092f8ff58691a5f7c0d23277 to your computer and use it in GitHub Desktop.
Save fahadysf/951f904c092f8ff58691a5f7c0d23277 to your computer and use it in GitHub Desktop.
Apple Macbook CLI Power Status
#!/bin/bash
CYCLE_COUNT=`system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}'`
MAX_CAPACYTY=`system_profiler SPPowerDataType | grep "Maximum Capacity" | awk '{print $3}'`
echo "Cycle Count: $CYCLE_COUNT"
echo "Maximum Capacity: $MAX_CAPACYTY"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment