Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
1  
@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
show 2 more comments

1 Answer 1

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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