Apropos (Unix)

From HandWiki - Reading time: 3 min

apropos
Operating systemUnix and Unix-like
TypeCommand

In computing, apropos is a command to search the man page files in Unix and Unix-like operating systems. Apropos takes its name from the French "à propos" (Latin "ad prōpositum") which means about. It is particularly useful when searching for commands without knowing their exact names.

Behavior

Often a wrapper for the man -k command, the apropos command is used to search the "name" sections of all manual pages for the specified string or strings (called keywords). The output is a list of all manual pages containing the search term (case insensitive) in their name or description. This is often useful if one knows the action that is desired, but does not remember the exact command or page name.

apropos usually searches in a precompiled database that is shared with whatis, a command for obtaining the brief description of a specific command whose exact name is already known.

Sample usage

The following example demonstrates the output of the apropos command:

$ apropos mount
free (1)             - Display amount of free and used memory in the system
mklost+found (8)     - create a lost+found directory on a mounted Linux second extended file system
mount (8)            - mount a file system
mountpoint (1)       - see if a directory is a mountpoint
ntfsmount (8)        - Read/Write userspace NTFS driver.
sleep (1)            - delay for a specified amount of time
switch_root (8)      - switch to another filesystem as the root of the mount tree.
umount (8)           - unmount file systems

In this example, apropos is used to search for the keyword "mount", and apropos returns the indicated man pages that include the term "mount".

The following example demonstrates the output of the apropos command with an regexp keyword (abc.n) and a regular keyword:

$ apropos abc.n xzless
XTestGrabControl (3) - XTest extension functions
xzless (1)           - view xz or lzma compressed (text) files

In this example, apropos is used to search for the keywords (with a regular expression) "abc.n" and xzless, and apropos returns the indicated man pages that include the keywords.

Related utilities

whatis is a command for obtaining the brief description of a specific command whose exact name is already known. It uses the same database as apropos does. On systems with mandoc, it is a wrapper for apropos -f (search by name only).[1]

$ whatis whatis
whatis(1)                - search the whatis database for complete words

makewhatis is a command for indexing all on-disk manuals into a database that apropos and whatis can read from. It first appeared in the 2BSD of 1979, but has since been rewritten multiple times in different implementations of man.[2] mandb is a command that performs the same function in man-db.[3]

The database is traditionally plain text, but man-db, the implementation found on many Linux distributions, use a Berkeley DB instead.[3][4] The mandoc implementation used on many BSD distributions likewise has its own innovations on the format.[5]

See also

References

  1. whatis(1) – OpenBSD General Commands Manual
  2. makewhatis(8) – OpenBSD System Manager's Manual
  3. 3.0 3.1 mandb(8) – Linux System Administration Manual
  4. "man-db, the on-line manual database". http://man-db.nongnu.org/. Retrieved 8 May 2019. "It uses a Berkeley DB database in place of the traditional flat-text whatis databases. man-db is used by several popular GNU/Linux distributions" 
  5. mandoc.db(5) – OpenBSD File Formats Manual

External links




Licensed under CC BY-SA 3.0 | Source: https://handwiki.org/wiki/Software:Apropos_(Unix)
4 views | Status: cached on September 29 2024 20:37:23
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF