whatis - macOS


Overview

whatis is a macOS command-line utility that provides a concise description of a given macOS command, utility, or feature. It’s an invaluable tool for quickly finding information about a wide range of built-in functions.

Syntax

whatis [-a] [-e] [-p] command_name...

Options/Flags

  • -a: Display all possible matches for the specified command name.
  • -e: Display the exact match for the specified command name.
  • -p: Display the section header for each match.

Examples

  • Retrieve a description of the ls command:

    whatis ls
    
  • Display all possible matches for the rm command:

    whatis -a rm
    
  • Search for the exact match for the mkdir command and include the section header:

    whatis -ep mkdir
    

Common Issues

  • No matches found: Ensure that the command name is spelled correctly and that it’s recognized as a built-in macOS command.
  • Ambiguous matches: If multiple commands match the specified name, use the -a option to display all possibilities.

Integration

whatis can be combined with other macOS commands to enhance functionality. For example:

  • find -exec whatis ; to find and display descriptions of commands in a specific directory.
  • man: Displays detailed manual pages for commands and utilities.
  • help: Provides help for specific macOS commands.