This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Tail command limitations? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Tail command limitations?" Watch "Tail command limitations?" New topic
Author

Tail command limitations?

James Daniel
Ranch Hand

Joined: Sep 24, 2004
Posts: 79
Does the "tail -f output.log" command in Unix always capture all output or does it pare it down if too much data is being outputted? Example: If I start tail -f command, and 10 seconds later an external program outputs 1000 lines of log file in period of 1 second or less, will the output contain all 1000 lines - or will it be truncated in some way? The reason why we want tail to be 100% accurate is because we plan on using the output of tail in a java program to process the logs automatically and we don�t want to lose any information. I was under the assuption that tail always captured all output no matter the rate of output. Is this incorrect?

[ April 23, 2007: Message edited by: James Daniel ]
[ April 23, 2007: Message edited by: James Daniel ]
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Is is not incorrect -- i.e., tail won't drop any data.


[Jess in Action][AskingGoodQuestions]
James Daniel
Ranch Hand

Joined: Sep 24, 2004
Posts: 79
Ernest Friedman-Hill,

Thanks for the prompt reply. That is what we thought. A developer in our group was telling us this and we needed to verify. Thanks again..
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15951
    
  19

Tail does a seek to the end of the file, which is a basic function in Unix. So it's actually quite fast.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tail command limitations?
 
Similar Threads
Working with Date and Time
Reading file that is updated while reading
Tomcat Debugging...Help!
Windows and Linux
Another 'Y' game