在 Linux 中对日志文件使用 less 命令时如何转到下一个找到的结果?

在 Linux 中对日志文件使用 less 命令时如何转到下一个找到的结果?

我有一个日志文件,我可以在该文件上使用,我知道如何用+less转到日志文件的底部,然后在文本文件中使用它进行查询。shiftG?

我不知道该怎么做,当我进入日志文件底部并找到第一个错误或我所搜索的内容时,?我该如何找到下一个错误?从底部向上,我希望在日志文件中向上向上找到每个错误。

答案1

答案就在手册里,man less

       n      Repeat previous search, for N-th line containing the last
              pattern.  If the previous search was modified by ^N, the
              search is made for the N-th line NOT containing the
              pattern.  If the previous search was modified by ^E, the
              search continues in the next (or previous) file if not
              satisfied in the current file.  If the previous search was
              modified by ^R, the search is done without using regular
              expressions.  There is no effect if the previous search
              was modified by ^F or ^K.

       N      Repeat previous search, but in the reverse direction.

相关内容