Why are *nix commands referred to as Man(1), Diff(1), Cat(1), etc [duplicate] Why are *nix commands referred to as Man(1), Diff(1), Cat(1), etc [duplicate] unix unix

Why are *nix commands referred to as Man(1), Diff(1), Cat(1), etc [duplicate]


It's the manual section its man page lives in. From man man:

   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 eg /etc/passwd   6   Games   7   Miscellaneous  (including  macro  packages and conven-       tions), e.g. man(7), groff(7)   8   System administration commands (usually only for root)   9   Kernel routines [Non standard]


All of the answers submitted previously are correct -- the (1) refers to the section of the online man pages. But your next question may as well be: why refer to the manual section at all?

The answer is that the same word or command may appear in different sections. For example, "passwd" refers to both the command to change your password and to the file /etc/passwd. Consequently, if you are talking about the former, you should write passwd(1) and when talking about the latter, write passwd(5).

The man command has a way of forcing it to use a specific section rather than searching from beginning to end. On my Unix system (a Mac), just typing man passwd will bring up the entry out of section 1. To show the entry out of section 5, use

man 5 passwd


       1    General commands (tools and utilities).       2    System calls and error numbers.       3    Libraries.       3p   perl(1) programmer's reference guide.       4    Device drivers.       5    File formats.       6    Games.       7    Miscellaneous.       8    System maintenance and operation commands.       9    Kernel internals.

From 'man man' on any reasonable unix system.