Linux Command to Locate Programs and Documentation Files

How to Locate Programs and Documentation Files in Linux

Question

Which of the following commands can be used to locate programs and their corresponding man pages and configuration files?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

E

The correct answer is E. whereis.

The whereis command is used to locate binary, source, and manual page files for commands. It is a useful tool for finding the location of important files for programs installed on the system. The output of the whereis command typically includes the path to the binary executable, source code files, and manual pages for a given command.

Here is an example of how to use the whereis command to locate the binary executable, source code files, and manual pages for the ls command:

bash
$ whereis ls ls: /bin/ls /usr/share/man/man1/ls.1.gz

In this example, the output shows that the ls command binary executable file is located in the /bin directory, and the manual page for the ls command is located in the /usr/share/man/man1 directory.

The other options listed in the question are:

A. dirname: The dirname command is used to extract the directory portion of a pathname. It is not used for locating programs or their corresponding man pages and configuration files.

B. which: The which command is used to locate the binary executable file for a given command. It does not typically locate source code files or manual pages.

C. basename: The basename command is used to extract the filename portion of a pathname. It is not used for locating programs or their corresponding man pages and configuration files.

D. query: There is no Linux command named query.