How to emit battery data in a one-liner on MacOS
In MacOS the command to emit data about battery status is: pmset -g batt If you want to record the battery percentage level in a file at regular intervals, here is how to record the data in a one-liner: while true; do \ echo “$(date “+%Y-%m-%d %H:%M:%S”) ” \ “$(pmset -g batt | grep “%” … More How to emit battery data in a one-liner on MacOS