Ubuntu – How to search for all the man files that contain certain keyword

manpagesearch

I want to learn how to search for a file by giving the content within it as a parameter. I can then apply the solution to search for commands contributed by Richard Stallman (through man pages).

Best Answer

This command will show you the filenames of man files that contain the keyword Stallman:

zgrep -l Stallman /usr/share/man/man?/*

Output in my 15.10 begins with:

/usr/share/man/man1/cat.1.gz
/usr/share/man/man1/comm.1.gz
/usr/share/man/man1/ctags.1.gz
/usr/share/man/man1/ctags.emacs24.1.gz

Then, you can browse as usual, with man cat, man comm, etc.