TrumanWong

apropos

Find string in whatis database

Supplementary instructions

The apropos command searches for keywords in some specific database files that contain brief descriptions of system commands, and sends the results to standard output.

If you don't know the name of the command you need to complete a specific task, you can search for it using the Linux apropos utility using a keyword. This utility searches for a keyword and displays a short description of all man pages that contain a match. Alternatively, using the man utility with the -k (keyword) option, you can get the same results (actually the same command) as using the Linux apropos utility.

grammar

apropos [-dalhvV] -e|-[w|-r] [-s section] [-m system[,...]] [-M path] [-L locale] -C [file] keyword ...

Options

-d, --debug: Output debugging information.
-v, --verbose: Output detailed warning information.
-r, --regex: Interpret each keyword as a regular expression. This is the default behavior. Each keyword will match the man page and description.
-w, --wildcard: Interpret each keyword as a shell-style wildcard.
-e, --exact: Each keyword will match the man page name and description exactly.
-a, --and: Only display man pages and descriptions matching all keywords. By default, items matching any keyword are displayed.
-l, --long: Do not reduce output based on terminal width.
-s section, --section section: Only search the specified manual section.
-m system[,...], --systems=system[,...]: Used to find man pages for other operating systems.
-M path, --manpath=path: Specify to search from other colon-separated man page hierarchies. The $MANPATH environment variable is used by default. This option overrides the contents of $MANPATH.
-L locale, --locale=locale: apropos calls the C function setlocale to get the current localization information, including $LC_MESSAGE and $LANG. Use this option to provide a locale string to temporarily change localization information.
-C file, --config-file=file: Use this user configuration file instead of the default ~/.manpath.
-h, --help: Print help information and exit.
-V, --version: Print version information and exit.

return value

Returns 0 for success, 1 for usage, syntax, or configuration file errors, 2 for operation errors, and 16 for no matching content found.

Example

[root@localhost ~]# man -k who
at.allow [at] (5) - determine who can submit jobs via at or batch
at.deny [at] (5) - determine who can submit jobs via at or batch
jwhois (1) - client for the whois service
jwhois (rpm) - Internet whois/nicname client.
Net::LDAP::Extension::whoami (3pm) - LDAP Who am I? Operation
w (1) - Show who is logged on and what they are doing
who (1p) - display who is on the system
who (1) - show who is logged on
whoami (1) - print effective userid

[root@localhost ~]# apropos who
at.allow [at] (5) - determine who can submit jobs via at or batch
at.deny [at] (5) - determine who can submit jobs via at or batch
jwhois (1) - client for the whois service
jwhois (rpm) - Internet whois/nicname client.
Net::LDAP::Extension::WhoAmI (3pm) - LDAP Who am I? Operation
w (1) - Show who is logged on and what they are doing
who (1p) - display who is on the system
who (1) - show who is logged on
whoami (1) - print effective userid

Find man pages for emacs and vi that contain emacs and vi in their man page names and descriptions:

apropos -a emacs vi