I am using less to view a file with many long lines. less automatically wraps these lines, but when I use / and n to search for something, it only shows the first occurrence of the text on a line. However, I want to see all occurences of the search result on the wrapped line.

  • 1
    I believe the way less reacts to / and then n is the way it is supposed to. If you want to view multiple occurrences of the same word on the same line, you need to use something like vi. If you think you will accidentally edit a file which should not be edited, use view instead or vi -R. Both are effectively the same thing – MelBurslan Mar 1 '16 at 22:12

Your Answer

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

Browse other questions tagged or ask your own question.