whatis
Quick Reference
Command Name:
whatis
Category:
system management
Platform:
linux
Basic Usage:
Common Use Cases
- 1
Command description
Display a one-line description of a command
- 2
Quick reference
Get a brief overview of a command
- 3
Learning
Learn about new commands and utilities
- 4
Scripting
Use in shell scripts to dynamically retrieve command descriptions
Syntax
whatis [OPTION]... KEYWORD...
Options
Option | Description |
---|---|
-d, --debug | Print debugging information |
-l, --long | Don't trim output to terminal width |
-M PATH | Set search path for manual pages |
-r, --regex | Interpret each keyword as a regex |
-s LIST, --sections=LIST | Search only these manual sections |
-w, --wildcard | Use wildcards in the keywords |
--help | Display help information |
--version | Display version information |
Examples
How to Use These Examples
The examples below show common ways to use the whatis
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
whatis ls
Display a brief description of the ls command. This shows what the command does in one line.
whatis -w "ls*"
Search for all commands that start with "ls". The -w option allows using wildcards in the search.
whatis -r "ls.*"
Search using a regular expression pattern. This will find all entries containing "ls" followed by any characters.
Advanced Examples:
whatis -s 1,8 ls
Search for the ls command only in sections 1 (user commands) and 8 (system administration) of the manual.
whatis -l ls
Display the output in long format, showing all available manual page descriptions for ls.
whatis -M /usr/local/man ls
Search for ls command descriptions in a specific manual page directory.