If you’re a Linux system administrator or power user, you may need to check which drivers are currently installed on your system. Fortunately, Linux provides several ways to list installed drivers. In this article, we’ll show you how to use command-line tools to list drivers on a Linux system.
Understanding Drivers in Linux
Before we dive into how to list drivers in Linux, let’s take a moment to understand what drivers are and how they work.
In Linux, a driver is a software component that enables communication between the operating system and a hardware device. Without a driver, the operating system would not be able to control the device or access its features.
Linux drivers come in two flavors: kernel drivers and user-space drivers. Kernel drivers are part of the Linux kernel and are loaded at boot time. User-space drivers are loaded by user-space programs and run in user mode.
Using the lsmod Command
The lsmod
command is a Linux utility that lists all currently loaded kernel modules, including drivers. To list all loaded drivers, open a terminal and type:
lsmod | grep ^drm
This command uses the grep
utility to filter the output of lsmod
to show only the kernel modules that start with “drm”. The Direct Rendering Manager (DRM) is a subsystem of the Linux kernel responsible for managing graphics drivers.
You can also use the lsmod
command without grep
to list all loaded kernel modules, including drivers:
lsmod
This command will display a list of kernel modules, including their names, sizes, and dependencies.
Using the modinfo Command
The modinfo
command is another Linux utility that provides detailed information about a specific kernel module, including drivers. To use modinfo
, open a terminal and type:
modinfo <module-name>
Replace <module-name>
with the name of the module you want to inspect. For example, to display information about the DRM kernel module, type:
modinfo drm
This command will display information about the DRM module, including its description, author, license, and dependencies.
Using the lspci Command
The lspci
command is a Linux utility that lists all PCI devices connected to the system, including their drivers. To list all PCI devices and their drivers, open a terminal and type:
lspci -k
This command uses the -k
option to display the kernel driver that is currently in use by each PCI device.
Conclusion
In this article, we’ve shown you how to list drivers in Linux using command-line tools. The lsmod
command lists all loaded kernel modules, including drivers. The modinfo
command provides detailed information about a specific kernel module, including drivers. The lspci
command lists all PCI devices connected to the system, including their drivers.
By understanding how to list drivers in Linux, you can better manage your system and troubleshoot issues related to hardware devices.