您的位置:首页 > 运维架构 > Linux

dmesg显示开机信息命令详解

2015-10-15 11:33 881 查看
dmesg 显示开机信息
kernel会将开机信息存储在ring buffer中,如果开机时来不及看,可以利用dmeg查看。
路径/var/log/dmesg

常用参数:
-c 显示信息后,清楚ring buffer中内容
-s<缓存区大小> 预设值是8196,刚好等于ring buffer大小
-n 设置记录信息的层级

实例:

1-将开机信息邮件发送
man dmesg 写道
The program helps users to print out their bootup messages. Instead of copying the messages by hand, the user need only:
dmesg > boot.messages
and mail the boot.messages file to whoever can debug their problem.

[root@new55 ~]# dmesg >boot.messages
[root@new55 ~]# ls -l boot.messages
-rw-r--r-- 1 root root 15838 12-09 12:55 boot.messages
[root@new55 ~]#mail -s "boot log of linux server mysql01-new" public@web3q.net

2-浏览dmesg输出信息
uname -a 查看系统版本信息
dmesg |less
less /var/log/dmesg
tail /var/log/dmesg

3-查看串口信息,网卡信息
grep ttyS* /var/log/dmesg
或者:dmes |grep ttyS*
dmesg |grep -n 'em1'

4-打印并清除内核信息缓存区

dmesg -c
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  linux dmesg 开机信息