0

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.

0

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
  • Just beat me :)
    – DavidPostill
    Jul 30 at 19:56
  • When having less in use (i.e. when reading a text) a simple press on ? will show quite a bit of help. No need to bring up the Man. ;-)
    – Hannu
    Jul 31 at 6:49

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.