mail
Short Information about loaded kernel modules
Hot:sun Short Information about loaded kernel modulessun dark Short Information about loaded kernel modulessun dark Short Information about loaded kernel modulessun dark Short Information about loaded kernel modulessun dark Short Information about loaded kernel modules

There are couple of ways you can find the information on the loadable kernel modules. All these would always involve calling lsmod to get the loaded kernel modules and then calling modinfo to get the info on the loaded modules. I will show you with examples:

$ lsmod
Module                  Size  Used by
cdc_acm                19616  0
vfat                    8744  9
fat                    41836  1 vfat

The above output is for the list of the modules loaded on the kernel.

$ modinfo vfat

filename:       /lib/modules/2.6.31.5-127.fc12.i686.PAE/kernel/fs/fat/vfat.ko
author:         Gordon Chaffee
description:    VFAT filesystem support
license:        GPL
srcversion:     48F6DF1D674F0E1325466C9
depends:        fat
vermagic:       2.6.31.5-127.fc12.i686.PAE SMP mod_unload 686

modinfo will list the filename, authour and other related info for the modules. So if you wanted to get the info for all the modules, then the easiest way would be to do :

lsmod|xargs modinfo

But as you can see, this will list all the info on  the module, which is not really required. So there were couple of posts on commandlinefu, that takes care of displaying only the required information, viz. filename, authour and dependency. Here are the commands:

lsmod | sed ’1d’ | cut -d’ ‘ -f1 | xargs modinfo | egrep ‘^file|^desc|^dep’ | sed -e’/^dep/s/$/n/g’

Quite raw method where we grep the required fields and susbstitute the end with newline for the last patter :)

lsmod | sed -e ’1d’ -e ‘s/(([^ ]*) ){1}.*/2/’ | xargs modinfo | sed -e ‘/^dep/s/$/n/g’ -e ‘/^file/b’ -e ‘/^desc/b’ -e ‘/^dep/b’ -e d

Quite same as above with only exception of using one sed command rather than egrep and sed.

modinfo $(cut -d’ ‘ -f1 /proc/modules) | sed ‘/^dep/s/$/n/; /^file|^desc|^dep/!d’

Directly using the modinfo commands without xargs and passing the arguments with cut command and then using sed to display only the required fields.

awk ‘{print $1}’ “/proc/modules” | xargs modinfo | awk ‘/^(filename|desc|depends)/’

using awk to check the /proc/modules and then displaying the fields with awk

 Short Information about loaded kernel modulesamit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e31.png" alt="Reblog this post [with Zemanta]" />
suggest
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • blogmarks
  • Blogosphere News
  • co.mments
  • HelloTxt
  • Ping.fm
  • Reddit
  • RSS
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • BlinkList
  • Diigo
  • email
  • Identi.ca
  • LinkedIn
  • Live
  • MyShare
  • MySpace
  • PDF
  • SheToldMe
  • Slashdot
  • Socialogs
  • Tumblr

related post

CBA0E3ABEB1A7038A3FD2A47BA03BC1B Short Information about loaded kernel modules

Technorati Tags: File system, kernel, Linux, Linux kernel, Loadable kernel module, Operating Systems, programming, rss

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Trackback/Ping

  1. Tweets that mention Short Information about loaded kernel modules - Amit Agarwal -- Topsy.com Nov 23 2009 at 7am:

    [...] This post was mentioned on Twitter by Amit Agarwal, Amit Agarwal. Amit Agarwal said: I just post Short Information about loaded kernel modules on http://ping.fm/RDlQb [...]

Leave a reply research
partner

Back to top

store