This site is now 100% read-only, and retired.

XML logo

less with tail
Posted by Nilshar on Tue 15 Jul 2008 at 16:36
Tags: , , ,
You are using tail -f <file> to monitor a log file ? I was too.
You are using less to read and scroll up/down, search, etc.. a file ? I was too.
Today someone showed me that "less" is able to do tail (maybe most of you know already..).

use your usual :
less <file> to read the file, and if you want to use it as a tail, simply shift+F !
you want to stop the "tail mode" ? ctrl-C and you back to usual less. shift-F again to tail again etc..

 

Comments on this Entry

Re: less with tail
Posted by Steve (80.68.xx.xx) on Tue 15 Jul 2008 at 17:48
[ View Weblogs ]

A good tip - I remember it has been mentioned before, along with a few other neat things, in our introduction to less.

Steve

[ Parent ]

Re: less with tail
Posted by ajt (195.112.xx.xx) on Tue 15 Jul 2008 at 22:36
[ View Weblogs ]

The problem with tips like this is that I forget them...!

--
"It's Not Magic, It's Work"
Adam

[ Parent ]

Re: less with tail
Posted by Anonymous (59.178.xx.xx) on Wed 16 Jul 2008 at 08:19
> The problem with tips like this is that I forget them...!

The unix philosophy of "do one thing and do it well" springs to mind.

But given the power of today's machines, it hardly makes sense to remove such features. Good developers architect such things in a highly modular way anyhow.

PJ

[ Parent ]

Re: less with tail
Posted by stab (89.173.xx.xx) on Sun 25 Oct 2009 at 20:22
[ View Weblogs ]
another interesting feature is editing in less
press 'v' to open the file in your default editor

[ Parent ]