Open In App

apropos command in Linux with Examples

Last Updated : 17 Jul, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

Linux/Unix comes with a huge number of commands and thus it become quite difficult sometimes to remember each and every command. apropos command becomes useful in such cases. apropos command helps the user when they don’t remember the exact command but knows a few keywords related to the command that define its uses or functionality. It searches the Linux man page with the help of the keyword provided by the user to find the command and its functions.

Syntax:

apropos [OPTION..] KEYWORD...

Example 1: Suppose you don’t know how to compress a file then you could type the following command in terminal and it will show all the related command and its short description or functionality.

Input:

After executing the above command you will observe a bunch of commands is listed on the terminal that deals with not only how to compress a file but also how to expand a compressed file, search a compressed file, comparing a compressed file etc.

Output:

Example 2: apropos also support multiple keywords if given as an argument i.e. we can also provide more than one keyword for a better search. Thus, if two keywords are provided the apropos command will display all the command’s list which contains either the first keyword in its man page description or the second keyword.

  • Input 1 (With one keyword):

    Output:

  • Input 2 (With multiple keyword):

    Output:

Options:

  • -d: This option is used to emit debugging messages. When this option is used then terminal returns man directories, global path, path directory, warnings, etc. of each command which is related to the search keyword.

  • -v: This option is used to print verbose warning messages.
  • -e, –exact: This option is used to search each keyword for exact match. If no option is used, the apropos command returns list of all the command whose description in the man page description matches with the keyword or which are somehow related to the keyword given in the argument. However, when the -e option is used, the apropos only returns the command whose description exactly matches with the keyword.

  • -w, –wildcard: This option is used when the keyword(s) contain wildcards. apropos will independently search the page name and the description matching against the keyword(s).

    All the command related to sudo are listed when sudo is given as a wildcard.

  • -a, –and: This option is used when we want all the keywords to match. It returns nothing if any one of the keywords supplied has no matching in the man page or description. In the below input, two keywords have been given and only two commands are displayed in the result since there is only one command that contains both the keyword.

  • -l, –long: By default, the output is trimmed to the terminal width. This option becomes handy when we don’t want the result to be truncated.

  • -C: This option is used when we don’t want to use the default(/manpath) but user configuration file.
  • -L: Define the locale for this search.
  • -m, –systems: This option use manual pages from other systems. This option is helpful when we want to search the man page description of other accessible operating system.
  • -M, –manpath: Set search path for manual pages to PATH rather than the default $MANPATH.
  • -s, –sections, –section: This option is used when we want to search only particular sections (colon-separated) that are given in the argument.

  • -?, –help: This option displays the help list.

  • -V, –version: Used to print program version.

  • -r, –regex: This option interpret each keyword as a regex(regular expression). The keyword will be independently matched against the page name and description.

Previous Article
Next Article

Similar Reads

Ccat – Colorize Cat Command Output command in Linux with Examples
ccat is a command-line tool for Linux and OSX, which is similar to the cat command in Linux. But the difference between cat and ccat is that the ccat shows the content of the file with the syntax highlighted. Currently, ccat supports the following programming languages. JavaScriptJavaRubyPythonGoCJSONInstallation of Ccat First, we are going to see
2 min read
How to Display Command History in Linux | history Command
The command-line interface in Linux provides powerful tools for users, and mastering command history is essential for efficient navigation and retrieval of previously executed commands. The history command is a valuable utility that allows users to view and search through their command history. In this comprehensive guide, we will explore the vario
4 min read
select command in Linux with examples
select command in Linux is used to create a numbered menu from which a user can select an option. If the user enters a valid option then it executes the set of command written in select block and then ask again to enter a number, if a wrong option is entered it does nothing. If user enters nothing and simply press 'enter' the option menu gets print
1 min read
ZIP command in Linux with examples
ZIP is a compression and file packaging utility for Unix. Each file is stored in a single .zip {.zip-filename} file with the extension .zip. Zip is used to compress files to reduce file size and is also used as a file package utility. Zip is available in many operating systems like Unix, Linux, windows, etc.If you have limited bandwidth between two
7 min read
atrm command in Linux with examples
atrm command is used to remove the specified jobs. To remove a job, its job number is passed in the command. A user can only delete jobs that belong to him. Only superuser can delete any job even if that belongs to another user. Syntax: atrm [-V] job [job...] Options: -V : Used to print the version number atrm -V job : Job number of the job which i
1 min read
comm command in Linux with examples
comm compare two sorted files line by line and write to standard output; the lines that are common and the lines that are unique. Suppose you have two lists of people and you are asked to find out the names available in one and not in the other, or even those common to both. comm is the command that will help you to achieve this. It requires two so
5 min read
cmp Command in Linux with examples
cmp command in Linux/UNIX is used to compare the two files byte by byte and helps you to find out whether the two files are identical or not. When cmp is used for comparison between two files, it reports the location of the first mismatch to the screen if difference is found and if no difference is found i.e the files compared are identical.cmp dis
5 min read
expand Command in LINUX with examples
Whenever you work with files in LINUX there can be a situation when you are stuck with a file containing many tabs and whatever you need to do with a file requires that file with no tabs but with spaces. In this situation, the task looks quite simple if you are dealing with a small file but what if the file you are dealing with is very big or you n
3 min read
df Command in Linux with examples
There might come a situation while using Linux when you want to know the amount of space consumed by a particular file system on your LINUX system or how much space is available on a particular file system. LINUX being command friendly provides a command line utility for this i.e df command that displays the amount of disk space available on the fi
8 min read
tee command in Linux with examples
tee command reads the standard input and writes it to both the standard output and one or more files. The command is named after the T-splitter used in plumbing. It basically breaks the output of a program so that it can be both displayed and saved in a file. It does both the tasks simultaneously, copies the result into the specified files or varia
2 min read