Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a command-line tool to measure how fast a text file is growing, in units of lines/second?

For small-ish files, I can do something with watch and wc -l, but that measures the file anew each time. Usually I want to watch either a huge log file, or a pipeline.

If there was a tool that just read stdin, and every second it spat out how many newlines it had read during the past second, that'd be perfect.

It's probably pretty easy to throw something together in one of my HLLs of choice, but if there's an existing tool that does this, all the better.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You're looking for pv (pipe viewer), available on or at least for most unices.

data-producer | pv | data-consumer
tail -f logfile | pv -l
share|improve this answer
    
Excellent, thanks! –  Ken Dec 16 '10 at 5:07

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.