How to go to the next found result when using the less command on a log file in Linux?

I have a log file where I can use less on the file where I know how to go to the bottom of the log file with a shift+G and then use ? to query in the text file.

What I don't know how to do is when I go to the bottom of the log file and find my first error or what I ever searching for with ? how I do get to the next one? From the bottom up I am hoping to go up and up and up on each error in the log file.

1 Answer

The answer is in the manual, 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.
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like