Reputation: 32331
I opened a log file using tail -f mylog.log , can i do a search for a particular string during this time ??
Means when the application is running , and i opened the log using the tail command , is it possible to search for a particular key in that log ??
Thanks
Upvotes: 4
Views: 4596
Reputation: 274630
I don't think tail
can do this.
Instead of tail -f
, use less +F
which has the same behaviour. Then you can press Ctrl+C
to stop tailing and use ?
to search backwards. To continue tailing the file from within less
, press F
.
Upvotes: 3
Reputation: 1183
If you are asking if the file can be read by another process, yes, it can. In other words, if, for example, you search the file from another shell instance, it will work even while another instance is tail -f'ing it.
Upvotes: 0