Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a command to search for a string within all man pages installed in the man-db

I know that if I can't remember a command I can just look it up on Google. But this should be possible from the shell itself. If I could output all the man-pages, I could run a grep on them and find what I was looking for.

Is there a simple command line man-search-engine out there that indexes all the words in all the man pages and lets you search through the descriptions? If not, how hard would it be to develop one?

like image 755
Shahriar Avatar asked Oct 20 '25 13:10

Shahriar


2 Answers

If you want to search the entire text of the man pages instead of just the short descriptions, the correct answer is man -K (upper case K) or man --global-apropos

The default is to search for literal strings unless --regex is used

like image 127
Jeff Avatar answered Oct 22 '25 02:10

Jeff


I think you might be looking for the -k option to man; see also apropos.

like image 27
randallmeadows Avatar answered Oct 22 '25 02:10

randallmeadows



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!