Find Out Linux Kernel Modules ( Drivers ) Location / Directory

Q. Can you tell me exact location of Linux kernel driver under Linux file system? Where to find all available modules?

A. /lib/modules/kernel-version/ directory stores all compiled drivers under Linux operating system. You can use modprobe command to intelligently add or remove a module from the Linux kernel. modprobe looks in the
module directory /lib/modules/$(uname -r) for all the modules and other files, except for the optional /etc/modprobe.conf configuration file and /etc/modprobe.d directory. Type the following command to display current modules:
$ ls -l /lib/modules/$(uname -r)
Sample output:

total 1720
lrwxrwxrwx  1 root root     40 2007-10-17 10:00 build -> /usr/src/linux-headers-2.6.22-14-generic
drwxr-xr-x  2 root root   4096 2007-12-19 10:41 initrd
drwxr-xr-x 10 root root   4096 2007-10-17 09:58 kernel
-rw-r--r--  1 root root 363419 2008-01-26 18:10 modules.alias
-rw-r--r--  1 root root     69 2008-01-26 18:10 modules.ccwmap
-rw-r--r--  1 root root 395238 2008-01-26 18:10 modules.dep
-rw-r--r--  1 root root    813 2008-01-26 18:10 modules.ieee1394map
-rw-r--r--  1 root root    527 2008-01-26 18:10 modules.inputmap
-rw-r--r--  1 root root  17714 2008-01-26 18:10 modules.isapnpmap
-rw-r--r--  1 root root     74 2008-01-26 18:10 modules.ofmap
-rw-r--r--  1 root root 270824 2008-01-26 18:10 modules.pcimap
-rw-r--r--  1 root root   1345 2008-01-26 18:10 modules.seriomap
-rw-r--r--  1 root root 165591 2008-01-26 18:10 modules.symbols
-rw-r--r--  1 root root 479477 2008-01-26 18:10 modules.usbmap
drwxr-xr-x 10 root root   4096 2007-10-17 09:59 ubuntu

You can change directory by typing following command:
$ cd /lib/modules/$(uname -r)
$ pwd

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Tagged as: , , , , , , , , , , , , ,

Previous post: Bash For Loop Spaces

Next post: Debian / Ubuntu Linux Find Out What Package Provides a File