man: command not found

Linux manual pages, or man pages, contain the complete documentation that is specific to each Linux command. The man pages are available on Linux systems by default. The man page for a specific command is displayed using the man command. They usually include information such as the command’s name, its syntax, a description of its purpose, the options it supports, examples of the common usage of the command, and a list of related commands.

Man pages are perhaps the most immediate source of help available when you need to learn more about what a command does or how to operate it. They are especially useful in situations where Internet access is not available. However, man pages can be difficult to parse for someone unfamiliar with how they’re formatted.

Syntax

The syntax of the man command is:

# man {command}

man Command Options

The man command supports different options. Some of the frequently used options are listed here.

Option Description
-a Finds all entries matching the query.
-D Displays debugging information.
-f Displays a short description of the command along with the man pages/sections.
-h Displays help options for the man command.
-k Lists all manual pages/sections containing the keyword along with their location.
-K Searches for the specified string on all pages.
-t Formats the man pages to enable printing.

If you encounter the below error while running the man command:

man: command not found

you may install the man-db package as per your choice of distribution.

Distribution Command
Debian apt-get install man-db
Ubuntu apt-get install man-db
Alpine apk add man
Arch Linux pacman -S man-db
Kali Linux apt-get install man-db
CentOS yum install man
Fedora dnf install man-db
Raspbian apt-get install man-db

man Command Examples

1. Display the man page for a command:

# man command

2. Display the man page for a command from section 7:

# man 7 command

3. List all available sections for a command:

# man -f command

4. Display the path searched for manpages:

# man --path

5. Display the location of a manpage rather than the manpage itself:

# man -w command

6. Display the man page using a specific locale:

# man command --locale=locale

7. Search for manpages containing a search string:

# man -k "search_string"
Related Post