apropos

system managementlinux
The apropos command is one of the most frequently used commands in Linux/Unix-like operating systems. apropos The apropos command searches the manual page names and descriptions for keywords and displays a list of matching manual pages. It's essentially equivalent to using man -k and is useful for finding commands related to a specific topic when you don't know the exact command name.

Quick Reference

Command Name:

apropos

Category:

system management

Platform:

linux

Basic Usage:

apropos [options] [arguments]

Common Use Cases

  • 1

    Command search

    Search for commands related to a specific topic

  • 2

    Keyword search

    Find commands based on keywords

  • 3

    Learning

    Discover new commands and utilities

  • 4

    Scripting

    Use in shell scripts to dynamically search for commands

Syntax

apropos [OPTION...] KEYWORD...

Options

Option Description
-a, --and Display only entries that match all keywords (AND operation)
-d, --debug Print debugging information
-e, --exact Search for exact matches only
-r, --regex Interpret each keyword as a regular expression
-s LIST, --sections=LIST Search only the given manual sections
-l, --long Don't trim output to fit screen width
-w, --wildcard Allow wildcards in keywords
--help Display help information
--version Display version information

Examples

How to Use These Examples

The examples below show common ways to use the apropos command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

#

Basic Examples:

apropos password

Search for commands related to "password" in manual pages.

apropos directory

Find all commands that have "directory" in their name or description.

apropos "list files"

Search for the phrase "list files" in manual page descriptions.

Advanced Examples:

apropos -e passwd

Search for exact matches to the keyword "passwd" only.

apropos -a create user

Find manual pages containing both "create" AND "user" keywords.

apropos -s 1,8 network

Search for "network" only in sections 1 (user commands) and 8 (administrator commands).

apropos -r "^mkfs\..*"

Use a regular expression to find all filesystem creation commands starting with "mkfs.".

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 apropos command is equivalent to man -k and searches the whatis database
  • Results include the manual section number in parentheses
  • Searches are case-insensitive by default
  • The command requires the whatis database to be built (using mandb or makewhatis)
  • Search result format: command_name (section) - description

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:

  • Finding commands when you know what you want to do but not which command to use
  • Discovering related commands for a specific task
  • Learning about available commands in a specific category
  • Finding all commands that handle a specific file format or protocol
  • Identifying alternative commands with similar functionality

Related Commands:

  • man - Display the complete manual page
  • whatis - Display one-line manual page descriptions
  • info - Read Info documentation
  • help - Get help for shell builtins
  • mandb or makewhatis - Create or update the whatis database

Environment Variables:

  • MANPATH: Determines the search path for manual pages
  • MANWIDTH: Sets the width for displaying man pages
  • PAGER: Specifies the program used to display output
  • LC_MESSAGES: Affects the language of displayed text

Tips & Tricks

1

Use the -a option to display all matches

2

Use the -e option to display the manual page location

3

Use the -s section option to search in specific sections

4

Use the -h option to display help

5

Use the -v option to display version information

Common Use Cases

Command search

Search for commands related to a specific topic

Keyword search

Find commands based on keywords

Learning

Discover new commands and utilities

Scripting

Use in shell scripts to dynamically search for commands

Documentation

Access basic documentation for installed software

Related Commands

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

Use Cases

1

Command search

Search for commands related to a specific topic

2

Keyword search

Find commands based on keywords

3

Learning

Discover new commands and utilities

4

Scripting

Use in shell scripts to dynamically search for commands

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 apropos command works in different scenarios.

$ apropos
View All Commands