DMESG
NAME
dmesg - print or control the kernel ring buffer(打印或者控制内核环缓冲)
Usage:
dmesg [options]
Options:
-C, --clear clear the kernel ring buffer
-c, --read-clear read and clear all messages
-D, --console-off disable printing messages to console
-d, --show-delta show time delta between printed messages
-E, --console-on enable printing messages to console
-f, --facility <list> restrict output to defined facilities
-h, --help display this help and exit
-k, --kernel display kernel messages
-l, --level <list> restrict output to defined levels
-n, --console-level <level> set level of messages printed to console
-r, --raw print the raw message buffer
-s, --buffer-size <size> buffer size to query the kernel ring buffer
-T, --ctime show human readable timestamp (could be 
inaccurate if you have used SUSPEND/RESUME)
-t, --notime don't print messages timestamp
-u, --userspace display userspace messages
-V, --version output version information and exit
-x, --decode decode facility and level to readable string
Supported log facilities:
kern - kernel messages
user - random user-level messages
mail - mail system
daemon - system daemons
auth - security/authorization messages
syslog - messages generated internally by syslogd
lpr - line printer subsystem
news - network news subsystem
Supported log levels (priorities):
emerg - system is unusable
alert - action must be taken immediately
crit - critical conditions
err - error conditions
warn - warning conditions
notice - normal but significant condition
info - informational
debug - debug-level messages
 
--------------------------------------------------------------------------------------------------------
SYNOPSIS(简介)
dmesg [options]
dmesg --clear(清除完就什么也没有了,还没来得及测试)
dmesg --read-clear [options]
dmesg --console-level level
dmesg --console-on
dmesg --console-off
DESCRIPTION
dmesg is used to examine or control the kernel ring buffer.
The default action is to read all messages from kernel ring buffer.
 
OPTIONS
The --clear, --read-clear, --console-on, --console-off and --console-level options are mutually exclusive.
 
-C, --clear
Clear the ring buffer.
-c, --read-clear
Clear the ring buffer contents after printing.
-D, --console-off
Disable printing messages to the console.
-d, --show-delta
Display the timestamp and time delta spent between messages. If used together with --notime then only the time delta without
the timestamp is printed.
-E, --console-on
Enable printing messages to the console.
-f, --facility list
Restrict output to defined (comma separated) list of facilities. For example
dmesg --facility=daemon
will print messages from system daemons only. For all supported facilities see dmesg --help output.
-h, --help
Print a help text and exit.
-k, --kernel
Print kernel messages.
-l, --level list
Restrict output to defined (comma separated) list of levels. For example
dmesg --level=err,warn
will print error and warning messages only. For all supported levels see dmesg --help output.
-n, --console-level level
Set the level at which logging of messages is done to the console. The level is a level number or abbreviation of the level
name. For all supported levels see dmesg --help output.
For example, -n 1 or -n alert prevents all messages, except emergency (panic) messages, from appearing on the console. All
levels of messages are still written to /proc/kmsg, so syslogd(8) can still be used to control exactly where kernel messages
appear. When the -n option is used, dmesg will not print or clear the kernel ring buffer.
-r, --raw
Print the raw message buffer, i.e., don't strip the log level prefixes.
-s, --buffer-size size
Use a buffer of size to query the kernel ring buffer. This is 16392 by default. (The default kernel syslog buffer size was
4096 at first, 8192 since 1.3.54, 16384 since 2.1.113.) If you have set the kernel buffer to be larger than the default
then this option can be used to view the entire buffer.
-T, --ctime
Print human readable timestamps. The timestamp could be inaccurate!
The time source used for the logs is not updated after system SUSPEND/RESUME.
-t, --notime
Don't print kernel's timestampts.
-u, --userspace
Print userspace messages.
-V, --version
Output version information and exit.
-x, --decode
Decode facility and level (priority) number to human readable prefixes.
SEE ALSO
syslogd(8)
AUTHORS
Karel Zak <kzak@redhat.com>
Theodore Ts'o <tytso@athena.mit.edu>
AVAILABILITY
The dmesg command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
 
util-linux July 2011 DMESG(1)
 
