What is the numbering next to the Unix commands?

Asked

Viewed 68 times

6

I often see command descriptions like this:

Like which(1) Unix command. Find the first instance of an Executable in the PATH. [Source]

Or this:

A cat(1) clone with Wings. [Source]

What are these numbers in parentheses that usually come after the name of some Unix command? It has something to do with the version of the commands?

  • 2

    It is the "section" of the command.

  • 2

    No time to write an answer now, but basically: https://superuser.com/q/297702 and https://unix.stackexchange.com/q/3586

1 answer

7


The number in parentheses refers to section of the searched keyword/command.

As the manual is divided into several parts (user commands, system calls, C library functions, devices, file formats and various other topics), there is a need for a disambiguation mechanism.

By default, when you do not specify the section, it refers to section 1 (save some system configuration by determining another _default).

This is found in the "manual of the manual", and it being installed, can be accessed with:

man man

If we were to specify the section (we don’t need it, because command is default option) it would be:

man 1 man

The relevant part of the manual is this:

MANUAL SECTIONS
The standard sections of the manual include:

1      User Commands
2      System Calls
3      C Library Functions
4      Devices and Special Files
5      File Formats and Conventions
6      Games et. al.
7      Miscellanea
8      System Administration tools and Daemons

Note that this list can be extended by the authors of each distribution.

If you prefer, you can check this version online:

https://linux.die.net/man/1/man

Note that even in the online version, there is the section number before the topic.


Example of disambiguation:

https://linux.die.net/man/1/printf

https://linux.die.net/man/3/printf

That in command line would be:

man 1 printf
man 3 printf

In this case note that the first is the command of shell, and the second is from the library’s function C.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.