linux command-line logs dmesg – How to See dmesg Output as It Changes

command linedmesglinuxlogs

I'm writing a device driver that prints error message into ring buffer dmesg output.
I want to see the output of dmesg as it changes.

How can I do this?

Best Answer

Relatively recent dmesg versions provide a follow option (-w, --follow) which works analogously to tail -f.

Thus, just use following command:

$ dmesg -wH

(-H, --human enables user-friendly features like colors, relative time)

Those options are available for example in Fedora 19.

Related Question