---------------------------------------------
实例1:
root#dmesg
实例2:
root#dmesg -d
 
实例3: 将开机信息发邮件
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 ~]#
 
实例4:  浏览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:
 BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001f7d0000 (usable)
 BIOS-e820: 000000001f7d0000 - 000000001f7efc00 (reserved)
 BIOS-e820: 000000001f7efc00 - 000000001f7fb000 (ACPI NVS)
 BIOS-e820: 000000001f7fb000 - 000000001f800000 (reserved)
 BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec02000 (reserved)
 BIOS-e820: 00000000fed20000 - 00000000fed9b000 (reserved)
 BIOS-e820: 00000000feda0000 - 00000000fedc0000 (reserved)
 BIOS-e820: 00000000ffb00000 - 00000000ffc00000 (reserved)
 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
503MB LOWMEM available.
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
disabling kdump
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 128976
  DMA zone: 4096 pages, LIFO batch:0
  Normal zone: 124880 pages, LIFO batch:31
DMI 2.3 present.
Using APIC driver default
ACPI: RSDP (v000 HP                                    ) @ 0x000fe270
ACPI: RSDT (v001 HP     30C4     0x31100620 HP   0x00000001) @ 0x1f7efc84
ACPI: FADT (v002 HP     30C4     0x00000002 HP   0x00000001) @ 0x1f7efc00
ACPI: MADT (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efcb8
ACPI: MCFG (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efd14
ACPI: SSDT (v001 HP       HPQPpc 0x00001001 MSFT 0x0100000e) @ 0x1f7f6698
ACPI: DSDT (v001 HP       DAU00  0x00010000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x1008
ACPI: Local APIC address 0xfec01000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
Processor #0 6:13 APIC version 20
ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23
 
实例5: 查看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 ~]#
 
实例6: 安装SS7卡驱动时的内核日志
[root@localhost ss7dpklnx]# cd SS7HD_DRIVER/
[root@localhost SS7HD_DRIVER]# ls
bbdddlnx_iss.h  bbd_hbi.h  bbd_ioc.c  bbd_isr.c  bbd_pci.c  BSD_license.txt  GPL_V2-only_license.txt  install_ss7hd.sh  Makefile26
bbd_def.h       bbd_hs.c   bbd_ioc.h  bbd_lnx.c  bbd_pro.h  build_ss7hd.sh   i21555.h                 Makefile24
[root@localhost SS7HD_DRIVER]# ./build_ss7hd.sh 
make: Entering directory `/usr/src/kernels/2.6.9-22.EL-i686'
  CC [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_hs.o
  CC [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_ioc.o
  CC [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_isr.o
  CC [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_pci.o
  CC [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/bbd_lnx.o
  LD [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/ss7hddvr26.o
  Building modules, stage 2.
  MODPOST
  CC      /root/setup/ss7dpklnx/SS7HD_DRIVER/ss7hddvr26.mod.o
  LD [M]  /root/setup/ss7dpklnx/SS7HD_DRIVER/ss7hddvr26.ko
make: Leaving directory `/usr/src/kernels/2.6.9-22.EL-i686'http://www.linuxso.com/command/dmesg.html
[root@localhost SS7HD_DRIVER]# ./install_ss7hd.sh 
[root@localhost SS7HD_DRIVER]# lsmod | grep ss7
ss7hddvr26             25808  0
[root@localhost SS7HD_DRIVER]# dmesg | tail
ACPI: PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9
BBD[0] 64bit
SS7HD[0] - suspend
 
Dialogic SS7HD Device Driver V100.00 (Source V1.21)
Copyright (C) Dialogic Corporation 2003-2010.  All Rights Reserved
Using major device number 251.
ACPI: PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9
BBD[0] 64bit
[root@localhost SS7HD_DRIVER]# ./install_ss7hd.sh remove
[root@localhost SS7HD_DRIVER]# lsmod | grep ss7
[root@localhost SS7HD_DRIVER]# dmesg | tail
BBD[0] 64bit
SS7HD[0] - suspend
 
Dialogic SS7HD Device Driver V100.00 (Source V1.21)
Copyright (C) Dialogic Corporation 2003-2010.  All Rights Reserved
Using major device number 251.
ACPI: PCI interrupt 0000:02:0d.0[?] -> GSI 9 (level, low) -> IRQ 9
BBD[0] 64bit
SS7HD[0] - suspend
[root@localhost SS7HD_DRIVER]#
 
 
实例7: 打印并清除内核环形缓冲区
[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
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001f7d0000 (usable)
 BIOS-e820: 000000001f7d0000 - 000000001f7efc00 (reserved)
 BIOS-e820: 000000001f7efc00 - 000000001f7fb000 (ACPI NVS)
 BIOS-e820: 000000001f7fb000 - 000000001f800000 (reserved)
 BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec02000 (reserved)
 BIOS-e820: 00000000fed20000 - 00000000fed9b000 (reserved)
 BIOS-e820: 00000000feda0000 - 00000000fedc0000 (reserved)
 BIOS-e820: 00000000ffb00000 - 00000000ffc00000 (reserved)
 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
503MB LOWMEM available.
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
disabling kdump
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 128976
  DMA zone: 4096 pages, LIFO batch:0
  Normal zone: 124880 pages, LIFO batch:31
DMI 2.3 present.
省略输出
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 ~]# dmesg
[root@new55 ~]# less /var/log/dmesg
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:
 BIOS-e820: 0000000000010000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 000000001f7d0000 (usable)
 BIOS-e820: 000000001f7d0000 - 000000001f7efc00 (reserved)
 BIOS-e820: 000000001f7efc00 - 000000001f7fb000 (ACPI NVS)
 BIOS-e820: 000000001f7fb000 - 000000001f800000 (reserved)
 BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
 BIOS-e820: 00000000fec00000 - 00000000fec02000 (reserved)
 BIOS-e820: 00000000fed20000 - 00000000fed9b000 (reserved)
 BIOS-e820: 00000000feda0000 - 00000000fedc0000 (reserved)
 BIOS-e820: 00000000ffb00000 - 00000000ffc00000 (reserved)
 BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
503MB LOWMEM available.
Memory for crash kernel (0x0 to 0x0) notwithin permissible range
disabling kdump
Using x86 segment limits to approximate NX protection
On node 0 totalpages: 128976
  DMA zone: 4096 pages, LIFO batch:0
  Normal zone: 124880 pages, LIFO batch:31
DMI 2.3 present.
Using APIC driver default
ACPI: RSDP (v000 HP                                    ) @ 0x000fe270
ACPI: RSDT (v001 HP     30C4     0x31100620 HP   0x00000001) @ 0x1f7efc84
ACPI: FADT (v002 HP     30C4     0x00000002 HP   0x00000001) @ 0x1f7efc00
ACPI: MADT (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efcb8
ACPI: MCFG (v001 HP     30C4     0x00000001 HP   0x00000001) @ 0x1f7efd14
ACPI: SSDT (v001 HP       HPQPpc 0x00001001 MSFT 0x0100000e) @ 0x1f7f6698
ACPI: DSDT (v001 HP       DAU00  0x00010000 MSFT 0x0100000e) @ 0x00000000
ACPI: PM-Timer IO Port: 0x1008
ACPI: Local APIC address 0xfec01000
ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled)
Processor #0 6:13 APIC version 20
ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1])
ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0])
IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23
 

