bash tail on a live log file, counting uniq lines with same date/time
问题 I'm looking for a good way to tail on a live log file, and display number of lines with the same date/time. Currently this is working: tail -F /var/logs/request.log | [cut the date-time] | uniq -c BUT the performance is not good enough. There is a delay of more than one minute, and it output in bulks of few lines each time. Any idea? 回答1: Your problem is most likely related to buffering in your system, not anything intrinsically wrong with your line of code. I was able to create a test