Hello I have rare situation and no sure if this really fails.

I am monitoring a file , I get the size using ls -ald and then i run tail -n command but sometime i see increase in the size but tail -n does not return anything.

Any clue on why this could happen.

link|improve this question
Are you absolutely sure that no process is shrinking that file? – Olli Feb 14 '11 at 7:42
What type of file is it? – aqua Feb 14 '11 at 7:49
what does wc say about it? – Dennis Williamson Feb 14 '11 at 8:24
feedback

migrated from stackoverflow.com Feb 14 '11 at 7:33

This question came from our site for professional and enthusiast programmers.

1 Answer

If you are monitoring a file, then you expecting that it is being written to (growing in size)? Yes?

Try

tail -f -n${Number} filename

From tail --help (on MingW)

-f, --follow[={name|descriptor}]
           **output appended data as the file grows**;
            -f, --follow, and --follow=descriptor are equivalent

I hope this helps.

P.S. as you appear to be a new user, if you get an answer that helps you please remember to mark it as accepted, and/or give it a + (or -) as a useful answer

link|improve this answer
feedback

Your Answer

 
or
required, but never shown