How do you do a case insensitive search using a pattern modifier using less?

前端 未结 5 1033
清酒与你
清酒与你 2021-01-29 18:27

It seems like the only way to do this is to pass the -i parameter in when you initially run less. Does anyone know of some secret hack to make something like this work



        
5条回答
  •  死守一世寂寞
    2021-01-29 18:59

    You can also set the environment variable LESS

    I use LESS=-Ri, so that I can pump colorized output from grep into it, and maintain the ANSI colour sequences.

    Another little used feature of less that I found is starting it with +F as an argument (or hitting SHIFT+F while in less). This causes it to follow the file you've opened, in the same way that tail -f will. Very handy if you're watching log files from an application, and are likely to want to page back up (if it's generating 100's of lines of logging every second, for instance).

提交回复
热议问题