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.

link|improve this question
feedback

1 Answer

up vote 3 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
link|improve this answer
Excellent, thanks! – Ken Dec 16 '10 at 5:07
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.