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

前端 未结 5 979
清酒与你
清酒与你 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 19:18

    Add-on to what @Juha said: Actually -i turns on Case-insensitive with SmartCasing, i.e if your search contains an uppercase letter, then the search will be case-sensitive, otherwise, it will be case-insensitive. Think of it as :set smartcase in Vim.

    E.g.: with -i, a search for 'log' in 'Log,..' will match, whereas 'Log' in 'log,..' will not match.

提交回复
热议问题