upower command in Linux with examples

h‮‬ttps://www.lautturi.com
upower command in Linux with examples

The upower command is a command-line utility that can be used to manage power devices and get information about the system's power state on a Linux system. It is part of the upower library, which is a cross-distribution abstraction for power management systems.

Here are some examples of how you can use the upower command:

  • To get a list of all power devices on the system, you can use the --enumerate option:
upower --enumerate

This will display a list of all power devices on the system, along with their object path and type.

  • To get information about a specific power device, you can use the --dump option followed by the object path of the device:
upower --dump /org/freedesktop/UPower/devices/battery_BAT0

This will display detailed information about the specified power device, including its type, state, capacity, and other properties.

  • To get the system's current power state, you can use the --print-state option:
upower --print-state

This will display the current power state of the system, such as "fully-charged" or "discharging".

  • To get the system's current battery level, you can use the --percentage option:
upower --percentage

This will display the current battery level of the system as a percentage.

By using the upower command and its various options, you can manage power devices and get information about the system's power state on a Linux system. You may want to refer to the upower documentation or online resources for more information about the command and its options.

Created Time:2017-10-30 14:27:36  Author:lautturi