r/linux • • Mar 30 '15

Stop using tail -f (mostly)

http://www.brianstorti.com/stop-using-tail/
830 Upvotes

219 comments sorted by

View all comments

7

u/RandomDamage Mar 30 '15 edited Mar 30 '15

My most common use case for tail -f is "tail -f foo.log | grep search_string", which won't work the same with less

That said, this is a pretty neat less trick.

(After reading this, I think I'm going to be using "tail -F foo.log | grep --line-buffered search_string | less" to get all the features!)

[edit] Updated command line due to additional information in response.

5

u/frymaster Mar 30 '15

Don't forget to pass --line-buffered to grep ;)

1

u/RandomDamage Mar 30 '15

Thanks for saving me some troubleshooting time :)