MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/linux/comments/30skg1/stop_using_tail_f_mostly/cpvpp26/?context=3
r/linux • u/[deleted] • Mar 30 '15
219 comments sorted by
View all comments
7
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/tehmatticus Mar 30 '15 To mimic this in less, you can do less foo.log and then when inside less, hit the & character and type your search string to filter for that string, then hit F to follow the log. 1 u/RandomDamage Mar 30 '15 Interesting. After testing I see that you can do multiple filters that way, also.
5
To mimic this in less, you can do less foo.log and then when inside less, hit the & character and type your search string to filter for that string, then hit F to follow the log.
less foo.log
&
F
1 u/RandomDamage Mar 30 '15 Interesting. After testing I see that you can do multiple filters that way, also.
1
Interesting. After testing I see that you can do multiple filters that way, also.
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.