Sunday, January 6, 2013

Continous wc -l

When you want to see how fast lines are being appended to a file, try this:
tail -f $filename | awk 'BEGIN {nl=0; format="%F %T"}{nl += 1; if (nl % 1000 == 0) print strftime(format) " " nl}'
Just adjust the mod operand to how often you want a printout.

No comments:

Post a Comment