Skip to content

Instantly share code, notes, and snippets.

@fahadysf
Created April 26, 2024 11:59
Show Gist options
  • Save fahadysf/e38e87a82378aca4df487cb1b668fa19 to your computer and use it in GitHub Desktop.
Save fahadysf/e38e87a82378aca4df487cb1b668fa19 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Script to print out the current power cycles and capacity of Macbooks
# which provide this info.
# -------
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