kmod

systemLinux
The kmod command is one of the most frequently used commands in Linux/Unix-like operating systems. kmod Manage Linux kernel modules

Quick Reference

Command Name:

kmod

Category:

system

Platform:

Linux

Basic Usage:

kmod [options] [arguments]

Common Use Cases

    Syntax

    kmod [options] command [command_options]

    Options

    Command Description
    list List loaded modules or all available modules
    info Show information about a module
    load or insert Load a module into the kernel
    unload or remove Unload a module from the kernel
    static-nodes List static device nodes for modules
    config Display configuration file directives
    help Show help message
    Common Options Description
    -v, --verbose Enable verbose output
    -q, --quiet Disable messages
    -h, --help Display help message
    -V, --version Display version information
    -a, --all (for list) List all available modules, not just loaded ones
    -p, --params (for list) Display module parameters
    -f, --force (for load/unload) Force the operation

    Examples

    How to Use These Examples

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

    # Basic Examples Basic
    kmod list
    List all currently loaded kernel modules.
    kmod info vfat
    Display information about the vfat module.
    # Advanced Examples Advanced
    kmod load e1000 Load the e1000 network driver module. kmod unload bluetooth Unload the bluetooth module. kmod static-nodes List static device nodes for modules. kmod config Display configuration file directives for modules. kmod help Show available commands. kmod list -a List all available modules, not just loaded ones. kmod list -p List module dependencies. kmod insert -f nvidia Force load the nvidia module, even if it's blacklisted.

    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

    kmod is a utility for managing Linux kernel modules, providing a unified interface for module operations. It's a modern replacement for older utilities like insmod, rmmod, lsmod, and modprobe, offering a more consistent and feature-rich approach to kernel module management. Key features of kmod: 1. Module Loading and Unloading: kmod provides commands to load (insert) and unload (remove) kernel modules, allowing dynamic extension of kernel functionality without requiring a system reboot. 2. Module Information: It can display detailed information about modules, including their parameters, dependencies, and status, which is essential for system troubleshooting and configuration. 3. Module Listing: The list command shows currently loaded modules or all available modules, providing visibility into the kernel's current state and available extensions. 4. Dependency Handling: kmod automatically resolves and manages module dependencies, ensuring that required modules are loaded in the correct order. 5. Configuration Management: The config command displays module configuration directives from files in /etc/modprobe.d/, helping administrators understand how modules are configured to load. 6. Static Node Information: With static-nodes, kmod can list static device nodes associated with modules, which is useful for understanding device management. 7. Compatibility Layer: kmod provides compatibility with traditional module management commands through symbolic links, allowing scripts that use older commands to continue functioning. Common use cases for kmod include: - Loading hardware drivers for newly connected devices - Unloading modules to free resources or resolve conflicts - Checking which modules are currently active in the system - Viewing module parameters to understand their configuration - Troubleshooting hardware issues by examining module status - Managing kernel functionality in embedded or specialized systems - Automating module operations in system scripts kmod is available on most modern Linux distributions and is particularly important for system administrators, kernel developers, and anyone who needs to manage the kernel's modular functionality. It's a key tool for hardware support, system optimization, and troubleshooting on Linux systems.

    Related Commands

    These commands are frequently used alongside kmod 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 kmod command works in different scenarios.

    $ kmod
    View All Commands