Question

When viewing a manpage say man ls, how does one search the content of the man page? (similarly, in vim you can call :/search_string what is a comprable command while viewing a man page?)

Was it helpful?

Solution

It depends on which pager you use, which depends on your MANPAGER/PAGER environment variable. The manpage of man says:

If MANPAGER is set, its value is used as the name of the program to use to display the man page. If not, then PAGER is used. If that has no value either, /usr/bin/less -is is used.

Note that on Debian unstable the default is pager -s (managed by alternatives). So, if you actually are using less, just type /searchstring, similar to vim. See also the manpage of less on how to navigate in less.

OTHER TIPS

On Ubuntu (and probably similar distributions), you type "/" followed by what you want to search for

Example:

/word

Pressing "n" jumps to the next hit

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top