Overview of man
`man` pages are the official documentation for software and commands installed on the system, and they are the first source of information most Linux users refer to when issues arise. Each page provides detailed explanations, usage instructions, options, examples, related files, bugs, copyright information, and more on a specific topic.
Sections of the man page
man pages are divided into several sections to easily find related content. Each section contains a specific type of information, and you can view a page of a specific section by specifying the section number after the command name (e.g., `man 1 ls` or `man 5 passwd`).
Section | Content |
---|---|
1 | Executable programs or shell commands |
2 | System calls (functions provided by the kernel) |
3 | Library functions (C library) |
4 | Special files (device files) |
5 | File formats and conventions (e.g., /etc/passwd, /etc/fstab) |
6 | Games |
7 | Miscellaneous (manuals, protocols, standards, etc.) |
8 | System administration commands (commands requiring root privileges) |
Navigating within the man page
When the `man` page opens, you will use a tool called `less` to navigate the pages. `less` helps you easily scroll through and search long text documents.
Basic navigation keys for less
- `Spacebar` or `f`: Move to the next page
- `b`: Move to the previous page
- `Enter` or `j`: Scroll down one line
- `k`: Scroll up one line
- `/pattern`: Search for the specified 'pattern' from the beginning. `n` (next match), `N` (previous match)
- `?pattern`: Search for the specified 'pattern' from the end.
- `q`: Exit the man page
Key man command options
`man` command provides several useful options necessary for finding and displaying manual pages.
1. Basic usage
2. Search and other options
Generated command:
Try combining the commands.
Description:
`man` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Learn how to efficiently navigate the documentation of the Linux system and obtain the necessary information through various examples of using the `man` command.
View manual page for the `ls` command
man ls
Opens the page containing all information about the usage, options, examples, etc. of the `ls` command.
View manual for the `passwd` file format
man 5 passwd
Views the description of the `/etc/passwd` file format (section 5), not the `passwd` command (section 1).
Search for keywords related to network commands
man -k network
Searches for all items that contain the word 'network' in the title and short description of the manual pages. (Actually the same as `apropos network`)
View the short description of the `echo` command
man -f echo
Outputs a brief one-line description of the `echo` command. (Actually the same as `whatis echo`)
View all manual pages related to `printf`
man -a printf
`printf` exists as a shell command (section 1) and as a C library function (section 3). You can view both pages in sequence using the `-a` option.