What does the number in parentheses shown after Unix command names in manpages mean?

你。 提交于 2019-11-26 11:58:07
Ian G

It's the section that the man page for the command is assigned to.

These are split as

  1. General commands
  2. System calls
  3. C library functions
  4. Special files (usually devices, those found in /dev) and drivers
  5. File formats and conventions
  6. Games and screensavers
  7. Miscellanea
  8. System administration commands and daemons

Original descriptions of each section can be seen in the Unix Programmer's Manual (page ii).

The section the command is documented in the manual. The list of sections is documented on man's manual. For example:

man 1 man
man 3 find

This is useful for when similar or exactly equal commands exist on different sections

The reason why the section numbers are significant is that many years ago when disk space was more of an issue than it is now the sections could be installed individually.

Many systems only had 1 and 8 installed for instance. These days people tend to look the commands up on google instead.

Note also that on other unixes, the method of specifying the section differs. On solaris, for example, it is:

man -s 1 man

It indicates the section of the man pages the command is found in. The -s switch on the man command can be used to limit a search to certain sections.

When you view a man page, the top left gives the name of the section, e.g.:

User Commands printf(1)
Standard C Library Functions printf(3C)

So if you are trying to look up C functions and don't want to accidentally see a page for a user command that shares the same name, you would do 'man -s 3C ...'

Bob Setterbo

Wikipedia details about Manual Sections:

  1. General commands
  2. System calls
  3. Library functions, covering in particular the C standard library
  4. Special files (usually devices, those found in /dev) and drivers
  5. File formats and conventions
  6. Games and screensavers
  7. Miscellanea
  8. System administration commands and daemons
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!