
βmanβ command in Linux is used to access the systems manual page. You might have seen the section that says βsee alsoβ and contains some function names with some number in them, like βsee also brk(2)β in man malloc. Let us see what those numbers are and how to use them.
man 1 : It contains manual pages for the commands that regular users interact. The commands that are commonly used such as cal, ls, mkdir and more… It is used when you want to learn how to use a specific command or understand its options and parameters. βExecutable programs or shell commandsβ.
Ex: man 1 pwd, man 1 rm, man 1 mkdir
man 2 : It focuses on low-level functions that programs use to interact with the operating system. They provide direct access to the system resources. It is commonly used when you need to understand how a specific system call works. βSystem callsβ.
Ex: man 2 fork, man 2 daemon, man2 vfork
man 3 : It focuses on functions and APIs provided by the Linux programming libraries. Libraries simply mean the code that has already been written and can be used somewhere else. It is useful when you want to understand how a particular library function works and how to use it. βLibrary Callsβ.
Ex: man 3 printf, man 3 puts, man 3 snprintf
man 4 : It has information regarding special files in the system such as device files and device drivers. Β It is useful when you want to work with device related information. Β βSpecial files (found in /dev)β.
Ex: man 4 null. man 4 full, man 4 fuse
man 5 : It has information about file formats, configuration files and conventions that are followed by the system. It is useful when you want to refer the system configuration files for services, file system structures and file format specifications. βFile formats and conventionsβ.
Ex: man 5 group, man 5 gpasswd, man 5 sudoers
man 6 : It is dedicate in providing information about games, screensavers and other interactive demos. Used for entertainment and enjoyment. (I personally wouldnβt go to man 6 for entertainment, i would just play ludo or chess). βGamesβ.
Ex: man 6 intro , man 6 sudoku
man 7: It contains multiple miscellaneous topics. It gives an overview about different subsystems, conventions, standards, protocols etcβ¦ It is useful when you want to learn particular aspects of the system. βMiscellaneous (including micro packages and conventions)β.
Ex: man 7 signal, man 7 nptl, man 7 libc
man 8: It is used to manage and configure the systems. It is for users that have administrative privileges. It is useful if you want to perform tasks related to system administration. βSystem administrative commandsβ
Ex: man 8 sudo, man 8 savelog, man 8 lslocks
man 9: It contains details about kernel-related programming. It covers kernel specific functions, data structures, system calls and more kernel related information. βKernel routines(non-standard)β. May not be available on all Linux flavors.
Ex: (not available in my system)
It is difficult to search for what is available and what is not in those man page. Just use the following command and know which topics are present in a particular man section alongΒ with their short description.
βapropos -s <section_number> .βΒ // that is a dot, not a full stop. Grammatically yes, but programmatically no.
The default behavior of βmanβ command is to search for the command in the section defined in βMANPATHβ environment variable. (MANPATH configuration available at //etc/manpath.config)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An Article by: Yashwanth Naidu Tikkisetty
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
