在 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.

相關內容