Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today!
Try Our New Product Showcase!
Find the answer to your Linux question:
Advertisement
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Linux Applications > Tail Dmesg

Forgot Password?
 Linux Applications   I cant get "X" app to work... also discussion about linux programs.

Site Navigation
Linux Forums
Linux Articles
Product Showcase
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Free Publications




Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Closed Thread
 
Thread Tools Display Modes
Old 06-28-2005   #1 (permalink)
Linux User
 
Join Date: Nov 2003
Location: Brooklyn, NY
Posts: 347
Send a message via ICQ to Slip Send a message via AIM to Slip
Tail Dmesg

Anyone know of a way to tail -f dmesg?
Slip is offline  



Old 06-28-2005   #2 (permalink)
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,696
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.
anomie is offline  
Old 06-28-2005   #3 (permalink)
Linux User
 
Join Date: Nov 2003
Location: Brooklyn, NY
Posts: 347
Send a message via ICQ to Slip Send a message via AIM to Slip
Quote:
Originally Posted by anomie
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.
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.

I am trying to have dmesg displayed in the terminal and keep getting updated without me having to do anything.
Slip is offline  
Old 06-28-2005   #4 (permalink)
/etc/init.d/moderator
 
bigtomrodney's Avatar
 
Join Date: Nov 2004
Location: Sunny South-East of Ireland
Posts: 6,104
Try
Code:
dmesg | tail
for static, I haven't got tailf here at the moment so I can't check - but you could always script something like
Code:
#!/bin/bash
while true
do dmesg | tail 
sleep 3
done
That's just off the top of my head, you may tweak away. I'll let youhave that under the GPL !! haha
__________________
Registered Linux user #378740
New members read here / Forum Rules
#linuxforums on irc.freenode.net
bigtomrodney is offline  
Old 06-28-2005   #5 (permalink)
Linux User
 
Join Date: Nov 2003
Location: Brooklyn, NY
Posts: 347
Send a message via ICQ to Slip Send a message via AIM to Slip
Quote:
Originally Posted by bigtomrodney
Try
Code:
dmesg | tail
for static, I haven't got tailf here at the moment so I can't check - but you could always script something like
Code:
#!/bin/bash
while true
do dmesg | tail 
sleep 3
done
That's just off the top of my head, you may tweak away. I'll let youhave that under the GPL !! haha
Yeah, I have tried
Code:
dmesg | tail
but it does not want to accept -f.
Slip is offline  
Old 06-28-2005   #6 (permalink)
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,696
Quote:
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.
I 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.
anomie is offline  
Old 06-28-2005   #7 (permalink)
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,696
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.)
anomie is offline  
Old 06-28-2005   #8 (permalink)
Linux Guru
 
anomie's Avatar
 
Join Date: Mar 2005
Location: Texas
Posts: 1,696
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.
anomie is offline  
Old 06-29-2005   #9 (permalink)
/etc/init.d/moderator
 
bigtomrodney's Avatar
 
Join Date: Nov 2004
Location: Sunny South-East of Ireland
Posts: 6,104
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.
__________________
Registered Linux user #378740
New members read here / Forum Rules
#linuxforums on irc.freenode.net
bigtomrodney is offline  
Old 09-24-2009   #10 (permalink)
Just Joined!
 
Join Date: Sep 2009
Posts: 1
This is how I do it...

Code:
while true;do sudo dmesg -c;done
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.
axelabs is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Implementing Detailed User-Level Auditing of UNIX & Linux Systems
Enhance regulatory compliance and troubleshooting through detailed auditing, logging and real-time monitoring of UNIX/Linux user activity.
subscribe
Linux from Scratch - Receive Your Complimentary eBook NOW!
Linux from Scratch describes the process of creating your own Linux system from scratch from an already installed Linux distribution, using nothing but the source code of software that you need.
subscribe
A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)
Getting Started with Ubuntu 10.04 (Lucid Lynx) is a comprehensive beginners guide for the Ubuntu operating system; it features comprehensive guides, How Tos and information on anything you need to know after first installing Ubuntu.
subscribe
The Incredible Guide to NEW Ubuntu (Karmic Koala)
There are a lot of people still stuck with Windows because it's the ‘easier alternative'. Linux is both cheaper and more versatile than Microsoft's operating system, but the learning curve has frightened off many people.
subscribe
The GNU/Linux Advanced Administration
The GNU/Linux systems have reached an important level of maturity, allowing to integrate them in almost any kind of work environment, from a desktop PC to the sever facilities of a big company.
subscribe
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it.
subscribe
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe



All times are GMT. The time now is 07:37 AM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1