I want to tail -f
my logs. However, I want to filter out everything that has the words:
"ELB", "Pingdom", "Health"
I guess everyone knows the useful Linux cmd line utilities head
and tail
. head
allows you to print the first X lines of a file, tail
does the same but prints the end of the file. What is a good command to print the middle of a file? something like middle --start 10000000 --count 20
(print the 10’000’000th till th 10’000’010th lines).
I'm looking for something that will deal with large files efficiently. I tried tail -n 10000000 | head 10
and it's horrifically slow.
We're using tail to continuously monitor several logs, but when a log is rotated the tail for that file will cease.
As far as I understand, the problem is that when the log is rotated, there is a new file created, and the running tail process doesn't know anything about that new file handle.
Is there some convenient alternative to this on Windows? I always miss this away from Linux. And no I don't consider Cygwin or some other bash port to be "convenient". :)
Either a small app that'll do it from the command line or will have it open in a window. I need to be able to essentially pause it too, which won't affect the log file, but will allow me to scroll up through the buffer.