The conversation on this page has been archived and is no longer active.

Checking Battery Level

Message #1 - Posted 2004/03/07 - frank malinowski

Mac Addict gives a UNIX command to check on battery level from the Terminal program: ioreg-l|grep-iIOBatteryInfo
This does not work for me, I get the response Command not found, what am I missing? Are there spaces or do I have the characters wrong? I have a PBG4Ti400 OS 10.2.8

delete "X" for correct email address

Message #2 - Posted 2004/03/07 - Bev A. Kupf

On Sun, 07 Mar 2004 03:29:59 GMT,
frank malinowski (Xyakers@earthlink.net) wrote:

Mac Addict gives a UNIX command to check on battery level from the Terminal program: ioreg-l|grep-iIOBatteryInfo
This does not work for me

ioreg -l | grep -i iobatteryinfo

Bev A. Kupf
"The lyfe so short, the craft so long to lerne" -- Chaucer Stripes - Martha Stewart's new Spring collection

Message #3 - Posted 2004/03/07 - Hanspeter 'Happl' Oberlin

Previously, frank malinowski wrote:

Mac Addict gives a UNIX command to check on battery level from the Terminal program: ioreg-l|grep-iIOBatteryInfo
This does not work for me, I get the response Command not found, what am I missing? Are there spaces or do I have the characters wrong? I have a PBG4Ti400 OS 10.2.8

The correct command is
ioreg -l|grep -i IOBatteryInfo

Gruesse aus der Schweiz
Salutations en provenance de Suisse
Saluti dalla Svizzera
Greetings from Switzerland
Happl

Message #4 - Posted 2004/03/07 - Peter Renzland

Hanspeter 'Happl' Oberlin wrote:

frank malinowski wrote:

Mac Addict gives a UNIX command to check on battery level from the Terminal program: ioreg-l|grep-iIOBatteryInfo
This does not work for me, I get the response Command not found, what am I missing? Are there spaces or do I have the characters wrong? I have a PBG4Ti400 OS 10.2.8

The correct command is
ioreg -l|grep -i IOBatteryInfo

That is, apparently, what was intended. However, as Bev implied, observing the CAPS is a bit pointless with "-i".

I would suggest using this:

/usr/sbin/ioreg -p IODeviceTree -n battery -w 0 |grep Bat

And the OP (Frank) might be better off using XBattery, which is very pretty. Or Gˆran Larsson's well-written shell script: battery. Or my poorly written batmon, especially if he has a "problem" battery.

Peter Renzland, in Toronto

Need Help? Have a Question?

Looking for more help, comments, and answers?

Ask your questions on Ask Different. Ask Different is a community of Apple users ready to help.