Monday 28 August 2017

linux - What do the parentheses and number after a Unix command or C function mean?


I keep seeing parentheses and a number after a command in Unix or Linux or C function.


For example: man(8), ftok(2), mount(8), etc.


What do these mean? I see them in man too.



Answer



Manpage sections.



  1. Common UNIX command that can be used by all users. e.g. ls(1)

  2. Unix and C system calls e.g. mmap(2)

  3. C library routines for C programs e.g. system(3)

  4. Special files e.g. sudoers(4)

  5. System file formats e.g. lmhosts(5)

  6. Games e.g. fortune(6)

  7. Miscellaneous e.g. regex(7)

  8. System administration commands that is run by root only e.g. iwconfig(8)

  9. (?Linux specific) e.g.ksoftirqd(9)


The reason behind sections is that there are things sharing manual pages - mkdir(1) is the command used to create a directory whereas mkdir(2) is a system call that can be used to create a directory in a C program. Thus the different sections.


Annotated References [1,2] (as suggested):
http://www.gsp.com/support/man/ - The FreeBSD manpages arranged according to sections
http://manpages.unixforum.co.uk/man-pages/linux/suse-linux-10.1/ - SUSE manpages arranged according to sections
http://www.december.com/unix/ref/mansec.html - Yet another table for manpage sections. Initial basis of the list (See older edits of this post for details)


[1] explanations and examples are spontaneous fabrications in my head, for the matter.
[2] not that it is academically sound, but request for reference is one of the thing that slowed the growth of wikipedia. skeptics are trying to get others reference everything and some of the contributors just get way too annoyed to further answer anything, not that those who try to add useless/baseless stuff are properly removed from the pool (they just get the reference-request tag tagged onto their additions, contents not removed...)


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...