Tail less


I keep seeing people typing these lines in the console:

$ tail /path/to/some.log
$ tail -f /path/to/some.log

This is often a dumb thing to do. Why? Because you can't really do anything with tail. What if you discovered you needed to look at something right above the lines you got printed out? Or what if you were following (-f) and something flew past you that you needed to investigate further? You'd have to leave tail and run it again with more lines or use a different tool instead. Not very practical.

What more people should do is to use less tail and more less. 👍

$ less /path/to/some.log

Things you can do with less

Up one line
Down one line
bUp one page
spaceDown one page
gBeginning of file
GEnd of file
ctrl + cStop follow
/Search forward
?Search backwards
nNext search result
NPrevious search result

Much more flexible and handy than tail! Know your tools. 😉 Now, back to work...