The dmesg is used to examine or control the kernel ring buffer. A buffer is a portion of a computer's memory that is set aside as a temporary holding place for data that is being sent to or received from an external device, such as a hard disk drive, printer, or keyboard. The ring buffer is a buffer of fixed size for which any new data added to it overwrites the oldest data in it.
$ dmesg
$ dmesg -H