How to use the command 'acpi' (with examples)

How to use the command 'acpi' (with examples)

The ‘acpi’ command is used to show battery status or thermal information on a Linux system. It provides a convenient way to monitor the power management and thermal information of a system.

Use case 1: Show battery information

Code:

acpi

Motivation: This use case is useful when you want to quickly check the battery status of your laptop or other portable devices. It provides information on the battery’s capacity, charging status, and remaining time.

Explanation: Running the ‘acpi’ command without any arguments will display the battery information. It retrieves the information from the ‘/sys’ directory.

Example Output:

Battery 0: Discharging, 46%, 00:51:32 remaining

Use case 2: Show thermal information

Code:

acpi -t

Motivation: Monitoring thermal information is crucial to prevent overheating issues in a system. This use case allows you to check the temperature of different thermal zones present in your system.

Explanation: Adding the ‘-t’ option to the ‘acpi’ command retrieves the thermal information of the system. It provides the temperature readings in Celsius.

Example Output:

Thermal 0: ok, 38.0 degrees C

Use case 3: Show cooling device information

Code:

acpi -c

Motivation: Understanding the cooling devices in a system is essential for monitoring and managing the temperature. This use case provides information about the cooling devices available in a system.

Explanation: The ‘-c’ option is used to display cooling device information. It provides details about the cooling devices, such as the number of cooling devices present and their states.

Example Output:

Cooling 0: Processor 0 of 10
Cooling 1: Processor 0 of 10

Use case 4: Show thermal information in Fahrenheit

Code:

acpi -tf

Motivation: Some users may prefer temperature readings in Fahrenheit instead of Celsius. This use case allows you to view the thermal information in Fahrenheit.

Explanation: Adding the ‘-tf’ options to the ‘acpi’ command fetches the thermal information in Fahrenheit.

Example Output:

Thermal 0: ok, 100.4 degrees F

Use case 5: Show all information

Code:

acpi -V

Motivation: By running this command, you can obtain comprehensive information about the system’s battery, thermal zones, and cooling devices.

Explanation: The ‘-V’ option fetches all available information, including battery, thermal, and cooling device details.

Example Output:

Battery 0: Discharging, 46%, 00:51:32 remaining
Thermal 0: ok, 38.0 degrees C
Cooling 0: Processor 0 of 10
Cooling 1: Processor 0 of 10

Use case 6: Extract information from /proc instead of /sys

Code:

acpi -p

Motivation: Extracting information from ‘/proc’ instead of ‘/sys’ can be useful when ‘/sys’ directory access is restricted or unavailable.

Explanation: The ‘-p’ option instructs the ‘acpi’ command to retrieve information from the ‘/proc’ directory instead of the default ‘/sys’. This option can be handy in certain scenarios where ‘/sys’ access is restricted.

Example Output:

Battery 0: Full, 100%
Battery 1: Unknown, 69%

Conclusion:

The ‘acpi’ command is a beneficial utility for monitoring battery status and thermal information on a Linux system. By utilizing the various options explained in this article, users can easily obtain crucial system information related to power management and temperature monitoring. Whether you need to check battery status, monitor temperature, or get information about cooling devices, the ‘acpi’ command provides a reliable and user-friendly interface to easily access this information.

Tags :

Related Posts

CD Command (with examples)

CD Command (with examples)

The cd command is a fundamental command in Unix-based operating systems that allows users to change their current working directory.

Read More
How to use the command `sqfstar` (with examples)

How to use the command `sqfstar` (with examples)

The command sqfstar is used to create a squashfs filesystem from a tar archive.

Read More
How to use the command ppmtoacad (with examples)

How to use the command ppmtoacad (with examples)

The ppmtoacad command is a utility that allows you to convert PPM images to AutoCAD databases or slides.

Read More