A man page for fork, for example, is in the System Calls section that has number 2:

man 2 fork

How do you see what else is section 2 without resorting to Google?


5 Answers 5


To list all installed man pages from a specific section you can use apropos:

apropos -s 2 .  # use an regex for apropos . means anything
apropos -s 2 -w '*'  # use unix globbing for apropos
  • 1
    "apropos: -s: unknown option" Jul 30, 2012 at 20:36
  • @MichaelMrozek what system are you using? It works for me, e.g: output of apropos -s 2 -w '*' Jul 30, 2012 at 20:42
  • 1
    Thanks. The -s option is not present in Mac OS X apropos, which is presumably from BSD.
    – xyz
    Jul 30, 2012 at 21:09
  • @f100 Ah ok, maybe try man -a -s 2 '*' Jul 30, 2012 at 21:16
  • That seems more like it, but instead of listing them, it's actually invoking the viewer for each one in turn. I've hacked up a function to do listing which I posted in another comment. It likely has issues but it's enough for me :)
    – xyz
    Jul 30, 2012 at 21:50

Manpages are usually placed in /usr/share/man, but check $MANPATH, and are organized into sections like so:

 Section 1:

 Section 2:


So to list all installed section 2 manpages, do:

ls /usr/share/man/man2/

Or the more complete one:

find $(echo $MANPATH | tr ':' ' ') -path '*/man2/*'

The latter one will have problems if you have directories in $MANPATH with space in their names.

On most distributions you can also check available man pages with a package tool, e.g. on Debian derived distributions you can use apt-file like so:

apt-file search /man2/
  • 1
    Thanks - This was the start I needed. I made a shell function that is run e.g. lman 2 and lists the unadorned name for each page on a new line and pages them. The function's body is: find $(man --path | tr ':' ' ') -path "*/man$1/*"| xargs basename | sort | sed -E "s/\.$1(.gz)?\$//" | less
    – xyz
    Jul 30, 2012 at 21:41

This command lists the sorted names of all the entries in the given section:

man -aWS 1 \* | xargs basename | sed 's/\.[^.]*$//' | sort -u

If you want to see the pathnames, use:

man -aWS 1 \* | sed 's/\.[^.]*$//' | sort

This tells man to search a section for all commands using the wildcard pattern * (backslash-quoted so the shell doesn't interpret it). -a finds all matches, -W prints the pathnames instead of displaying the pages, and -S 1 specifies section one. Change the 1 to whatever section you want to search.

The sed command strips the filename extensions; remove it if you want to see the complete filenames. sort sorts the results (-u removes duplicates).

For convenient reuse, this defines a Bash shell function:

function mansect { man -aWS ${1?man section not provided} \* | xargs basename | sed 's/\.[^.]*$//' | sort -u; }

For example, you can invoke it as mansect 3 to see the entries in section three.

[Tested on macOS.]

  • Nice - Thanks. I get some duplicates (e.g. paths in /Applications/Xcode.app and "Accelerate" in section 7), but nothing putting a uniq in the pipeline doesn't fix.
    – xyz
    Sep 5, 2016 at 13:34
  • @xyz: I updated the sort command to sort -u to remove duplicates.
    – Chris Page
    Sep 6, 2016 at 20:40
  • 1
    I get No manual entry for * Oct 22, 2020 at 19:04

On Mac OS X, the only thing I can get to work is man -k . | grep -F '(3)', which lists everything in section 3.


I know this is a very old question, however the answers given here all didn't work for me. Therefore I came up with the following one-liner that works on Ubuntu 18.04 and macOS Mojave, 10.14.6:

find $(man --path | tr ':' ' ') -type f -path '*man2*' \
  -exec basename {} \; | sed 's/\..*//' | sort

Quick run down:

  • form Thors answer: $(man --path | tr ':' ' ') to get the current paths of the man pages
  • find <man paths> -type f -path '*man2*' -exec basename {} \; gets the file names of all regular files in the man paths
  • sed gets rid of the file extension
  • sort alphabetically.
  • Works great on macOS 10.15.7 thanks @Ben Apr 12, 2021 at 22:14
  • This listing is a bit too naive, it is great if it works for what you need to do — but keep in mind that the man search algorithm is pretty intricate. See man man for more details. (In particular, it can search for things 'near the roots', and all sectionN pages aren't under manN subfolders.)
    – folkol
    Jun 4 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.