Commands

dmesg

[ -c ] [ -n level ] [ -s bufsize ]

This command is used to display or control the contents of the kernel ring buffer, which contains the bootup messages.

Example: To get the boot messages from your last system startup, use

dmesg | less

Example: To set your console to display messages with annoying frequency, use

dmesg -n 3

-c Clear the contents of the ring buffer after printing.
-sbufsize Specify the size of the buffer used to query the kernel ring buffer. Default is 8196.
-nlevel Specify the level at which log messages are displayed to the console. Note that messages are sent to /proc/kmsg regardless of level. Typically, this is set to 1, which filters all but panic messages.

halt

[-n] [-w] [-d] [-f] [-i] [-p]

reboot

[-n] [-w] ...

Get Linux® Desk Reference, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.