Skip to main content
edited body
Source Link
nohillside
  • 108.4k
  • 43
  • 230
  • 291

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition, for example: Normal.

If you want more output, run:

system_profiler SPPowerDataType | grep -A3 -C7B7 "Condition" 

to get something similar to this:

 Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition, for example: Normal.

If you want more output, run:

system_profiler SPPowerDataType | grep -A3 -C7 "Condition" 

to get something similar to this:

 Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition, for example: Normal.

If you want more output, run:

system_profiler SPPowerDataType | grep -A3 -B7 "Condition" 

to get something similar to this:

 Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 
add output
Source Link
jaume
  • 15.8k
  • 4
  • 61
  • 75

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition, for example: Normal.


 

MoreIf you want more output, run:

system_profiler SPPowerDataType | grep -A3 -C7 "Condition" 

to get something similar to this:

 Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition.


 

More output:

system_profiler SPPowerDataType | grep -A3 -C7 "Condition" Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition, for example: Normal.

If you want more output, run:

system_profiler SPPowerDataType | grep -A3 -C7 "Condition" 

to get something similar to this:

 Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition.


More output:

system_profiler SPPowerDataType | grep -A3 -C7 "Condition" Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition.

Something like

system_profiler SPPowerDataType | grep "Cycle Count" | awk '{print $3}' 

should do the job.

system_profiler SPPowerDataType | grep "Condition" | awk '{print $2}' 

will get you the battery condition.


More output:

system_profiler SPPowerDataType | grep -A3 -C7 "Condition" Charge Information: Charge Remaining (mAh): 2405 Fully Charged: No Charging: No Full Charge Capacity (mAh): 3816 Health Information: Cycle Count: 187 Condition: Normal Battery Installed: Yes Amperage (mA): -2635 Voltage (mV): 11212 
added from comments.
Source Link
anki
  • 12.1k
  • 7
  • 36
  • 74
Loading
Source Link
Matthieu Riegler
  • 22k
  • 11
  • 64
  • 97
Loading