The apropos command displays a list of all topics in the man pages (i.e., the standard manual that is built into Unix-like operating systems ) that are related to the subject of a query.
apropos takes its name from the English word with the same spelling (and the same pronunciation) that means relevant. It is particularly useful when searching for commands without knowing their exact names.
apropos's syntax is:
A single line is displayed on the monitor screen for each man page that contains one or more of the keyword(s) in its
NAME section. The
NAME section, which is the minimum required for every man page, consists of a single line containing the page's title (i.e., the name of the command or other topic) and a very brief description.
Each line returned by apropos contains three items about a specific man page: (1) its title (2) its section number (i.e., an integer from one to nine indicating which of the nine standard man sections the page is located in) and (3) the description from its NAME section.
The results for each keyword are listed separately. Thus, for example, if two keywords are used, a list of results for the first keyword is provided first, and this is followed by a list of results for the second keyword. There is no vertical space between the lists.
The following would provide information about the pstree command (which displays the names of the processes currently on the system in the form of a tree diagram):
A single line of information is returned, and it would look something like: pstree (1) - display a tree of processes
Because case is ignored by apropos during its search, the same result would be obtained by using all upper case letters or some combination of upper case and lower case letters, for example
The number of results returned would be greater if only the first few letters of pstree were used instead of the entire word. For example, the following would produce several additional lines of output because the letters pst are also part of other words in addition to pstree:
As another example, the following command returns information about the editing programs that are available on a system:
apropos often produces much more information than can fit on a single monitor screen. In such case, the output moves very rapidly up the screen and is difficult to read. One way to solve this problem is to pipe (i.e., send) the output to a command such as more or less that displays it one screenful at a time.
For example, using apropos to obtain information about the cat command (which is used to read and combine files) generates a very large amount of output. This is because the string (i.e., sequence of letters) cat is also found in other words that are frequently used in the NAME lines, such as authenticate, catalog,certificate, locate and verification. The following pipeline makes it possible to look at the output page by page, both forward (by pressing the space bar) and backward (by pressing the b key):
apropos cat | less
apropos produces the same result as the man command used with its -k option. The man command followed by a keyword displays the full contents of the man page about that topic (if such topic exists), but when used with its -k option it only shows the name, section number and first line of the page. Thus, for example,
man -k editor
returns the same result as
whatis command is similar to apropos except that it searches only for whole words that match the keywords, and it ignores parts of longer words that match the keywords. Thus, whatis is particularly useful if it is desired to obtain a brief description only about a specific command whose exact name is already known.
Thus, for example, whatis could be used to obtain the same information about the cat command that apropos provides, but without generating the extensive output about other, irrelevant topics. That is,
The following single line is returned: cat (1) - concatenate files and print on the standard output.
This output contains some of the arcane terminology that is typical of the man pages and other documentation for Unix-like operating systems. concatenate filesmeans to combine the contents of two or more files into a single new file without deleting the originals. Print means to send or to display, and standard output is, by default, the display screen. Such terminology can seem confusing to newcomers, but it typically becomes natural, and even preferred, as users become familiar with it.
Related Results :
- Installing PHP in Linux
- Linux Basics
- SCP and SSH Remote Linux
- Create your own commands in linux
- Aspell - Spellcheck a file.
- awk or gawk (gnu awk)
- bc - arbitrary precision calculator language
- bg - Send job to background
- bind bash
- Related Posts are generally User Blog posts.
- or Other tutorials from other networks of w3clan.com.
- Any registered user can create related posts based on search term tags.