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,
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
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.
Monitor real time dmesg logs using ‘–follow’ option
Use ‘–follow’ option in dmesg command to view real time dmesg logs, example is shown below,
Comments
Post a Comment