Results 1 to 10 of 10
Anyone know of a way to tail -f dmesg?...
- 06-28-2005 #1Linux User
- Join Date
- Nov 2003
- Location
- Brooklyn, NY
- Posts
- 347
Tail Dmesg
Anyone know of a way to tail -f dmesg?
- 06-28-2005 #2
Are you asking what the file name is of the ring buffer? The only time that I know of that it gets written to is during boot time. (But I could be mistaken.) What would be the purpose of putting tail -f on it? Just curious.
- 06-28-2005 #3Linux User
- Join Date
- Nov 2003
- Location
- Brooklyn, NY
- Posts
- 347
tail -f <logfile>
Originally Posted by anomie
Would display the last few lines of the logfile as it keeps getting updated without having to run tail or cat again. Try it.
I am trying to have dmesg displayed in the terminal and keep getting updated without me having to do anything.
- 06-28-2005 #4
Try
for static, I haven't got tailf here at the moment so I can't check - but you could always script something likeCode:dmesg | tail
That's just off the top of my head, you may tweak away. I'll let youhave that under the GPL !! hahaCode:#!/bin/bash while true do dmesg | tail sleep 3 done
- 06-28-2005 #5Linux User
- Join Date
- Nov 2003
- Location
- Brooklyn, NY
- Posts
- 347
Yeah, I have tried
Originally Posted by bigtomrodney
but it does not want to accept -f.Code:dmesg | tail
- 06-28-2005 #6I know that, but I am asking what the purpose is of tail -f on the ring buffer. It only gets written to during boot time (I think). So you can tail -f on it but nothing will happen.tail -f <logfile>
Would display the last few lines of the logfile as it keeps getting updated without having to run tail or cat again. Try it.
- 06-28-2005 #7
The ring buffer in FC should be /var/log/dmesg. Not sure what it is in other distros.
You have to tail that, not the dmesg command. (And as I said, I don't think you will be seeing anything change with it unless you are booting.)
- 06-28-2005 #8
It's interesting - under SuSE the ring buffer appears to be made up of two files.
- /var/log/messages
- /var/log/warn
However, it is not all the lines in those files; it is only the kernel messages. So when dmesg gives results under SuSE it appears to contain those found in the two files with the prefix 'kernel:'.
Your distro may be totally different.
- 06-29-2005 #9
dmesg also reports any devices plugged in or out, as mentioned it is kernel messages. trying plugging in a flash drive, and run it before and after.
- 09-24-2009 #10Just Joined!
- Join Date
- Sep 2009
- Posts
- 1
This is how I do it...
Keep in mind that the '-c' flag clears the message buffer into stdout. The 'sudo' is unnecessary if you are root. If you feel this is eating too much of your CPU resource, try adding a 'sleep 1' before the loop is done.Code:while true;do sudo dmesg -c;done



