whatis

system managementlinux
The whatis command is one of the most frequently used commands in Linux/Unix-like operating systems. whatis The whatis command displays brief manual page descriptions. It searches the manual page names and displays a brief description from the manual page header. This is particularly useful for quickly finding out what a command does without reading the full manual page.

Quick Reference

Command Name:

whatis

Category:

system management

Platform:

linux

Basic Usage:

whatis [options] [arguments]

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.

whatis ls pwd cd

Look up multiple commands at once. This will display brief descriptions for all specified commands.

Try It Yourself

Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

Understanding Syntax

Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

Notes

Key Points:

  • The whatis database is created using the makewhatis or mandb command
  • Results are displayed in alphabetical order
  • Each result includes the manual section number in parentheses
  • Multiple matches for the same command across different sections are shown
  • The command is case-sensitive by default

Manual Sections:

  • 1: Executable programs or shell commands
  • 2: System calls
  • 3: Library calls
  • 4: Special files
  • 5: File formats and conventions
  • 6: Games
  • 7: Miscellaneous
  • 8: System administration commands
  • 9: Kernel routines

Common Use Cases:

  • Quickly identifying what a command does
  • Finding related commands using wildcards
  • Verifying command availability on the system
  • Discovering command variants in different manual sections
  • Learning basic command functionality before reading full documentation

Related Commands:

  • man - Display detailed manual pages
  • apropos - Search manual page descriptions
  • info - Read Info documents
  • makewhatis - Create the whatis database
  • mandb - Create or update the manual page index caches

Environment Variables:

  • MANPATH: Determines the search path for manual pages
  • PAGER: Specifies the program used to display output
  • LANG: Affects the language of displayed descriptions
  • MANSECT: Determines which manual sections are searched by default

Tips & Tricks

1

Use the -w option to display the manual page location

2

Use the -s section option to search in specific sections

3

Use the -h option to display help

4

Use the -v option to display version information

5

Use the -l option to display long descriptions

Common Use Cases

Command description

Display a one-line description of a command

Quick reference

Get a brief overview of a command

Learning

Learn about new commands and utilities

Scripting

Use in shell scripts to dynamically retrieve command descriptions

Documentation

Access basic documentation for installed software

Related Commands

These commands are frequently used alongside whatis or serve similar purposes:

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

5

Documentation

Access basic documentation for installed software

Learn By Doing

The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the whatis command works in different scenarios.

$ whatis
View All Commands