man is a system utility built into Linux that uses a pager such as less to display manual files stored in /usr/share/man/. It’s useful to display command options with detailed descriptions of what they do. There are 9 sections total, though not all commands will have content in each section – a lot of commands have content in sections 1, 5, and 8.
Related
#aprapos #info #pinfo
Basic Syntax
man [option] command
Man Page Sections
| Section Number | Description |
|---|---|
| 1 | User Commands – Commands that can be run by regular users, typically executed from a shell |
| 2 | System Calls – Functions provided by the kernel |
| 3 | Library Functions – Functions within program libraries |
| 4 | Devices and Special Files – Device drivers and special files |
| 5 | File Formats and Conventions – File formats and configuration file syntax |
| 6 | Games – Games that can be run on the system |
| 7 | Miscellaneous – Topics that don’t fit into other sections |
| 8 | System Administration Commands – Commands for system administrators, typically need root access |
| 9 | Kernel Interface – Kernel internal functions and structures |
Commonly Used Options
-
-f: This displays the one-line description of the specified command. -
-k: This searches the manual page descriptions for the specified keyword. -
-w: This displays the location of the manual page for the specified command, but does not display the page itself. -
-S: This specifies the colon-separated list of directories to search for manual pages. -
-a: This displays all manual pages matching the specified name, in all available sections.
Example Usage
-
man useradd: This displays the manual page for theuseraddcommand in section 1. -
man 2 read: This displays the manual page for thereadsystem call in section 2. -
man printf: This displays the manual page for theprintfC library function in section 3. -
man 5 passwd: This displays the manual page for thepasswdfile format in section 5. -
man 6 chess: This displays the manual page for thechessgame in section 6. -
man -k ssh: This searches for all manual pages containing the keywordssh. -
man -w grep: This displays the location of the manual page for thegrepcommand. -
man -S /usr/share/man:/usr/local/share/man ls: This specifies the directories to search for manual pages, and displays the manual page for thelscommand. -
man -a ls: This displays all manual pages for thelscommand, in all available sections.
Leave a Reply