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

2

u/anotherkeebler Mar 30 '15

The best thing about using less for tailing files is that you can give a search pattern for highlighting interesting lines. I know you can use grep --colour to get the same effect, but that only shows you matching lines, whereas less will let you see the matching line in context.

1

u/jroller Mar 30 '15

And "&", which will let you grep within less and then go back to F mode. Unfortunately, & hasn't made it into OSX's less yet.

1

u/tehmatticus Mar 30 '15 edited Mar 30 '15

Because OSX is using the BSD less rather than the GNU Coreutils less. You can install the GNU version via homebrew or macports.

Edit: disregard, less is a self contained project entirely.

1

u/jroller Mar 30 '15

This is hard to tell from the version string:

yosemite $ which less
/usr/bin/less
yosemite $ less --version
less 418
Copyright (C) 1984-2007 Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Homepage: http://www.greenwoodsoftware.com/less

According to the less release notes it's only about one version behind (edit: one version behind the & that is). It's interesting that less 418 already changed the license to GPL3, so I assume that won't become more of an issue later.

1

u/tehmatticus Mar 30 '15

Actually I'm entirely wrong. As you pointed out, it's a completely separate project run differently.

I wonder why Yosemite isn't at par with most Linux distros, then.

1

u/Badabinski Mar 30 '15

I believe it's because GPL. I could be wrong, but I think Apple doesn't like using GPLv3 software, hence Clang and all that jazz.