How do I list the kernel modules loaded in kernel?

How do I list the kernel modules loaded in kernel?

Module Commands

  1. depmod – handle dependency descriptions for loadable kernel modules.
  2. insmod – install loadable kernel module.
  3. lsmod – list loaded modules.
  4. modinfo – display information about a kernel module.
  5. modprobe – high level handling of loadable modules.
  6. rmmod – unload loadable modules.

How do I know what kernel modules are loaded?

To list all currently loaded modules in Linux, we can use the lsmod (list modules) command which reads the contents of /proc/modules like this.

Why do we need kernel module?

Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. Without modules, we would have to build monolithic kernels and add new functionality directly into the kernel image.

How to load and unload kernel modules in Linux?

How to Load and Unload (Remove) Kernel Modules in Linux. To load a kernel module, we can use the insmod (insert module) command. Here, we have to specify the full path of the module. The command below will insert the speedstep-lib.ko module. # insmod /lib/modules/4.4.0-21-generic/kernel/drivers/cpufreq/speedstep-lib.ko

How to load a custom module in Linux?

Add the simple name of my module to the file /etc/modules. You can edit the file or just append to it as shown here. Update the list of module dependencies. Reboot the computer and voila, it worked. Add the module to the /etc/modules file. And then put the module in your /lib/modules/kernelname catalogue.

Which is an example of a kernel module?

A simple example of a module is a device driver – which enables the kernel to access a hardware component/device connected to the system.

What does modprobe do in the Linux kernel?

modprobe is an intelligent command for listing, inserting as well as removing modules from the kernel. It searches in the module directory /lib/modules/$ (uname -r) for all the modules and related files, but excludes alternative configuration files in the /etc/modprobe.d directory.