dmesg command is used to display the kernel related messages | dmesg -T | dmesg --level=err,warn

dmesg command is used to display the kernel related messages on Unix like systems. dmesg stands for “display message or display driver

Display colored messages (dmesg command output)

Use  ‘-L’ option in dmesg command if you want to print the colored messages,

~]# dmesg -L

Restrict dmesg command output to specific list of levels

Following are specific log levels supported by dmesg command,
  • emerg
  • alert
  • crit
  • err
  • warn
  • notice
  • info
  • debug
Let’s assume we want to display logs related to error and warning,  then use “–level” option followed by levels like err & warn, example is shown below

~]# dmesg --level=err,warn

Enable timestamps in dmesg logs

There can be some scenarios where we want to enable timestamps in dmesg, this can be easily achieved by using ‘-T’ option in  dmesg command.

~]# dmesg -T
……………………………………………
Wed May  9 12:20:36 2018] rx_data returned 0, expecting 48.

Monitor real time dmesg logs using ‘–follow’ option

Use ‘–follow’ option in dmesg command to view real time dmesg logs, example is shown below,

~]# dmesg --follow

Comments

Popular posts from this blog

HAproxy logging

tomcat catalina coyote jasper cluster

NFS mount add in fstab _netdev instead of default | firewall-cmd --list-all