Forrest logo
back to the manpath tool

manpath:tldr:bd910

manpath: Display the search path used to find man pages.
$ manpath
try on your machine

The "manpath" command is used to display and modify the search path used by the "man" command to locate the manual pages.

Essentially, "man" is a command-line utility found in UNIX-like operating systems that enables users to access the reference manuals or documentation for various commands, programs, and system components. These manuals provide detailed information about their usage, options, and functionality.

By default, "man" searches for the manual pages in specific directories defined by the MANPATH environment variable. However, the "manpath" command allows users to view or modify this search path.

When executed without any options, the "manpath" command will display the current search path for manual pages. It lists the directories separated by a colon (:).

For example:

$ manpath
/usr/local/man:/usr/share/man:/usr/man

This output indicates that the "man" command is searching for manual pages in the directories "/usr/local/man", "/usr/share/man", and "/usr/man", in that order.

The "manpath" command also provides various options to modify the search path. For instance, using the "-m" option allows the addition of directories to the front of the existing search path. Here's an example:

$ manpath -m /path/to/newdir

This command will add "/path/to/newdir" to the beginning of the current search path.

In summary, "manpath" is a command used to view or modify the search path for the "man" command, which locates and displays manual pages in UNIX-like systems.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the manpath tool