mandb Command Examples in Linux

“mandb” is a command used in Unix-like operating systems for managing the manual page (man) database. The man pages are pre-formatted manual pages that provide information about system commands and tools.

The mandb command updates the man page database to ensure that it contains the latest information about the installed software and commands. This is done by scanning the directories specified in the MANPATH environment variable and creating or updating the database with the information found in the man pages.

Using the mandb command can be useful in situations where new software is installed or existing software is updated and new man pages are added. By running mandb, you can make sure that the man page database is up-to-date and the latest information is available to users.

mandb Command Examples

1. Purge and process manual pages:

# mandb

2. Update a single entry:

# mandb --filename path/to/file

3. Create entries from scratch instead of updating:

# mandb --create

4. Only process user databases:

# mandb --user-db

5. Do not purge obsolete entries:

# mandb --no-purge

6. Check the validity of manual pages:

# mandb --test
Related Post