How do I search for a word or a phrase in the Linux 'man' command and cycle through the found solutions?

40,988

Solution 1

Use n and ShiftN for the next and previous matches.

(The default pager used for manual pages is less, which has similar shortcuts to those in the vim text editor.)

Solution 2

Type / followed by Enter; an empty regex always means the previous successfully matched regex.

Share:
40,988

Related videos on Youtube

Eddy
Author by

Eddy

Updated on September 18, 2022

Comments

  • Eddy
    Eddy over 1 year

    When looking for a certain word or phrase in the man page of Linux command, one can type '/' followed by the word or phrase to search for it.

    What I'd like to be able to do is to search for the next occurrence of the word or phrase without having to type it out again. Kinda like when you use ctrl+f in a browser to search for a word, and then press enter to find the next occurrence of that word.

    If this is possible to do, how do I do it?

  • Lekensteyn
    Lekensteyn almost 13 years
    less does not start continue in the beginning after it reaches the bottom. To move up, either press Home or P.
  • JoL
    JoL almost 7 years
    Or you can just press n for the same effect.