In this article we are going to shows how to use lsmod command in Linux Terminal. If you want to learn about lsmod command in Linux with Examples then this post is ideal for you.
Lsmod is a command line utility in Linux that is used to displays the information about the loaded Linux kernel modules.
Linux kernel is a core component of Linux operating systems. It manages the all resources and communication between your computer hardware and software. Module is a block of code that extends the functionality of linux kernel. A modules is compiled as loadable modules or built into the kernel.
In the Linux, the kernel modules are located at the /lib/modules/<kernel_version>
directory. To check the version of the running kernel , use the uname -r
command.
Linux is an operating system, like Windows OS, iOS, and Mac OS. Linux is one of the most popular operating system on the planet, Android is also powered by Linux OS(operating system).
Linux OS(operating system) is also distributed under an open source license. Open source following these points :
- Freely to run the program, for any purpose.
- Free to study how the program works.
- Freely to re-distribute copies so you can help your friends.
- Free to distribute copies of your modified versions to others.
lsmod Command in Linux
lsmod is a simple command line utility and it has no options and arguments. It is simply reads and display the contents of the file /proc/modules
in a well formatted list.
Run the lsmod command to find out what kernel modules are currently loaded:
$ lsmod
Output
Module Size Used by
cmac 16384 0
rfcomm 81920 4
...
ahci 40960 1
intel_lpss_pci 20480 0
i2c_i801 32768 0
libahci 32768 1 ahci
intel_lpss 16384 1 intel_lpss_pci
...
You can see in above output that lsmod command display information for each loaded Linux kernel module.
The above output has three columns in each row that are listed below:
Module
– Displays the name of the module.Size
– Display the size of the module in bytes.Used by
– Display a number that is indicates how many instances of the module are currently used. if it has zero value means module is not used.
You can filter the output of lsmod using grep command to find out a specific module is loaded or not.
For an example, run the below command to check out kvm module:
$ lsmod | grep kvm
Output
kvm_intel 227078 0
kvm 650504 1 kvm_intel
irqbypass 17374 1 kvm
That’s all.
If you face any error and issue in above steps , please use comment box below to report.
If our tutorials helped you, please consider buying us a coffee. We appreciate your support!
Thank you for your support.