The Archives

  • 02.Mar.09
    Adding ‘tail -f’ behavior to ‘less’ cmd | rafacas | (0)
    $ less +F /var/log/messages The +F option turns on less 'follow mode'. It is similar to tail -f but you will have the benefits of less, like scrolling up and down. To stop tailing, use Ctrl-C and to resume it, press Shift-F.
  • 17.Jan.09
    Less can do more… scripts, shell | fernape | (0)
    ... more than you think ;) less is a command that allows you to view and move forward and backwards in a file among other things. But the interesting thing is that less allows you to define a preprocessor. You can set it as the form of a shell script specified in the LESSOPEN environment variable. $ echo $LESSOPEN %s This is the script that will be invoked before the actual less command (located in /usr/bin/less) is executed. The result of the script must be something readable. If you take a look at the script you will find what kind of files can ...