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

linux dmesg命令参数及用法详解(linux显示开机信息命令)

2016-03-28 09:43 1836 查看

http://blog.csdn.net/article/9131976.html

功能说明:显示开机信息。

语  法:dmesg [-cn][-s <缓冲区大小>]

补充说明:kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利用dmesg来查看。开机信息亦保存在/var/log目录中,名称为dmesg的文件里。

参  数:

 -c  显示信息后,清除ring buffer中的内容。

 -s<缓冲区大小>  预设置为8196,刚好等于ring buffer的大小。

 -n  设置记录信息的层级。

使用示例

示例一 将开机信息发邮件

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 begin_of_the_skype_highlighting

15838
12-09 12 免费 end_of_the_skype_highlighting:55 boot.messages

[root@new55 ~]# mail -s "Boot Log of Linux Server" public@web3q.net <boot.messages

[root@new55 ~]#

示例二 浏览dmesg输出的信息

[root@new55 ~]# uname -a

Linux new55 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:43 EDT 2010 i686 i686 i386 GNU/Linux

[root@new55 ~]# dmesg | less

Linux version 2.6.18-194.el5 (mockbuild@x86-007.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:43 EDT 2010
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: