Re:Sick Linux Commands
by notyourwork on Saturday December 04, 2010 @10:04AM
(#1969319)
Can I ask why not to just use tail? What benefit does this serve?
[ Parent
| on HN ]
Can modern tails stop following and search back up the buffer? That's why I use less +F, personally.
Re:Sick Linux Commands
by halfasleep on Saturday December 04, 2010 @10:53AM
(#1969410)
less allows you to stop and resume easily, without losing any of the output of your command (useful if you are watching the output of a process as well). Also less doesn't clutter the scrollback of your terminal with output from tail.
Re:Sick Linux Commands
by justinlilly on Sunday December 05, 2010 @09:24PM
(#1973564)
With less, you can do:
less myfile.log &ERROR # filter out any line that doesn't match the regexp ERROR F # capital f enters follow mode
Now you're tailing a log with a custom grep, which is retroactive on history as well.
Re:Sick Linux Commands
by joshcorbin on Saturday December 04, 2010 @11:36PM
(#1971047)
Wide lines like from syslog, frequently you want one event per line and not to have wrapping occur. The -S switch to less is a boon here.
Re:Sick Linux Commands
by bretthoerner on Saturday December 04, 2010 @10:48AM
(#1969397)
My only guess would be that you can search inside less if your terminal emulator doesn't support it.