/sbin/lsmod
The command /sbin/lsmod in Linux is used to display the currently loaded kernel modules. Here’s a detailed explanation of what lsmod does and how it is used:
Purpose of lsmod
lsmodModule Listing:
lsmodlists all the kernel modules that are currently loaded into the running kernel.Kernel modules are pieces of code that can be dynamically loaded and unloaded into the kernel to provide additional functionality, such as device drivers or filesystem support.
Dependency Checking:
It displays information about each module, including its size, dependencies (other modules it depends on), and usage count.
System Analysis:
Administrators use
lsmodto troubleshoot system issues related to modules, check module dependencies, and understand which modules are actively in use.
How to Use lsmod
lsmodBasic Usage: To display a list of loaded kernel modules, run
lsmodwithout any arguments.lsmodExample Output:
Module Size Used by nvidia_drm 61440 1 nvidia_modeset 1220608 2 nvidia_drm nvidia 21166080 65 nvidia_modeset drm_kms_helper 184320 1 nvidia_drm drm 491520 4 drm_kms_helper,nvidia_drm ...Detailed Information: Use the
-vor--verboseoption for more detailed output, including the module parameters.lsmod -vDependency Tree: Use the
-tor--treeoption to display the dependency tree of loaded modules.lsmod -t
Usage Scenarios
Driver Verification: Check if specific hardware drivers (modules) are loaded and functioning correctly.
Module Debugging: Identify module dependencies or conflicts that may be causing system instability.
System Optimization: Unload unnecessary modules to free up system resources or resolve conflicts.
Conclusion
lsmod is a crucial command-line utility in Linux for managing and inspecting loaded kernel modules. By providing insights into module dependencies and usage, lsmod facilitates efficient system administration, troubleshooting, and performance optimization. Incorporating lsmod into regular system maintenance routines enhances the reliability and functionality of Linux-based environments by ensuring proper module management and troubleshooting capabilities.
Last updated