1. lsmod简介
lsmod命令用于显示已经加载到内核中的模块的状态信息。Linux是一个模块化的系统,可以添加自定义的模块到内核中,比如新设置的驱动程序。lsmod可以显示已加载模块的信息,包括名称、大小、依赖模块的内容。
2. lsmod默认输出
[root@zcwyou ~]# lsmod
Module Size Used by
binfmt_misc 20480 1
ip6t_rpfilter 16384 1
ipt_REJECT 16384 2
nf_reject_ipv4 16384 1 ipt_REJECT
ip6t_REJECT 16384 2
nf_reject_ipv6 16384 1 ip6t_REJECT
xt_conntrack 16384 13
ip_set 40960 0
nfnetlink 16384 1 ip_set
ebtable_nat 16384 1
ebtable_broute 16384 1
ip6table_nat 16384 1
nf_conntrack_ipv6 20480 8
nf_defrag_ipv6 20480 1 nf_conntrack_ipv6
nf_nat_ipv6 16384 1 ip6table_nat
ip6table_mangle 16384 1
ip6table_security 16384 1
ip6table_raw 16384 1
iptable_nat 16384 1
nf_conntrack_ipv4 16384 7
nf_defrag_ipv4 16384 1 nf_conntrack_ipv4
nf_nat_ipv4 16384 1 iptable_nat
nf_nat 32768 2 nf_nat_ipv6,nf_nat_ipv4
nf_conntrack 135168 6 xt_conntrack,nf_conntrack_ipv6,nf_conntrack_ipv4,nf_nat,nf_nat_ipv6,nf_nat_ipv4
iptable_mangle 16384 1
iptable_security 16384 1
iptable_raw 16384 1
ebtable_filter 16384 1
ebtables 32768 3 ebtable_nat,ebtable_filter,ebtable_broute
ip6table_filter 16384 1
ip6_tables 28672 6 ip6table_filter,ip6table_raw,ip6table_nat,ip6table_mangle,ip6table_security
iptable_filter 16384 1
sb_edac 32768 0
coretemp 16384 0
crct10dif_pclmul 16384 0
crc32_pclmul 16384 0
ghash_clmulni_intel 16384 0
pcbc 16384 0
aesni_intel 200704 0
crypto_simd 16384 1 aesni_intel
cryptd 24576 3 crypto_simd,ghash_clmulni_intel,aesni_intel
glue_helper 16384 1 aesni_intel
intel_rapl_perf 16384 0
vmw_balloon 20480 0
pcspkr 16384 0
joydev 20480 0
sg 40960 0
input_leds 16384 0
i2c_piix4 24576 0
vmw_vmci 69632 1 vmw_balloon
tcp_bbr 20480 158
sch_fq 20480 3
ip_tables 24576 5 iptable_filter,iptable_security,iptable_raw,iptable_nat,iptable_mangle
xfs 1269760 2
libcrc32c 16384 3 nf_conntrack,nf_nat,xfs
sd_mod 53248 4
sr_mod 24576 0
cdrom 61440 1 sr_mod
vmwgfx 274432 1
drm_kms_helper 167936 1 vmwgfx
syscopyarea 16384 1 drm_kms_helper
sysfillrect 16384 1 drm_kms_helper
sysimgblt 16384 1 drm_kms_helper
fb_sys_fops 16384 1 drm_kms_helper
ttm 110592 1 vmwgfx
drm 458752 4 vmwgfx,drm_kms_helper,ttm
ata_generic 16384 0
vmxnet3 57344 0
pata_acpi 16384 0
crc32c_intel 24576 1
serio_raw 16384 0
mptspi 24576 3
mptscsih 40960 1 mptspi
mptbase 102400 2 mptspi,mptscsih
scsi_transport_spi 32768 1 mptspi
ata_piix 36864 0
libata 245760 3 ata_piix,pata_acpi,ata_generic
输出结果解释:
第1列:表示模块的名称。
第2列:表示模块的大小。
第3列:表示依赖模块的个数。
第4列:表示依赖模块的内容。
根据条件查询模块:
查询当前系统是否加载了iptable模块,结果grep过滤结果
[root@zcwyou ~]# lsmod | grep -i iptable
评论前必须登录!
注册