systool

system administrationLinux
The systool command is one of the most frequently used commands in Linux/Unix-like operating systems. systool View and manage sysfs devices, buses, drivers, and modules

Quick Reference

Command Name:

systool

Category:

system administration

Platform:

Linux

Basic Usage:

systool [options] [arguments]

Common Use Cases

    Syntax

    systool [options] [path...]

    Options

    Option Description
    -a, --attribute Show attributes
    -A, --attribute-value Show attributes with values (even non-numeric)
    -b, --bus=BUS Show data for the given bus
    -c, --class=CLASS Show data for the given device class
    -d, --device=DEV Show data for a specific device
    -D, --devices Show device list
    -h, --help Show help
    -m, --module=MODULE Show data for a specific module
    -p, --parameters Show module parameters
    -P, --path Show sysfs paths
    -v, --verbose Be verbose
    -V, --version Show version

    Examples

    How to Use These Examples

    The examples below show common ways to use the systool command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    Basic Examples:

    List all available buses
    systool -b
    List all drivers for a specific bus
    systool -b pci -d
    List devices from a specific bus
    systool -b pci -v
    Show attributes of a specific module
    systool -m usbcore -v
    List all available modules
    systool -m

    Advanced Examples:

    Show detailed attributes of a specific device
    systool -b pci -v -d 0000:00:00.0
    List all devices of a specific driver
    systool -b pci -d e1000e -v
    Show module attributes including non-numeric values
    systool -m e1000e -av
    List all devices on the USB bus
    systool -b usb -v
    Show detailed information about a PCI device
    systool -c pci_dev -v -a -d 0000:00:1f.3
    Display all attributes of the CPU module
    systool -m processor -a
    Show disk devices
    systool -b scsi -v
    List all module parameters for a specific module
    systool -m usbcore -ap
    View driver information for a specific device
    systool -b pci -v -d 0000:00:1f.3
    Show all PCI device IDs on the system
    systool -b pci -v | grep "Class Device path"

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    The `systool` command is a utility from the sysfsutils package that provides a way to interact with the sysfs filesystem in Linux. Sysfs is a virtual filesystem, typically mounted at `/sys`, that exports information about devices and drivers from the kernel to userspace. This makes it a powerful tool for system administrators and developers who need to examine or debug hardware components. Unlike other commands like `lspci` or `lsusb` that focus on specific buses, `systool` provides a more generic and comprehensive interface to the entire sysfs hierarchy. It can display information about buses, device classes, devices, drivers, and modules in a structured and detailed format. With `systool`, users can: 1. **View Bus Information**: List all available buses (like PCI, USB, SCSI) and their devices. 2. **Examine Devices**: Display detailed attributes of specific devices, including vendor and product IDs, configurations, and status information. 3. **Check Drivers**: View which drivers are associated with specific buses or devices, and examine their properties. 4. **Inspect Modules**: List loaded kernel modules and their parameters. 5. **Display Attributes**: Show various attributes for devices, drivers, and modules, including readable values for attributes that contain non-numeric data. The command is particularly useful for hardware debugging, as it allows administrators to dive deep into the kernel's view of the system's hardware. For example, when a device isn't functioning correctly, `systool` can help identify whether the appropriate driver is loaded and if the device is recognized properly by the kernel. It's worth noting that while `systool` provides a more user-friendly interface to sysfs, the information it displays is ultimately the same as what can be found by manually browsing the `/sys` directory. The advantage is that `systool` formats and organizes this information to make it more accessible and easier to interpret. The sysfsutils package, which includes `systool`, is not always installed by default on all Linux distributions, so it may need to be installed separately using the distribution's package manager, such as `apt-get install sysfsutils` on Debian-based systems or `yum install sysfsutils` on Red Hat-based systems.

    Related Commands

    These commands are frequently used alongside systool or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the systool command works in different scenarios.

    $ systool
    View All Commands