linux之dmesg命令

来源:互联网 发布:python 执行shell命令 编辑:程序博客网 时间:2024/06/14 16:57

显示内核消息


dmesg [options]


 


dmesg 可以用来显示存储在内核环缓冲区中的消息


系统启动时,内核会用硬件和模块初始化的相关消息填充其环缓冲区。内核环缓冲区中的消息常常用于诊断系统问题


 
选项
-c             运行dmesg后情况内核环缓冲区


 


示例
dmesg >
复制代码
[root@localhost ~]# dmesg > message
[root@localhost ~]# head -4 message 
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
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
KERNEL supported cpus:
复制代码
将系统启动的情况重定向到某一文件


 
dmesg | grep
[root@localhost ~]# dmesg | grep eth0
e1000 0000:00:03.0: eth0: (PCI:33MHz:32-bit) 08:00:27:14:99:a3
e1000 0000:00:03.0: eth0: Intel(R) PRO/1000 Network Connection
e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX
8021q: adding VLAN 0 to HW filter on device eth0
eth0: no IPv6 routers present
过滤dmesg中的信息

0 0
原创粉丝点击