less tem correspondência de padrões muito poderosa. Na página de manual :
&patternDisplay only lines which match the
pattern; lines which do not match thepatternare not displayed. Ifpatternis empty (if you type&immediately followed by ENTER), any filtering is turned off, and all lines are displayed. While filtering is in effect, an ampersand is displayed at the beginning of the prompt, as a reminder that some lines in the file may be hidden.Certain characters are special as in the
/command†:
^Nor!Display only lines which do NOT match the
pattern.^RDon't interpret regular expression metacharacters; that is, do a simple textual comparison.
____________
† Certain characters are special if entered at the beginning of thepattern; they modify the type of search rather than become part of thepattern.
(É claro que ^N e ^R representam Ctrl + N
e Ctrl + R , respectivamente.)
Portanto, por exemplo, &dns exibirá apenas as linhas que correspondem ao padrão dns ,
e &!dns filtrará (excluirá) essas linhas,
exibindo apenas linhas que não correspondem ao padrão.
É indicado na descrição do comando / que
The
patternis a regular expression, as recognized by the regular expression library supplied by your system.
Então
-
ð[01]exibirá linhas contendoeth0oueth1 -
&arp.*eth0exibirá linhas contendoarpseguido poreth0 -
&arp|dnsexibirá linhas contendoarpoudns
E o ! pode inverter qualquer um dos itens acima.
Então o comando que você gostaria de usar para o exemplo em sua pergunta é:
&!event text|something else|the other thing|foo|bar
Use também /pattern e ?pattern
para pesquisar (e n / N para ir para o próximo / anterior).