显示内核消息
dmesg [options]
dmesg 可以用来显示存储在内核环缓冲区中的消息
系统启动时,内核会用硬件和模块初始化的相关消息填充其环缓冲区。内核环缓冲区中的消息常常用于诊断系统问题
选项
-c 运行dmesg后情况内核环缓冲区
示例
dmesg >
1 [root@localhost ~]# dmesg > message 2 [root@localhost ~]# head -4 message 3 Initializing cgroup subsys cpuset 4 Initializing cgroup subsys cpu 5 Linux version 2.6.32-279.el6.i686 (mockbuild@c6b9.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Jun 22 10:59:55 UTC 2012 6 KERNEL supported cpus:
将系统启动的情况重定向到某一文件
dmesg | grep
1 [root@localhost ~]# dmesg | grep eth0 2 e1000 0000:00:03.0: eth0: (PCI:33MHz:32-bit) 08:00:27:14:99:a3 3 e1000 0000:00:03.0: eth0: Intel(R) PRO/1000 Network Connection 4 e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX 5 8021q: adding VLAN 0 to HW filter on device eth0 6 eth0: no IPv6 routers present
过滤dmesg中的信息