/lib/modules/

This wiki page is about a path or a file in the Linux file system. Be bold and improve it! Describe its purpose and its use, which program created it and uses it, which configuration settings it might be dependent on, and which Linux distributions typically have this file by default while others might not.

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

Table of Contents

Linux Kernel modules (drivers, etc.) are placed is sub-directories of /lib/modules/.
The sub-directories are named after the kernel release (version and build), e.g.:
(on an older system):

# ls -1 /lib/modules/
2.6.35-22-generic
2.6.38-11-generic
2.6.38-12-generic

You can use the output of 'uname -r' in scripts to get the proper directory to search in, according to the kernel release.

# uname -r
4.4.21-gentoo
# ls -1 /lib/modules/
4.4.21-gentoo
# tree -fia /lib/modules/`uname -r`/ | grep -i nvidia
/lib/modules/4.4.21-gentoo/kernel/drivers/net/ethernet/nvidia
/lib/modules/4.4.21-gentoo/kernel/drivers/net/ethernet/nvidia/forcedeth.ko
/lib/modules/4.4.21-gentoo/kernel/drivers/video/fbdev/nvidia
/lib/modules/4.4.21-gentoo/kernel/drivers/video/fbdev/nvidia/nvidiafb.ko

Utils

modprobe

check man page.

modinfo

# modinfo nvidiafb | grep description
description:    Framebuffer driver for nVidia graphics chipset