Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I came across the post at Linux 'man' command: How do I search for a word/phrase and cycle through? which explains the ability to cycle to the next pattern but how do I get it cycle through when it has passed the a pattern assuming it only occurs once or when I get to the bottom of the page?

For example once I have run the command man dpkg I pass / followed by simulate. This takes me to the pattern however it only works when I am the top of the page. If I am past the pattern, it does recursively search the entire man page.

share|improve this question
The question you link to has the answer. Read the comments to the accepted answer. – Mat May 9 '12 at 5:43
Recursive doesn't mean what you think. – Daniel Beck May 9 '12 at 5:48
@Mat - I did read the accepted answer but it doesn't start from the top again if I have scrolled down to the bottom of the page. – PeanutsMonkey May 9 '12 at 5:56
@Daniel Beck - Sorry. What do you mean? – PeanutsMonkey May 9 '12 at 5:56
@PeanutsMonkey: The answer suggests just pressing Home or p to go to the beginning when you hit the end. The next search will then be from the beginning. g also works (and is similar to Vim, so that is what I use when in less). – Daniel Andersson May 9 '12 at 13:10
up vote 1 down vote accepted

man does not have an option to continue searching at the top of page once you reach the bottom, so pressing p is your option, or Shift-n to search backwards.

man uses less to do its paging, and less doesn't support cycling that way. So you could look at getting man to use something other than less for paging such as vim. Or alternatively, install the vim man plugin and run man from within a vim session:

:Man dpkg
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .