How to search the whole manual pages on Linux?

61

Solution 1

From man man:

-K, --global-apropos
      Search for text in all manual  pages.   This  is  a  brute-force
      search,  and is likely to take some time; if you can, you should
      specify a section to reduce the number of pages that need to  be
      searched.   Search terms may be simple strings (the default), or
      regular expressions if the --regex option is used.

This directly opens the manpage (vim, then ex, then gview, ...) for me, so you could add another option, like -w to get an idea of which manpage will be displayed.

$ man -wK viminfo
/usr/share/man/man1/vim.1.gz
/usr/share/man/man1/vim.1.gz
/usr/share/man/man1/gvim.1.gz
/usr/share/man/man1/gvim.1.gz
/usr/share/man/man1/run-one.1.gz
/usr/share/man/man1/gvim.1.gz
/usr/share/man/man1/gvim.1.gz
/usr/share/man/man1/run-one.1.gz
/usr/share/man/man1/run-one.1.gz
...

Solution 2

Use the global apropos option in man.

 -K, --global-apropos
              Search for text in all manual pages.  This is a brute-force search, and is likely to take some time; if you can, you should specify a section to reduce the number  of pages that need to be searched.  Search terms may be simple strings (the default), or regular expressions if the --regex option is used.

So, man -K viminfo will give you the page you need.

Share:
61

Related videos on Youtube

Sumit Shrestha
Author by

Sumit Shrestha

Updated on September 18, 2022

Comments

  • Sumit Shrestha
    Sumit Shrestha over 1 year

    I have a grails application where i have to detect if page is rendered successfully.

    So, if I have render view: "mypage", I want to know if this page was rendered successfully by tomcat. Whether it reached user or not is not concern here. That is another part which can be tracked by using javascript events.

    The solution that comes to my mind is using error controller and url mapping to map any issue like 404 or 500 to one controller but that controller is somewhat generic and will be handling multiple issues and not just this one.

    So, Is it possible to exclusively know for this render call if it was rendered properly or not?

  • Leo Ufimtsev
    Leo Ufimtsev almost 9 years
    The -wK combination is particulaly interesting
  • weirdo
    weirdo over 3 years
    If I do :!man -K info in gvim, will it let me edit the manual pages or will it merely display the manual pages? In VIM normal mode, I accidentally hit K when my cursor was at the word info and I was afaird that I may have messed up some of the manual pages (and hence this question) :-(