Navigating within Man Pages in Bash
Searching within Man Pages
Just hit / and type your search pattern.
Patterns
Patterns can be regular expressions, for example, you could search for the word “regex” or “Regex” by typing
/[Rr]egex
To find a long option/argument:
/(--)[a-Z]
To cancel the search, hit Ctrl+C.
Iterate through results
Press N for next nmatch, Shift+N for previous match.
To search ALL Man Pages
Use the -K
option
-K, --global-apropos search for text in all pages
man -K "regex"
In the above example, man
will find the first man page with a match and open it.
When you close the page with q, you will be prompted with something similar to this:
--Man-- next: wget(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
- Enter to find the next match in the man page with a match, in this case
wget(1)
- Ctrl+D to skip to the next man page with a match
- Ctrl+C to quit the search