前言:

    有时候想查看一下开机启动信息,可以通过这个命令查询。



1,命令格式

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



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



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





   参  数:

 

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

 

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





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



2,使用示例



示例一 将开机信息发邮件

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" 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

BIOS-provided physical RAM map: ...



示例三 查看dmesg尾部的信息

[root@new55 ~]# dmesg | tail 

Bluetooth: L2CAP ver 2.8

Bluetooth: L2CAP socket layer initialized

Bluetooth: RFCOMM socket layer initialized

Bluetooth: RFCOMM TTY layer initialized

Bluetooth: RFCOMM ver 1.8

Bluetooth: HIDP (Human Interface Emulation) ver 1.1

eth0: no IPv6 routers present

Installing knfsd (copyright (C) 1996 okir@monad.swb.de).

NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory

NFSD: starting 90-second grace period

[root@new55 ~]#

 

示例四 查看串口的相关信息

[root@new55 ~]# dmesg | grep ttyS*

[    1.360552] s5pv210-uart.0: ttySAC0 at MMIO 0xe2900000 (irq = 16) is a S3C6400/10

[    1.373853] s5pv210-uart.1: ttySAC1 at MMIO 0xe2900400 (irq = 20) is a S3C6400/10

[    1.388846] s5pv210-uart.2: ttySAC2 at MMIO 0xe2900800 (irq = 24) is a S3C6400/10

[    1.403845] s5pv210-uart.3: ttySAC3 at MMIO 0xe2900c00 (irq = 28) is a S3C6400/10





示例五 打印并清除内核环形缓冲区

[root@new55 ~]# dmesg -c 

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 ...









3,参考文件

a,http://www.shangxueba.com/jingyan/381649.html

b,http://codingstandards.iteye.com/blog/837486

linux下dmesg命令详解的更多相关文章

  1. Linux下ps命令详解 Linux下ps命令的详细使用方法

    http://www.jb51.net/LINUXjishu/56578.html Linux下的ps命令比较常用 Linux下ps命令详解Linux上进程有5种状态:1. 运行(正在运行或在运行队列 ...

  2. Linux下rar命令详解

    Linux下rar命令详解 用法: rar <命令> -<选项1> ….-<选项N> < 操作文档> <文件…> <@文件列表…> ...

  3. linux下tar命令详解

     linux下tar命令详解    tar是Linux环境下最常用的备份工具之一.tar(tap archive)原意为操作磁带文件,但基于Linux的文件操作机制,同样也可适用于普通的磁盘文件.ta ...

  4. Linux下chkconfig命令详解(转)

    Linux下chkconfig命令详解 chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息.谨记chkconfig不是立即自动禁止或激活一个服务,它只是简单的改变了符号连接. ...

  5. Linux知识积累(4) Linux下chkconfig命令详解

    Linux下chkconfig命令详解 chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息.谨记chkconfig不是立即自动禁止或激活一个服务,它只是简单的改变了符号连接. ...

  6. Linux下top命令详解

    Linux下top命令详解 top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器.top是一个动态显示过程,即可以通过用户按键来不断刷 ...

  7. 转载的 Linux下chkconfig命令详解

    Linux下chkconfig命令详解 chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息.谨记chkconfig不是立即自动禁止或激活一个服务,它只是简单的改变了符号连接. ...

  8. 转 linux下cat命令详解

    linux下cat命令详解 http://www.cnblogs.com/perfy/archive/2012/07/23/2605550.html 简略版: cat主要有三大功能:1.一次显示整个文 ...

  9. (转)Linux 系统设置 : dmesg 命令详解

    原文:https://blog.csdn.net/yexiangCSDN/article/details/80683246 https://www.cnblogs.com/duanxz/p/34770 ...

随机推荐

  1. HTML5 地理定位 【来自百度应用分享平台】

    百度给的地图API接口相当完善,复制过来一下,以后备用 基本使用方法: <!--引入百度地图API--> <scriptsrc="http://api.map.baidu. ...

  2. 为啥YII2 会出现 mcrypt_generic_init(): Key size is 0

    解决方案如下: (关键) 示例代码中,加密解密类的实例创见通过 Class 同名方法 的方式创建. public function WXBizMsgCrypt($token, $encodingAes ...

  3. Visual对象——WPF

    System.Object        System.Windows.Threading.DispatcherObject                System.Windows.Depende ...

  4. Ubuntu 配置静态ip的方法

    1. 配置静态ip地址 $sudo vi /etc/network/interfaces 原有内容只有如下两行: auto lo iface lo inet loopback 向末尾追加以下内容: a ...

  5. webpack相关文章

    0.https://doc.webpack-china.org/concepts/ (webpack中文文档) 1.https://segmentfault.com/a/119000000617877 ...

  6. layui中实现上传图片压缩

    一.关于js上传图片压缩的方法,百度有很多种方法,这里我参考修改了一下: function photoCompress(file, w, objDiv) { var ready = new FileR ...

  7. 剑指offer--33.丑数

    本来用数组做标志位,但是测试数据有第1500个,859963392,惹不起哦 ------------------------------------------------------------- ...

  8. Visual Studio 2008常见问题

    1.asp.net在什么软件上运行?学习asp往往需要测试asp程序,电脑不能直接测试,需要装IIS才能运行,但装IIS要么需要安装盘,要么需要安装包,而且设置也很复搜索杂.这里给大学推荐两个替代II ...

  9. [JS学习笔记]浅谈Javascript事件模型

    DOM0级事件模型 element.on[type] = function(){} 兼容性:全部支持   lay1 lay2 lay3 e.target:直接触发事件的元素[IE8及以下不支持tage ...

  10. Oracle新用户以及授权的若干问题

    Database 实验4 问题: 授权语句 grant create table to user_name; 收回授权语句 revoke create table from user_name; 注意 ...