lspower gives you a one-line, read-only view of every power source Linux can see, and it is perfectly happy telling you there are none. The examples use lspower from powermgmt-base version 1.37ubuntu0.1. Allow about five minutes. Nothing here needs sudo: the command reads status and does not touch charging, suspend settings, drivers or firmware.
Check which executable your shell will run, then record the package version. Both are ordinary, read-only checks:
$ command -v lspower
/usr/bin/lspower
$ dpkg-query -W -f='${Package} ${Version}\n' powermgmt-base
powermgmt-base 1.37ubuntu0.1
The command has no options in the installed manual; its synopsis is simply lspower. If command -v prints nothing, stop and install the package through your normal distribution process. Do not copy options from an unrelated power tool and expect them to work.
Checkpoint: you have confirmed the binary and package version before interpreting any output.
Run the command without arguments:
$ lspower
No powers supply sensors; that's normal on a desktop.
The exact output is host-specific. A laptop with a battery may show one or more named sources, their status symbols, a charge level and any abnormal condition. This desktop reports no power supply sensors, and that message is still a successful result, not a command failure:
$ lspower
No powers supply sensors; that's normal on a desktop.
$ printf 'exit status: %s\n' "$?"
exit status: 0
The wording comes from the installed program and is not a promise that every release phrases an empty result identically. Use the exit status to separate successful inspection from a process or permission error.
When a source is present, lspower puts an icon beside its status. Read the symbol as a state, not as a percentage. These are the lspower status symbols:
| Symbol | Meaning |
|---|---|
✗ | The source is absent or somehow disabled. |
✓ | A working source that is not an apparent battery, such as mains power. |
+ | A battery is charging. |
• | A battery is full or is otherwise not charging. |
- | A battery is supplying stored power. |
The distinction between a full battery and one that is merely not charging is deliberate: the symbol alone does not tell you why charging has stopped. If the kernel knows the charge level, the program displays that too, and it may also report an abnormal condition such as overheating.
Do not treat ✓ as proof a battery is full. It describes a non-battery source that is working, while • describes a battery that is full or not charging.
For a one-off diagnosis, save the output with the command's normal text intact. This is useful when reporting what a machine saw at a particular moment:
$ lspower | tee /tmp/lspower-report.txt
$ sed -n '1,40p' /tmp/lspower-report.txt
tee displays the result and writes a temporary copy. The file is a snapshot, not a live monitor. Remove it once you no longer need it:
$ rm -- /tmp/lspower-report.txt
Warning: that removal is irreversible. Skip it if you need to retain the diagnostic, or choose a path in your own case-management area instead. Neither lspower nor the report command changes the machine's power state.
The manual explicitly says the output is for human consumption and is not intended to be screen-scraped. Names, spacing, icons, wording and empty-result messages can all change between releases or machines, so a pipeline such as lspower | grep '+' is a fragile alert, not a supported interface.
For a programmatic check, read the kernel's power-supply data under /sys/class/power_supply/ instead. First inspect what this machine exposes:
$ printf '%s\n' /sys/class/power_supply/*
/sys/class/power_supply/AC
/sys/class/power_supply/BAT0
The paths above are examples, not expected output for every host. If the glob has no match, the shell may print the pattern literally depending on its settings. Check safely with:
$ find /sys/class/power_supply -mindepth 1 -maxdepth 1 -type l -print
Use the files exposed by the relevant link for an application or monitoring script, and handle missing sensors as a normal state. Do not grant an application more privilege merely because a source is absent.
If the command is missing, verify the package name and executable path before changing anything. If it exits non-zero, preserve the error text and inspect the package installation, shell environment and permissions. Running it as root is not a general repair, and it can hide a problem with the normal user's environment.
If a laptop shows no battery, compare the human-readable result with the kernel directory:
$ lspower
$ find /sys/class/power_supply -mindepth 1 -maxdepth 1 -type l -print
An empty directory means the kernel has not exposed a power-supply device to this system. If a device link exists but the display is unexpected, keep the command output, kernel logs and package version together for further investigation. Do not infer a hardware fault from one snapshot alone.
lspower resolves to the expected executable and its package version is known./sys/class/power_supply/ for programmatic checks instead of scraping display text.