LinuxCommandLibrary

systool

Show system device information

TLDR

List all attributes of devices of a bus (eg. pci, usb). View all buses using ls /sys/bus

$ systool -b [bus] -v
copy

List all attributes of a class of devices (eg. drm, block). View all classes using ls /sys/class
$ systool -c [class] -v
copy

Show only device drivers of a bus (eg. pci, usb)
$ systool -b [bus] -D
copy

SYNOPSIS

systool [options] { -b | -c | -d | -m | -v | -p } [sysfs_path | object_name]

PARAMETERS

-a
    Show all attributes for the selected objects. This option makes the output very verbose.

-A attribute
    Show only the specified attribute(s). Can be used multiple times for several attributes. This filters the output significantly.

-b [bus_name]
    List devices belonging to a specific bus type (e.g., 'usb', 'pci'). If bus_name is omitted, all bus types are listed.

-c [class_name]
    List devices belonging to a specific class (e.g., 'net', 'sound'). If class_name is omitted, all classes are listed.

-d [device_name]
    Show device-specific information. If device_name is omitted, all devices are listed. Often used with -v for detailed output.

-D driver_name
    Show devices currently using the specified driver_name.

-k
    Show kernel driver information. Usually combined with -v to show driver-specific attributes.

-m [module_name]
    Show module-specific information. If module_name is omitted, all loaded modules are listed. Useful for checking module parameters and dependencies.

-P
    Show bus-specific information. Provides details about the bus itself rather than devices on it.

-p [sysfs_path]
    Show information for a specific sysfs path (e.g., '/sys/devices/pci0000:00/0000:00:1c.0'). This is the most direct way to query sysfs.

-r
    Show attributes in raw format, without any human-readable formatting or unit conversions. Useful for scripting.

-s [subsystem_name]
    Show information about a specific subsystem (e.g., 'block', 'net'). If subsystem_name is omitted, all subsystems are listed.

-u
    Show only devices with hotplug attributes. Useful for identifying devices that can be dynamically added or removed.

-v
    Verbose output. Includes detailed information and often all attributes for the selected object, similar to -a for devices/modules.

-h
    Display a brief help message and exit.

-V
    Display version information and exit.

DESCRIPTION

The systool command is a utility from the sysfsutils package designed to query information exposed by the Linux kernel through the sysfs virtual filesystem. Sysfs provides a hierarchical view of the kernel's device model, including devices, drivers, buses, and modules. systool allows users to navigate and display attributes of these objects, making it invaluable for system introspection, hardware diagnostics, and debugging.

It can list devices by bus, class, or driver, show detailed attributes of specific devices or modules, and filter output to find relevant information quickly. While udevadm info also provides similar device information, systool offers a distinct interface for exploring the raw sysfs structure, often preferred by system administrators and developers needing a direct view into the kernel's device model.

CAVEATS

systool relies on the sysfs filesystem being mounted, which is typically found at /sys on modern Linux distributions. Its output can be extremely verbose, especially when using -a or -v without specific filters, making it challenging to parse manually. While powerful for introspection, systool does not allow modification of kernel parameters or device states; it is strictly a read-only utility.

USAGE EXAMPLES

Here are a few common ways to use systool:

List all USB devices with verbose details:
systool -b usb -v

Show details of a specific PCI device (e.g., a network card):
systool -d bridge:pci0000:00:1f.6 -v
(Note: The device path will vary on your system)

Examine a specific kernel module (e.g., 'usb_storage'):
systool -m usb_storage -v

List all devices within the 'net' class:
systool -c net

Show the 'manufacturer' attribute for all USB devices:
systool -b usb -A manufacturer

HISTORY

systool is part of the sysfsutils package, which was developed to provide user-space utilities for interacting with the sysfs virtual filesystem. Sysfs itself emerged in the Linux 2.6 kernel series as a replacement for the older `devfs` and a more structured way to expose kernel objects and their attributes. systool was created to offer a command-line interface to navigate this rich information source, serving as a primary tool for examining hardware and kernel device model details before udevadm gained its comprehensive info querying capabilities.

SEE ALSO

sysfs(5), lsmod(8), lspci(8), lsusb(8), lshw(1), udevadm(8), dmesg(1)

Copied to clipboard