<story><title>Sick Linux Commands</title><url>http://blog.urfix.com/25-sick-linux-commands/</url></story><parent_chain><item><author>notyourwork</author><text>Can I ask why not to just use tail?  What benefit does this serve?</text></item><item><author>samstokes</author><text>Here&apos;s one more people should know about:&lt;p&gt;&lt;i&gt;11) Make ‘less’ behave like ‘tail -f’&lt;/i&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;    less +F somelogfile
&lt;/code&gt;&lt;/pre&gt;
&lt;i&gt;Using +F will put less in follow mode. This works similar to ‘tail -f’. To stop scrolling, use the interrupt&lt;/i&gt; [i.e. Ctrl-C]. &lt;i&gt;Then you’ll get the normal benefits of less (scroll, etc.).&lt;/i&gt;&lt;p&gt;&lt;i&gt;Pressing SHIFT-F will resume the ‘tailling’&lt;/i&gt; [sic].&lt;p&gt;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.&lt;p&gt;To explain the cryptic +F syntax: anything you pass after the + is interpreted by less as if you&apos;d pressed those keys while less was running, and Shift-F enables follow mode.  So +F just puts less straight into tail mode.&lt;p&gt;Conversely, you can enable regular command-line options once a less session is already running, by just typing them.  For example, I usually run &apos;less -i&apos; for case-insensitive search, but if I forget the -i, I can just type -i once less has started to disable case sensitivity.&lt;p&gt;less is actually much more powerful than its standard use as a mere pager would suggest.</text></item></parent_chain><comment><author>jfb</author><text>Can modern tails stop following and search back up the buffer?  That&apos;s why I use less +F, personally.</text></comment>
<story><title>Sick Linux Commands</title><url>http://blog.urfix.com/25-sick-linux-commands/</url></story><parent_chain><item><author>notyourwork</author><text>Can I ask why not to just use tail?  What benefit does this serve?</text></item><item><author>samstokes</author><text>Here&apos;s one more people should know about:&lt;p&gt;&lt;i&gt;11) Make ‘less’ behave like ‘tail -f’&lt;/i&gt;&lt;p&gt;&lt;pre&gt;&lt;code&gt;    less +F somelogfile
&lt;/code&gt;&lt;/pre&gt;
&lt;i&gt;Using +F will put less in follow mode. This works similar to ‘tail -f’. To stop scrolling, use the interrupt&lt;/i&gt; [i.e. Ctrl-C]. &lt;i&gt;Then you’ll get the normal benefits of less (scroll, etc.).&lt;/i&gt;&lt;p&gt;&lt;i&gt;Pressing SHIFT-F will resume the ‘tailling’&lt;/i&gt; [sic].&lt;p&gt;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.&lt;p&gt;To explain the cryptic +F syntax: anything you pass after the + is interpreted by less as if you&apos;d pressed those keys while less was running, and Shift-F enables follow mode.  So +F just puts less straight into tail mode.&lt;p&gt;Conversely, you can enable regular command-line options once a less session is already running, by just typing them.  For example, I usually run &apos;less -i&apos; for case-insensitive search, but if I forget the -i, I can just type -i once less has started to disable case sensitivity.&lt;p&gt;less is actually much more powerful than its standard use as a mere pager would suggest.</text></item></parent_chain><comment><author>halfasleep</author><text>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&apos;t clutter the scrollback of your terminal with output from tail.</text></comment>