1.3. 列出当前加载的模块
您可以通过运行 lsmod 命令列出当前载入内核中的所有内核模块,例如:
# lsmod
Module Size Used by
tcp_lp 12663 0
bnep 19704 2
bluetooth 372662 7 bnep
rfkill 26536 3 bluetooth
fuse 87661 3
ebtable_broute 12731 0
bridge 110196 1 ebtable_broute
stp 12976 1 bridge
llc 14552 2 stp,bridge
ebtable_filter 12827 0
ebtables 30913 3 ebtable_broute,ebtable_nat,ebtable_filter
ip6table_nat 13015 1
nf_nat_ipv6 13279 1 ip6table_nat
iptable_nat 13011 1
nf_conntrack_ipv4 14862 4
nf_defrag_ipv4 12729 1 nf_conntrack_ipv4
nf_nat_ipv4 13263 1 iptable_nat
nf_nat 21798 4 nf_nat_ipv4,nf_nat_ipv6,ip6table_nat,iptable_nat
[output truncated]
lsmod 输出指定了三列:
模块
- 当前加载在内存中的内核模块的名称。
Size
- 内核模块使用的内存量,以 KB 为单位。
使用的
- 个十进制数字,表示在 Module 字段中存在多少个依赖项。
- 由依赖模块名称组成的逗号分隔字符串。使用这个列表,您可以首先根据您要卸载的模块卸载所有模块。
最后,请注意 lsmod 输出比较详细,且比 /proc/modules pseudo- file 的内容更容易阅读。