APROPOS(1)

๐Ÿ“ฆ version 1.14.6, in epel 10, epel 9, fedora 43, fedora 44

๐Ÿ’– APROPOS(1) ๐Ÿ’–

okay bestie, we're doing the apropos page from the General Commands Manual and honestly? it's giving search-engine-for-your-manuals and I'm obsessed. let's get into it ๐Ÿซถ


โœจ NAME โœจ

apropos, whatis โ€” search manual page databases ๐Ÿ”


๐ŸŒธ SYNOPSIS ๐ŸŒธ

apropos [-afk] [-C file] [-M path] [-m path] [-O outkey] [-S arch]
        [-s section] expression ...

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

So the apropos and whatis utilities query manual page databases that were generated by makewhatis(8), evaluating expression for each file in each database. By default they show you the names, the section numbers, and the description lines of every matching manual. literally the whole vibe check for your docs ๐Ÿ’…

By default, apropos searches for makewhatis(8) databases in the default paths stipulated by man(1), and it uses case-insensitive extended regular expression matching over manual names and descriptions (the Nm and Nd macro keys). Multiple terms imply pairwise -o. no cap.

whatis is just a synonym for apropos -f. that's it, that's the whole thing โœจ

The options are as follows:

  • -a โ€” Instead of showing only the title lines, show the complete manual pages, just like man(1) -a would. If the standard output is a terminal device and -c is not specified, use less(1) to paginate them. In -a mode, the options -IKOTW described in the mandoc(1) manual are also available. (yes the mode got hands ๐Ÿ’…)
  • -C file โ€” Specify an alternative configuration file in man.conf(5) format.
  • -f โ€” Search for all words in expression in manual page names only. The search is case-insensitive and matches whole words only. In this mode, macro keys, comparison operators, and logical operators are not available.
  • -k โ€” Support the full expression syntax. It is the default for apropos.
  • -M path โ€” Use the colon-separated path instead of the default list of paths searched for makewhatis(8) databases. Invalid paths, or paths without manual databases, are ignored.
  • -m path โ€” Prepend the colon-separated *path*s to the list of paths searched for makewhatis(8) databases. Invalid paths, or paths without manual databases, are ignored.
  • -O outkey โ€” Show the values associated with the key outkey instead of the manual descriptions.
  • -S arch โ€” Restrict the search to pages for the specified machine(1) architecture. arch is case-insensitive. By default, pages for all architectures are shown.
  • -s section โ€” Restrict the search to the specified section of the manual. By default, pages from all sections are shown. See man(1) for a listing of sections.

The options -chlw are also supported and are documented in man(1). The options -fkl are mutually exclusive and override each other. pick a lane, bestie ๐Ÿ˜ญ

An expression consists of search terms joined by logical operators -a (and) and -o (or). The -a operator has precedence over -o and both are evaluated left-to-right.

  • ( expr ) โ€” True if the subexpression expr is true.
  • expr1 -a expr2 โ€” True if both expr1 and expr2 are true (logical โ€˜andโ€™).
  • expr1 [-o] expr2 โ€” True if expr1 and/or expr2 evaluate to true (logical โ€˜orโ€™).
  • term โ€” True if term is satisfied. This has syntax [[key[,key...]](=|~)]val, where key is an mdoc(7) macro to query and val is its value. See โ€œMacro Keysโ€ for a list of available keys. Operator = evaluates a substring, while ~ evaluates a case-sensitive extended regular expression.
  • -i term โ€” If term is a regular expression, it is evaluated case-insensitively. Has no effect on substring terms.

Results are sorted first according to the section number in ascending numerical order, then by the page name in ascending ascii(7) alphabetical order, case-insensitive. so tidy, so organized, we love a sorted queen ๐Ÿ‘‘

Each output line is formatted as

name[, name...](sec) - description

Where โ€œnameโ€ is the manual's name, โ€œsecโ€ is the manual section, and โ€œdescriptionโ€ is the manual's short description. If an architecture is specified for the manual, it is displayed as

name(sec/arch) - description

Resulting manuals may be accessed as

$ man -s sec name

If an architecture is specified in the output, use

$ man -s sec -S arch name

๐ŸŒˆ Macro Keys ๐ŸŒˆ