linux命令学习-2-dmesg的更多相关文章

  1. 《Linux命令学习手册》系列分享专栏

    <Linux命令学习手册>系列分享专栏 <Linux命令学习手册>已整理成PDF文档,点击可直接下载至本地查阅https://www.webfalse.com/read/207 ...

  2. 别出心裁的Linux命令学习法

    别出心裁的Linux命令学习法 操作系统操作系统为你完成所有"硬件相关.应用无关"的工作,以给你方便.效率.安全.操作系统的功能我总结为两点:管家婆和服务生: 管家婆:通过进程.虚 ...

  3. Linux命令学习

    Linux命令学习 Ubuntu常用快捷键 •Ctrl+Alt+T: 打开终端 •Ctrl+Shift+T: 新建标签页 •Tab: 终端中命令补全 •Alt+数字N: 终端中切换到第N个标签页 •↑ ...

  4. Linux命令学习总结之rmdir命令的相关资料可以参考下

    这篇文章主要介绍了Linux命令学习总结之rmdir命令的相关资料,需要的朋友可以参考下(http://www.nanke0834.com) 命令简介: rmdir命令用用来删除空目录,如果目录非空, ...

  5. linux命令学习之:chmod

    chmod命令用来变更文件或目录的权限.在Linux系统家族里,文件或目录权限的控制分别以读取R.写入W.执行X3种一般权限来区分,另有3种特殊权限可供运用.用户可以使用chmod指令去变更文件与目录 ...

  6. Linux命令学习笔记1

    1.Linux命令学习 2.Mkdir /data       -创建文件夹 在/下创建文件夹 data 3.Cd               -目录切换 列如cd / 4.Touch /data/1 ...

  7. 20155229付钰涵-虚拟机安装及LINUX命令学习

    安装Ubuntu遇到的问题 问题一: 新建虚拟电脑的版本只有32-bit,与老师所给教程中的64-bit不符.为此我上百度搜寻了答案. 第一种方法: 控制面板--程序与功能--启动或关闭windows ...

  8. 安装虚拟机&Linux命令学习

    安装虚拟机&Linux命令学习 基于VirtualBox虚拟机安装Ubuntu 1.下载安装VirtualBox 根据自己电脑(32位操作系统)的实际情况,我在网上找了相应的VirtualBo ...

  9. Linux命令学习笔记目录

    Linux命令学习笔记目录 最近正在使用,linux,顺便将用到的命令整理了一下. 一. 文件目录操作命令: 0.linux命令学习笔记(0):man 命令 1.linux命令学习笔记(1):ls命令 ...

  10. (转)Linux命令学习总结:dos2unix - unix2dos

    Linux命令学习总结:dos2unix - unix2dos 命令简介: 原文:http://www.cnblogs.com/kerrycode/p/5077969.html dos2unix是将W ...

随机推荐

  1. eclipse的调试方法的简单介绍

    声明:本文不是自己 作为编程人员,程序的调试是一项基本功.在不使用IDE的时候,程序的调试多数是通过日志或者输入语句(System.out.println)的方式.可以把程序运行的轨迹或者程序运行过程 ...

  2. combo扩展:禁止手工改变输入框的值

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  3. 初识Selenium(二)

    ---------------------------------------------------------------------------------------------------- ...

  4. 在windows系统用odbc连接

    当连接的数据出现失败时,出现数据库别名仍然存在,但还是要用这个别名重新建立连接 在windows客户端,用输入db2cmd输入c:\Users\yexuxia>db2 list db direc ...

  5. 转载 Deep learning:六(regularized logistic回归练习)

    前言: 在上一讲Deep learning:五(regularized线性回归练习)中已经介绍了regularization项在线性回归问题中的应用,这节主要是练习regularization项在lo ...

  6. AutoTile 自动拼接(一) 学习与实践

    恩,大家好,这两天江苏冷空气袭击,下了今年 第一场第二场雪. 不过今天我要说的 ,和 上面的 屁关系都没有. 今天要说的是 2d无缝自动拼接.大家有没有玩过  RPG Maker VX Ace. 类似 ...

  7. acm课程练习2--1003

    题目描述 My birthday is coming up and traditionally I'm serving pie. Not just one pie, no, I have a numb ...

  8. java工程开发之图形化界面之(第五课)

    下面我们将: 一)更加完整的解释Graphics类 二)使用方法来更清晰的重新编写前面图形小应用程序之一 三)介绍一些其他的绘图的方法 四)介绍方法init,它是类似于paint但是用于不同用途的另一 ...

  9. jquery选择器 之 获取父级元素、同级元素、子元素(转)

    一.获取父级元素 1. parent([expr]): 获取指定元素的所有父级元素 <div id="par_div"><a id="href_fir& ...

  10. Linux 部署 Tomcat和JDK

    一:安装jdk下载将jdk加压后放到/usr/local目录下: [root@master ~]#chmod 755 jdk-6u5-linux-x64.bin [root@master ~]# ./ ...