I have a process which is dumping data to a file. It is a list of transactions and typically is about 3.8G in size.
to do a tail -f file.txt
is not very useful, however, each batch of transactions begins with:
START TRANSACTION: xyz
and there are only a couple hundred of those.
Is there any way to combine tail -f
and grep "START TRANSACTION:"
in such a way to get the following output:
START TRANSACTION: abc
START TRANSACTION: def
START TRANSACTION: ghi
...
dynamically?
tail -f
intogrep
?tail -f file | grep ...
and look at e.g. stackoverflow.com/questions/7161821/… if you get buffering issues