Battery Status Commands on Windows, macOS, and Linux

Terminal commands for finding battery status information on Windows, macOS, and Linux.

  • Windows (PowerShell) powershell Get-CimInstance Win32_Battery | Select-Object EstimatedChargeRemaining, EstimatedRunTime Battery percentage only: powershell (Get-CimInstance Win32_Battery).EstimatedChargeRemaining Detailed battery report: powershell powercfg /batteryreport

  • macOS bash pmset -g batt More detailed battery information: bash system_profiler SPPowerDataType

  • Linux Using upower: bash upower -i "$(upower -e | grep BAT)" Percentage only: bash upower -i "$(upower -e | grep BAT)" | grep percentage Directly from sysfs: bash cat /sys/class/power_supply/BAT0/capacity If acpi is installed: bash acpi -b