How to show a real-time count of the number of lines added per second to files?
1
vote
4
answers
2183
views
I'm working with a directory of multiple log files.
I'm trying to show a running count, updated periodically, of the number of lines written to each log file.
I need to see the number of lines written per period (e.g. per second) to each file, indexed by file name.
For bonus points, the lines should be sorted in decreasing order of the number of lines written per second.
This doesn't have to use something like
ncurses
(e.g. like top); it's ok if it simply writes updates every period (e.g. every second).
How do I accomplish this task?
---
I've included my solution as an answer, but I suspect there's a better way to do this... Hoping to learn a better way!
Asked by rinogo
(303 rep)
Sep 25, 2020, 05:17 PM
Last activity: Mar 9, 2025, 01:30 PM
Last activity: Mar 9, 2025, 01:30 PM