On Fri, Apr 6, 2012 at 10:02 AM, András Csányi <sayusi.a...@sayusi.hu> wrote:
> Dear All,
>
> I'm a little bit confused regarding modprobe command. As far as I
> remember I used the command below to list all of kernel modules
> independently it's loaded or not.
> modprobe -l or modprobe -L
>
> But now I can see that there is no -l or -L for this command. When
> have changed this command or my memories are failed? On the other
> hand, I would like to ask that how can I list all of kernel modules?
>
> Thanks in advance!
>
> András
>
> --
> --  Csanyi Andras (Sayusi Ando)  -- http://sayusi.hu --
> http://facebook.com/andras.csanyi
> --  ""Trust in God and keep your gunpowder dry!" - Cromwell

>From 'man modprobe' here (module-init-tools version 3.16):
    -l --list
    List all modules matching the given wildcard (or "*" if no
wildcard is given).  This option is provided for backwards
compatibility and  may go away in future: see find(1) and basename(1)
for a more flexible alternative.


And, found this handy little 'replacement' of sorts (in .bashrc or
such, not tested by me):

fkm() {
  local kver=$(uname -r) arg=${1//[-_]/[-_]}
  find "/lib/modules/$kver" -iname "*$arg*.ko*" \
    -exec bash -c 'mods=("${@##*/}"); printf "%s\n" "${mods[@]%.ko*}"' _ {} +

  if [[ ! -e /lib/modules/$kver/kernel ]]; then
    echo "reboot!" >&2
  fi
}

(source: https://bbs.archlinux.org/viewtopic.php?id=134393 )

-- 
Poison [BLX]
Joshua M. Murphy

Reply via email to