Queries evaluate over a subset of mdoc(7) macros indexed by makewhatis(8). In addition to the macro keys listed below, the special key any may be used to match any available macro key. (it's giving "wildcard, but make it fashion" โœจ)

Names and description:

  • Nm โ€” manual name
  • Nd โ€” one-line manual description
  • arch โ€” machine architecture (case-insensitive)
  • sec โ€” manual section number

Sections and cross references:

  • Sh โ€” section header (excluding standard sections)
  • Ss โ€” subsection header
  • Xr โ€” cross reference to another manual page
  • Rs โ€” bibliographic reference

Semantic markup for command line utilities:

  • Fl โ€” command line options (flags)
  • Cm โ€” command modifier
  • Ar โ€” command argument
  • Ic โ€” internal or interactive command
  • Ev โ€” environmental variable
  • Pa โ€” file system path

Semantic markup for function libraries:

  • Lb โ€” function library name
  • In โ€” include file
  • Ft โ€” function return type
  • Fn โ€” function name
  • Fa โ€” function argument type and name
  • Vt โ€” variable type
  • Va โ€” variable name
  • Dv โ€” defined variable or preprocessor constant
  • Er โ€” error constant
  • Ev โ€” environmental variable

Various semantic markup:

  • An โ€” author name
  • Lk โ€” hyperlink
  • Mt โ€” โ€œmailtoโ€ hyperlink
  • Cd โ€” kernel configuration declaration
  • Ms โ€” mathematical symbol
  • Tn โ€” tradename

Physical markup:

  • Em โ€” italic font or underline
  • Sy โ€” boldface font
  • Li โ€” typewriter font

Text production:

  • St โ€” reference to a standards document
  • At โ€” AT&T UNIX version reference
  • Bx โ€” BSD version reference
  • Bsx โ€” BSD/OS version reference
  • Nx โ€” NetBSD version reference
  • Fx โ€” FreeBSD version reference
  • Ox โ€” OpenBSD version reference
  • Dx โ€” DragonFly version reference

In general, macro keys are supposed to yield complete results without expecting the user to consider actual macro usage. For example, results include:

Fa   function arguments appearing on Fn lines
Fn   function names marked up with Fo macros
In   include file names marked up with Fd macros
Vt   types appearing as function return types and
     types appearing in function arguments in the SYNOPSIS

๐Ÿฆ‹ ENVIRONMENT ๐Ÿฆ‹

  • MANPAGER โ€” Any non-empty value of the environment variable MANPAGER is used instead of the standard pagination program, less(1); see man(1) for details. Only used if -a or -l is specified.
  • MANPATH โ€” A colon-separated list of directories to search for manual pages; see man(1) for details. Overridden by -M, ignored if -l is specified.
  • PAGER โ€” Specifies the pagination program to use when MANPAGER is not defined. If neither PAGER nor MANPAGER is defined, less(1) is used. Only used if -a or -l is specified.

๐Ÿ’œ FILES ๐Ÿ’œ

  • mandoc.db โ€” name of the makewhatis(8) keyword database
  • /etc/man.conf โ€” default man(1) configuration file

โญ EXIT STATUS โญ

The apropos utility exits 0 on success, and >0 if an error occurs. simple. clean. iconic. โœจ


๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

Search for ".cf" as a substring of manual names and descriptions:

$ apropos =.cf

Include matches for ".cnf" and ".conf" as well:

$ apropos =.cf =.cnf =.conf

Search in names and descriptions using a case-sensitive regular expression:

$ apropos '~set.?[ug]id'

Search for all manual pages in a given section:

$ apropos -s 9 .

Search for manuals in the library section mentioning both the "optind" and the "optarg" variables:

$ apropos -s 3 Va=optind -a Va=optarg

Do exactly the same as calling whatis with the argument "ssh":

$ apropos -- -i 'Nm~[[:<:]]ssh[[:>:]]'

The following two invocations are equivalent:

$ apropos -S arch -s section expression

$ apropos \( expression \) -a arch~^(arch|any)$ -a sec~^section$

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

man(1), re_format(7), makewhatis(8)


๐Ÿ’… STANDARDS ๐Ÿ’…

The apropos utility is compliant with the IEEE Std 1003.1-2008 (โ€œPOSIX.1โ€) specification of man(1) -k.

All options, the whatis command, support for logical operators, macro keys, substring matching, sorting of results, the environment variables MANPAGER and MANPATH, the database format, and the configuration file are extensions to that specification. (overachiever behavior, honestly ๐Ÿซถ)


๐ŸŒธ HISTORY ๐ŸŒธ

Part of the functionality of whatis was already provided by the former manwhere utility in 1BSD. The apropos and whatis utilities first appeared in 2BSD. They were rewritten from scratch for OpenBSD 5.6. glow up era โœจ

The -M option and the MANPATH variable first appeared in 4.3BSD; -m in 4.3BSD-Reno; -C in 4.4BSD Lite1; and -S and -s in OpenBSD 4.5 for apropos and in OpenBSD 5.6 for whatis. The options -acfhIKklOTWw appeared in OpenBSD 5.7.


๐Ÿงš AUTHORS ๐Ÿงš

Bill Joy wrote manwhere in 1977 and the original BSD apropos and whatis in February 1979. The current version was written by Kristaps Dzonsons <kristaps@bsd.lv> and Ingo Schwarze <schwarze@openbsd.org>. legends, no notes ๐Ÿ’–


and that's the whole page bestie!! this one's from Debian, dated October 1, 2020, and it's the APROPOS(1) page from the General Commands Manual. go forth and apropos your heart out ๐ŸŽ€โœจ๐Ÿฆ‹
๐Ÿ“ฆ where this page comes from