System
whatis
Display one-line manual page descriptions.
Additional Notes
whatis searches the manual page name and short description fields (the NAME section) and displays matching entries. Each result shows the command name, the manual section number, and a brief description. It uses the same database as apropos (the mandb index) but only matches the exact command name, not partial or keyword matches.
The database is created and updated by mandb (or makewhatis on some distributions). If the database is missing or outdated, whatis may fail to find entries even when the man pages exist. Running sudo mandb updates the database.
Syntax
whatis [options] name...
Parameters
name: Command, system call, library function, or other man page name to look up.
Common Options
-r,--regex: Interpret each name as a regular expression.-w,--wildcard: Interpret each name as a wildcard pattern (similar to shell globs).-s section,--section section: Limit the search to a specific manual section.-l,--long: Do not truncate the description to the terminal width.-M path,--manpath path: Specify an alternative man page path.-p,--sections: List available sections and exit.
Examples
whatis ls
Show the description for ls: "list directory contents".
whatis -r '^pri.*$'
Search for commands starting with "pri" using regex.
whatis -w 'zip*'
Search for all commands matching the wildcard pattern zip*.
whatis -s 3 printf
Look up the C library function printf in section 3.
whatis -M /usr/share/man/man-pages/ socket
Search a custom man page path.
Practical Notes
whatisis equivalent toman -f name.- For broader keyword searches, use
apropos(orman -k). - If
whatisreturns "nothing appropriate," ensure the mandb database is up to date withsudo mandb. - The output format is:
command (section) - description text. - Pipe
whatisoutput throughcolumn -torsortfor easier reading.