Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a constantly changing file and I wish to view the first n lines.Is this possible?

share|improve this question
    
Your file is being written to at the beginning ? Surely the first n lines will always be the same ? –  Iain May 12 '11 at 10:23
add comment

1 Answer 1

up vote 10 down vote accepted

No. Use watch with it instead.

share|improve this answer
5  
Specifically the usage would be: watch -n 2 head filename to check watch the head looks like every two seconds. Use watch -d to highlight differences. –  Caleb May 12 '11 at 10:32
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.