Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to generate a list of all available man pages on a system?

share|improve this question
2  
type "man man" it will set you free. – Chris Nov 5 '10 at 13:52
up vote 23 down vote accepted

Use:

apropos .

or:

man -k .

where . is a regex that means: "any character".

share|improve this answer
    
Also handy: apropos -s 1 . to limit it to section 1 (user commands), for example. – Dennis Williamson Nov 5 '10 at 16:19
    
I was going to suggest looking at how bash and zsh provide completion, but this is a lot simpler (less portable though, as not all systems accept a regexp as the argument to apropos). – Gilles Nov 5 '10 at 20:42
    
neither of those work in cygwin for me – Wyatt8740 Jun 18 at 22:03

Here's my favourite:

whatis -r .

… and if you just want to see all the man pages in a particular section use the -s flag.

For example, if you just wanted to get a list of all man pages for all executable commands (section 1):

whatis -s 1 -r .
share|improve this answer
# Shell script to list pathname of all available man pages  
mandirs="\`man -w | sed 's/:/ /g'\`"  
find $mandirs -type f  

This produces a list of all man files, using the list of man directories that is produced by "man -w", however, cYrus's any-character-regex solution is much better, pipe though awk to get a clean list of just the page names:

apropos . | awk '{print $1}'

or

man -k . | awk '{print $1}'
share|improve this answer
1  
That way you'll loose the man section and thus create duplicates. For the latter pipe through sort -u. – cYrus Nov 5 '10 at 14:54
$ man -k . -s <section-NR>

For example to show all section 2 pages:

$ man -k . -s 2
share|improve this answer
    
I was hoping man 2 -k '.' would work as well. But it doesn't – abc Aug 7 '14 at 22:45
    
Try again and specify the section after option -k as indicated above ... – Aaron Sep 11 '14 at 15:17

Look in the paths listed in /etc/man.config, with the additional directories as added by the FHS or FSSTND directive as appropriate.

share|improve this answer
    
And then? I think it's better to read paths from MANPATH variable. But it's awful, because there is a huge number of subdirs and it contains different file extensions like 1 or gz. By the way, many systems have no man.config in /etc – psihodelia Nov 5 '10 at 13:43
1  
@psihodelia: On my system it's /etc/manpath.config and $MANPATH is null. – Dennis Williamson Nov 5 '10 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .