DEV Community

Rohit Jain
Rohit Jain

Posted on

1 1 1

DMESG [LINUX]

The dmesg command allows you to view messages from the kernel ring buffer. These messages can be useful for troubleshooting issues with the kernel, drivers, or other system components.

To use dmesg, simply type the command followed by any options or arguments you want to use. Some common options include:

-c: Clear the kernel ring buffer after reading it.
-f: Follow the kernel ring buffer in real-time, similar to the tail -f command.
-T: Display timestamps for each message.
-n: Set the minimum log level to display. For example, -n 4 will only show messages with a log level of 4 or higher.
For example, to view the most recent kernel messages and follow the kernel ring buffer in real-time, you would use the following command:

dmesg -f

You can also use dmesg to send a message to the kernel ring buffer. To do this, use the -s option followed by the message you want to send. For example:

dmesg -s "Hello, kernel!"

This can be useful for debugging or testing purposes.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay