“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.
If you encounter the below error while running the command mandb:
mandb: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
Debian | apt-get install man-db |
Ubuntu | apt-get install man-db |
Arch Linux | pacman -S man-db |
Kali Linux | apt-get install man-db |
CentOS | yum install man-db |
Fedora | dnf install man-db |
Raspbian | apt-get install man-db |
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