commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
If you want to do the same in OS X... grep as necessary for information you need....
There is 1 alternative - vote for the best!
The original proc file doesn't exist on my system.
In my case it was actually like this...
This prints "Charging" or "Discharging". Obviously, this will indicate the status of the AC adapter. The awk part could be from 1-6. I removed the comma because it is useless when only looking at one element of the output array. See acpi(1) for more info.
If you can do better, submit your command here.
You must be signed in to comment.