Overview
`whatis` searches the manual page database for installed commands, functions, and file formats, and outputs a brief description of the matching entries. This is suitable for quickly checking what a command does before opening its full manual page with the `man` command.
Key Features
- Provides a one-line summary for commands/functions/file formats
- Searches the manual page database
- Supports quick information retrieval
Key Options
The `whatis` command offers several useful options to control the search behavior or specify particular manual sections.
Search and Output
Generated command:
Try combining the commands.
Description:
`whatis` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Various examples of how to use the `whatis` command.
Basic Usage
whatis ls
Check the summary information for the `ls` command.
Wildcard Search
whatis -w 'grep*'
Find summary information for all commands starting with `grep`.
Search Specific Sections
whatis -s 1,5 passwd
Check information for the `passwd` command in user commands (section 1) and file formats (section 5).
Regular Expression Search
whatis -r 'user|group'
Search for commands containing 'user' or 'group' using a regular expression.
Tips & Notes
Useful tips and points to note when using `whatis`.
Database Updates
`whatis` uses a manual page database. If new manual pages are installed or existing ones are updated, `whatis` might not find the information. In such cases, you need to update the database by running the `sudo mandb` command.
Update Manual Database
sudo mandb
Manually update the `whatis` database.
Difference from apropos
`whatis` searches for the first line of the manual page for the exact keyword specified, whereas `apropos` (equivalent to `man -k`) searches for keywords within the names and descriptions of manual pages. Therefore, `apropos` provides broader search results.