11) Make ‘less’ behave like ‘tail -f’
less +F somelogfile
Using +F will put less in follow mode. This works similar to ‘tail -f’. To stop scrolling, use the interrupt [i.e. Ctrl-C]. Then you’ll get the normal benefits of less (scroll, etc.).Pressing SHIFT-F will resume the ‘tailling’ [sic].
This is really useful for watching logs while debugging - if you see something interesting scroll past, Ctrl-C to freeze it, then you can use ? with a regex to search back for previous occurrences of the interesting thing.
To explain the cryptic +F syntax: anything you pass after the + is interpreted by less as if you'd pressed those keys while less was running, and Shift-F enables follow mode. So +F just puts less straight into tail mode.
Conversely, you can enable regular command-line options once a less session is already running, by just typing them. For example, I usually run 'less -i' for case-insensitive search, but if I forget the -i, I can just type -i once less has started to disable case sensitivity.
less is actually much more powerful than its standard use as a mere pager would suggest.