LX0-103 · Question #97
Which of the following commands can be used to locate programs and their corresponding man pages and configuration files?
The correct answer is E. whereis. The whereis command searches for a program's binary, source code, and man page files, making it the correct tool for locating all three components at once.
Question
Which of the following commands can be used to locate programs and their corresponding man pages and configuration files?
Options
- Adirname
- Bwhich
- Cbasename
- Dquery
- Ewhereis
How the community answered
(52 responses)- A2% (1)
- C4% (2)
- D6% (3)
- E88% (46)
Why each option
The whereis command searches for a program's binary, source code, and man page files, making it the correct tool for locating all three components at once.
dirname strips the non-directory suffix from a given path string and does not search for files at all.
which only locates the executable binary of a command by searching directories listed in the PATH variable, not man pages or configuration files.
basename strips the directory prefix from a path string and does not perform any file searching.
query is not a standard Linux utility for locating programs or their associated files.
whereis searches standard binary directories, man page directories, and source directories simultaneously, returning paths for the executable, its manual pages, and any configuration or source files. Unlike which, it is not limited to just the executable path. This makes it the only command in the list capable of locating programs along with their man pages and configuration files.
Concept tested: Linux whereis command for file location
Source: https://man7.org/linux/man-pages/man1/whereis.1.html
Topics
Community Discussion
No community discussion yet for this question.