Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

dmesg

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

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

1 Answer 1

up vote 1 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
1  
And there is also /var/log/dmesg which has the dmesg output collected during system boot. –  zwets Mar 16 '13 at 21:26
add comment

Your Answer

 
discard

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.