Cart 0
No products in the cart.

How to use the Linux apropos command ?

How to use the Linux apropos command ?

 

The Linux apropos command is a useful tool for obtaining information about various topics in Linux. It searches through a database of manual pages to find keywords and phrases that match given queries. It can be used to quickly find information on topics related to Linux commands and programs. 

Here at Fixwebnode, we shall look into how to use the apropos command and its various options explained with practical examples.

 

How to Use the apropos Command ?

Using the apropos command is simple. The basic syntax is as follows:

$ apropos [options] <query>

The query should be a keyword or phrase that you are looking for information about. For example, if you wanted to find information about the command "ls", you would use the query "ls".

The apropos command will then search through the database of manual pages and print out the results. The results will include a list of manual page titles and brief descriptions of each page.

 

apropos Command Options

The apropos command has several options that can be used to narrow down the search results.

1. -s

The -s option allows you to specify a section of the manual page database to search. For example, if you wanted to search only the section on system administration, you would use the option -s admin.

 

2. -w

The -w option allows you to search for multiple words at once. For example, if you wanted to find information about the command “ls” and the program “grep”, you would use the option -w “ls grep”.

 

3. -l

The -l option allows you to limit the results to only those that match the exact query. This can be useful if you are looking for a precise term or phrase.

 

4. -k

This option can be used to search for manual pages containing keywords rather than exact phrases.

 

5. -f

This option can be used to search for manual pages that contain the specified term in their filename.

 

6. -c

This option can be used to search for manual pages that contain the specified term in their description.

 

Examples of using apropos command 

Let's look at a few examples of how to use the apropos command with the above options:

 

1. To find manual pages related to the ls command that contain the term "files" in their title, type in the following command:

$ apropos -i files ls

2. To find manual pages related to the ls command that contain the term "files" in their filename, type in the following command:

$ apropos -f files ls

3. To find manual pages related to the ls command that contain the term "files" in their description, type in the following command:

$ apropos -c files ls

4. To find manual pages related to the ls command that contain the term "files" as a keyword, type in the following command:

$ apropos -k files ls

 

How to use Apropos Command on Different Linux Distributions ?

The apropos command is available on most Linux distributions. To use it, you will need to open a terminal window. 

 

1. Ubuntu:

Open the terminal window.

Enter the command `apropos <topic>`

 

2. CentOS:

Open the terminal window.

Enter the command `man -k <topic>`

 

3. Fedora:

Open the terminal window.

Enter the command `man -K <topic>`

 

[Need Linux support ? We can help you. ]

 



CONCLUSION

This article covers all about the apropos command. In fact, It can be used to quickly search through a database of manual pages to find relevant information.


icon

Sign up to Newsletter

...and receive a free support ticket.