Linux shell loop wait count data lines
Linux shell loop wait count data lines
I use this pattern when processing data files and need to monitor progress in real time. The loop runs indefinitely, counting lines every 60 seconds — simple but surprisingly useful when you’re watching a file grow during a long batch import.
- Create table
1
$ while true; do cat system_log.txt | wc -l; sleep 60; done
This post is licensed under
CC BY 4.0
by the author.