What Does the Number in Parentheses Shown After Unix Command Names in Manpages Mean

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

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).

In order to access a man page given as "foo(5)", run:

man 5 foo

Linux functions, why do they have number inside?

Those are the manual section numbers. From the man manual:

 The table below shows the section numbers of the manual followed
by the types of pages they contain.

1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions, e.g. /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions),
e.g. man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]

What is the meaning of the number in parens after the names of shell commands in the title of a manpage?

It tells you what group its manpage is in or, more generally, which group the item itself belongs to. Here's a list of the sections and their contents:

   1   Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
4 Special files (usually found in /dev)
5 File formats and conventions eg /etc/passwd
6 Games
7 Miscellaneous (including macro packages and conventions), e.g.
man(7), groff(7)
8 System administration commands (usually only for root)
9 Kernel routines [Non standard]

See the manpage of 'man' for more details. Or have a look here:
http://linux.die.net/man/

Sometimes items from different groups can have the same name and this is the way to distinguish between them. For example, there is a manpage for printf(1) which is an executable, callable from a shell, as well as a manpage for printf(3) which is a C function definded in stdio.h.

Using the man binary from a bash you can call for the distinct manpages by:

man printf       # displays printf(1)
man 1 printf # displays printf(1)
man 3 prinft # displays printf(3)
man -a printf # displays all manpages matching printf

Depending on what manpages are installed on the system you sometimes get pages from different manuals for the same item. For example printf(3) from the Linux Programmer's Manual could have a printf(3p) counterpart from the Posix Programmer's manual.

What does the (2) after Unix system calls names mean?

Linux man pages are grouped in sections. Section 2 is "System calls (functions provided by the kernel".

  1. Executable programs or shell commands
  2. System calls (functions provided by the kernel)
  3. Library calls (functions within program libraries)
  4. Special files (usually found in /dev)
  5. File formats and conventions eg /etc/passwd
  6. Games
  7. Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
  8. System administration commands (usually only for root)
  9. Kernel routines [Non standard]

Some man pages, such as unlink" exist in several categories (e.g. 1 and 2), so to browse the page of a specific category, run man section page (e.g. man 2 unlink to browse the syscall manual)

Why do programs in Unix-like environments have numbers after their name?

It's the man page section. From memory, section 1 is user programs, 2 is system calls, and 3 is standard C library calls, and 5 is file formats.

Wikipedia has the full explanation here.

What means (3) in fnc(3)?

The number refers to the section in the Linux manual that the documentation for these functions reside in.

When using the man command to look up documentation you can optionally specify the section, for example man unw_get_proc_name or man 3 unw_get_proc_name. You would need to specify the section if there was a manual entry with that name in a different section.

This practice goes back to the UNIX days. I've personally seen it going back to Solaris 2.5.1 (1994-1995), but it's probably older than that.

What do the numbers after command and system call names mean in *nix?

These numbers refer to Unix man sections.

1   Commands available to users
2 Unix and C system calls
3 C library routines for C programs
4 Special file names
5 File formats and conventions for files used by Unix
6 Games
7 Word processing packages
8 System administration commands and procedures

You can specify a section number with the man command by just listing the section number:

man 1 somecommand  

would look for somecommand in section 1 of the man pages.

Wikipedia has some additional information on this as does this page on how to use man pages.

What exactly does the '2' mean when someone writes read(2) while specifying the system call?

The bracket is used to specify the section of man pages. Man pages are organized into different sections and that section number specifies what type of "thing" it is. From Wikipedia, a common organization of sections(on Research Unix, BSD, OS X and Linux) is like this:

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

For example, by read(2) it meant it is talking about OS system call read.

Linux/Unix man page syntax conventions

Square Brackets [ ]

The square brackets ( [ ] ) indicate that the enclosed element (parameter, value, or information) is optional. You can choose one or more items or no items. Do not type the square brackets themselves in the command line.

Example: [global options], [source arguments], [destination arguments]

Angle Brackets < >

The angle brackets ( < > ) indicate that the enclosed element (parameter, value, or information) is mandatory. You are required to replace the text within the angle brackets with the appropriate information. Do not type the angle brackets themselves in the command line.

Example: -f [set the File Name variable], -printer <printer name>, -repeat <months> <days> <hours> <minutes>, date access <mm/dd/yyyy>

In Unix-like systems, the ASCII hyphen–minus is commonly used to specify options. The character is usually followed by one or more letters. An argument that is a single hyphen–minus by itself without any letters usually specifies that a program should handle data coming from the standard input or send data to the standard output. Two hyphen–minus characters ( -- ) are used on some programs to specify "long options" where more descriptive option names are used. This is a common feature of GNU software.

Just do 'ls --help' and look at the options, it should be obvious to you.

 -A, --almost-all           do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print octal escapes for nongraphic characters
--block-size=SIZE use SIZE-byte blocks
-B, --ignore-backups do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last
modification of file status information)
with -l: show ctime and sort by name
otherwise: sort by ctime'
-C list entries by columns
--color[=WHEN]

What does numbers in parenthesis means in readelf outputs?

It is version symbol, where @GLIBC_2.2.5 comes from.

The number references to the entry of .gnu.version_r section

ELF symbol versioning is a GNU extension to ELF. When resolving a symbol with version, if the target symbol also has version, the version must match, or the symbol can be resolved.

To maintain compatibility the version is not stored inside .dynsym section. Instead it is stored inside .gnu.version section.

.gnu.version has exactly same number of entries as .dynsym section, each entry store the corresponding symbol version (with 0 means no version requirement).

version is a string, and .gnu.version stores a index which references to the .gnu.version_r table. The number follow the symbol name is the index.

Following describes how to find the version string of a symbol:

  1. assume resolving T symbol
  2. the symbol is located at n-th entryof .dynsym section
  3. look n-th entry of .gnu.version section, get the version number m
  4. traverse .gnu.version_r section, find entry with version number m
  5. the entry in .gnu.version_r section contains the corresponding version string (an index reference to .dynstr section)

The number following symbol name is the number m



Related Topics



Leave a reply



Submit