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

18

u/[deleted] Mar 30 '15

[removed] — view removed comment

6

u/mioelnir Mar 30 '15 edited Mar 31 '15

less has a filter mechanism (I think it is invoked with % it is invoked with &) where only lines matching the filter are displayed. This works for viewing regular files, and I'd assume it also works with this less +F mode. In which case you could emulate tail -F | grep with it, but not in a single invocation. Unless there is a cli option to specify the filter, which I am too tired to look up right now.

Edit: thanks to /u/RandCoder for looking up that & is what I meant. One of those options too rarely used.

2

u/[deleted] Mar 31 '15

Whoa, another thing I learn today about less. It's invoked with &. And :h brings a nice help screen teaching all this cool tricks. :)