When troubleshooting deeply technical hardware issues on a Mac—such as USB power draw problems, external display handshakes, or Bluetooth controller states—the standard graphical “System Information” tool often lacks the necessary granular detail. The macOS operating system manages all hardware and drivers through a massive hierarchical database known as the I/O Kit Registry. To access this raw, unfiltered hardware tree directly from the terminal, administrators use the ioreg command.
Why Use the ioreg Command?
The ioreg command provides a direct window into how the macOS kernel (specifically the I/O Kit framework) perceives the physical hardware connected to the machine. It exposes the exact driver parameters, power states, and vendor IDs for every single component. Because it prints text to standard output, it is highly useful for diagnostic bash scripts, remote SSH troubleshooting, and parsing specific hardware capabilities that Apple’s graphical interfaces hide from average users.
Step 1: View the Entire Hardware Tree
The most basic usage dumps the entire registry. Be warned: this output will be massive.
- Open the macOS Terminal application.
- Type the following command and press Enter:
ioreg -l
The -l (long) flag tells the command to show all the properties associated with every node in the tree. You will see thousands of lines of code detailing everything from your internal SSD to the thermal sensors.
Step 2: Search for a Specific Device Class
To make the output readable, you should filter the registry by a specific hardware class using the -c (class) flag. For example, to investigate your USB controllers:
- Run the following command:
ioreg -c IOUSBDevice
This will drastically reduce the output, showing only the branches of the I/O tree that pertain to connected USB devices. You can use this to verify if a failing external hard drive is actually being recognized by the silicon, even if it is not mounting in the Finder.
Step 3: Search for a Specific Keyword
If you don’t know the exact I/O Kit class name, you can pipe the output into the grep command to search for common strings.
- To find information about your battery, you could run:
ioreg -l | grep -i "battery"
This is frequently used to extract raw battery health metrics, such as cycle count and maximum capacity, directly from the power management node.
Step 4: View the Registry as a Clean Tree
If you want to understand the physical relationship between components (e.g., seeing which USB hub a specific keyboard is plugged into), use the tree view.
- Run the command with the
-tflag:
ioreg -t
This formats the output with indentation, visually demonstrating the parent-child relationships between PCI bridges, controllers, and end-point devices.
By mastering the ioreg command, macOS administrators can bypass graphical abstractions and diagnose complex hardware failures at the lowest levels of the operating system.