How to filter the dmesg log to see only the errors

dmesglogs

I am in ubuntu, when I write dmesg the error messages appear in red, how could I print in the console only those?

Best Answer

use --level option described in man dmesg:

  -l, --level list
         Restrict output to the given (comma-separated) list of levels.
         For example:

                dmesg --level=err,warn

         will print error and warning messages only.  For all supported
         levels see the --help output.
Related Question