Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search for string while viewing a manpage

Tags:

manpage

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?)

like image 647
rudolph9 Avatar asked May 26 '26 10:05

rudolph9


1 Answers

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.

like image 122
Alex P. Avatar answered Jun 02 '26 23:06

Alex P.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!