Man page section numbers

In Linux documentation, commands are often followed by a number in parentheses, like grep(1) or mount(8). That number refers to a specific section of the man pages, which are organized by the type of content they describe:

SectionDescriptionExamples
1User commands: Executable programs available in user environments (usually in $PATH).ls(1), grep(1)
2System call interfaces: Low-level functions that transfer control to the kernel. Some correspond to actual syscalls (like read); others (like fork) are wrappers around internal syscalls (e.g. clone).open(2), read(2), fork(2)
3Library functions: APIs provided by user-space libraries like libc, libm, etc.printf(3), malloc(3)
4Special files: Interfaces to device files, usually found under /dev.null(4), random(4)
5File formats and config files: Syntax and conventions for text-based configuration.fstab(5), passwd(5)
6Games and amusements: Games, screensavers, and recreational software.fortune(6)
7Miscellaneous: Conventions, standards, protocols, charsets, signal descriptions, etc.signal(7), man(7)
8System administration commands: Tools for sysadmins; often require root privileges.mount(8), iptables(8)

Why this matters? Sometimes, the same name appears in more than one section. A classic example:

  • passwd(1) – the command you run to change your password
  • passwd(5) – the configuration file /etc/passwd

So when you want a specific version, you can tell man which section to open:

man 5 passwd

This will skip the default (usually section 1) and go straight to section 5.

If you’re unsure which sections are available for a command, use:

man -f <command>

or equivalently

whatis <command>

This is handy and it also displays one-line descriptions of commands.