Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In order to display the messages loaded into a kernel module, I can use the command


Is there any alternatives for this command? How this function gets all these kernel messages?

share|improve this question
The easiest way to find out is probably by looking at the source - you can get it from… Look in sys-utils/dmesg.c. You'll notice it's checking /dev/kmsg and using the klogctl call (see for an explanation of how kernel logging works) – IlluminAce Mar 16 '13 at 17:22
up vote 3 down vote accepted

All messages you can see with dmesg are by default written to var/log/syslog as well. So you can look through this log file with any tool you like.

I use less var/log/syslog for reading it later or tailf var/log/syslog for "just in time" purposes.

As zwets has just pointed out: /var/log/dmesgcontains the dmesg output collected during system boot.

share|improve this answer
And there is also /var/log/dmesg which has the dmesg output collected during system boot. – zwets Mar 16 '13 at 21:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.