Commands using lsmod (7)

  • parse `lsmod' output and pass to `dot' drawing utility then finally pass it to an image viewer


    35
    lsmod | perl -e 'print "digraph \"lsmod\" {";<>;while(<>){@_=split/\s+/; print "\"$_[0]\" -> \"$_\"\n" for split/,/,$_[3]}print "}"' | dot -Tpng | display -
    bandie91 · 2011-11-27 14:02:35 22
  • parse "lsmod" output to "dot" format and pass it to "display". Without perl!


    15
    lsmod | awk 'BEGIN{print "digraph{"}{split($4, a, ","); for (i in a) print $1, "->", a[i]}END{print "}"}'|display
    point_to_null · 2011-12-04 01:41:23 7
  • Run this as root, it will be helpful to quickly get information about the loaded kernel modules. Show Sample Output


    2
    lsmod | cut -d' ' -f1 | xargs modinfo | egrep '^file|^desc|^dep' | sed -e'/^dep/s/$/\n/g'
    mohan43u · 2009-11-17 02:13:34 3
  • Liked command 4077 so I improved it, by doing all text manipulation with sed. "Run this as root, it will be helpful to quickly get information about the loaded kernel modules." THX mohan43u Show Sample Output


    1
    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
    marssi · 2009-11-17 22:51:08 4
  • Returns the version of the kernel module specified as "MODULENAME", when available. Show Sample Output


    1
    lsmod | grep -io MODULENAME| xargs modinfo | grep -iw version
    adriano · 2013-03-18 07:52:14 14

  • 0
    lsmod | tail -n +2 | cut -d' ' -f1 | xargs modinfo | egrep '^file|^desc|^dep' | sed -e'/^dep/s/$/\n/g'
    vlaad · 2012-09-03 17:59:49 4
  • Info about Bluetooth devices. Show Sample Output


    0
    hciconfig;hciconfig -a hci0;lsmod |grep bt;dmesg | grep tooth
    FadeMind · 2013-08-21 12:29:23 11

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Compare two directory trees.
This uses Bash's "process substitution" feature to compare (using diff) the output of two different process pipelines.

Rename .JPG to .jpg recursively
This command is useful for renaming a clipart, pic gallery or your photo collection. It will only change the big caps to small ones (on the extension).

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

See OpenVZ Container id's of top 10 running processes by %cpu
This command will list the PID, VEID, and Name of the 10 highest cpu using processes on a openvz host. You must have vzpid installed.

command to change the exif date time of a image

increase recursively the modification time for a list of files
Increase the modification date for the files selected with the find command.

Check the current price of Bitcoin in USD

Indent a one-liner.
Bash builtin type also indents the function.

Adding Prefix to File name


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: