为什么这两个命令会返回不同的结果?
lsmod | wc -l 100 ls /sys/module | wc -l 138
解决方法
lsmod列出了所有加载的动态模块.
/ sys / module中的条目对应于内核中内置的动态模块和模块(并且具有需要可访问的参数),而不是动态加载.例如:
[michael@brazzers:~]$ls -d /sys/module/ip_tables/ /sys/module/ip_tables/ [michael@brazzers:~]$lsmod |grep ^ip_tables ip_tables 26995 3 iptable_filter,iptable_mangle,iptable_nat [michael@brazzers:~]$grep CONFIG_NF_NAT_IPV4 /boot/config-3.8.0-30-generic CONFIG_NF_NAT_IPV4=m
您可以在此处看到iptables模块配置为动态模块.相比较:
[michael@brazzers:~]$ls -d /sys/module/apparmor/ /sys/module/apparmor/ [michael@brazzers:~]$lsmod |grep ^apparmor [michael@brazzers:~]$grep APPARMOR /boot/config-3.8.0-30-generic CONFIG_SECURITY_APPARMOR=y
而apparmor是内置的.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。